コード例 #1
0
ファイル: unitTestHelper.cpp プロジェクト: rodeofx/USD
HdRenderPassSharedPtr const &
Hd_TestDriver::GetRenderPass(bool withGuides)
{
    if (withGuides) {
        if (!_geomAndGuidePass) {
            TfTokenVector renderTags;
            renderTags.push_back(HdTokens->geometry);
            renderTags.push_back(HdTokens->guide);
            
            HdRprimCollection col = HdRprimCollection(
                                     HdTokens->geometry,
                                     _reprSelector);
            col.SetRenderTags(renderTags);
            _geomAndGuidePass = HdRenderPassSharedPtr(
                new Hd_UnitTestNullRenderPass(&_sceneDelegate->GetRenderIndex(), col));
        }
        return _geomAndGuidePass;
    } else {
        if (!_geomPass) {
            TfTokenVector renderTags;
            renderTags.push_back(HdTokens->geometry);

            HdRprimCollection col = HdRprimCollection(
                                        HdTokens->geometry,
                                        _reprSelector);
            col.SetRenderTags(renderTags);
            _geomPass = HdRenderPassSharedPtr(
                new Hd_UnitTestNullRenderPass(&_sceneDelegate->GetRenderIndex(), col));
        }
        return _geomPass;
    }
}
コード例 #2
0
ファイル: unitTestHelper.cpp プロジェクト: rodeofx/USD
void
Hd_TestDriver::SetRepr(HdReprSelector const &reprSelector)
{
    _reprSelector = reprSelector;

    if (_geomAndGuidePass) {
        TfTokenVector renderTags;
        renderTags.push_back(HdTokens->geometry);
        renderTags.push_back(HdTokens->guide);
        
        HdRprimCollection col = HdRprimCollection(
                                 HdTokens->geometry,
                                 _reprSelector);
        col.SetRenderTags(renderTags);
        _geomAndGuidePass->SetRprimCollection(col);
    }
    if (_geomPass) {
        TfTokenVector renderTags;
        renderTags.push_back(HdTokens->geometry);
        
        HdRprimCollection col = HdRprimCollection(
                                 HdTokens->geometry,
                                 _reprSelector);
        col.SetRenderTags(renderTags);
        _geomPass->SetRprimCollection(col);
    }
}
コード例 #3
0
ファイル: unitTestHelper.cpp プロジェクト: c64kernal/USD
// UsdImaging_TestDriver
void
UsdImaging_TestDriver::_Init(UsdStageRefPtr const& usdStage,
                             TfToken const &collectionName,
                             TfToken const &reprName,
                             TfTokenVector const &renderTags)
{
    _renderIndex = HdRenderIndex::New(&_renderDelegate);
    TF_VERIFY(_renderIndex != nullptr);
    _delegate = new UsdImagingDelegate(_renderIndex, SdfPath::AbsoluteRootPath());

    _stage = usdStage;
    _delegate->Populate(_stage->GetPseudoRoot());
    HdRprimCollection col = HdRprimCollection(collectionName, reprName);
    col.SetRenderTags(renderTags);
    _geometryPass = HdRenderPassSharedPtr(new HdSt_RenderPass(_renderIndex, col));
    _renderPassState = HdRenderPassStateSharedPtr(new HdRenderPassState());
}