本文整理汇总了C++中std::unique_ptr::AddSelectionTask方法的典型用法代码示例。如果您正苦于以下问题:C++ unique_ptr::AddSelectionTask方法的具体用法?C++ unique_ptr::AddSelectionTask怎么用?C++ unique_ptr::AddSelectionTask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::unique_ptr
的用法示例。
在下文中一共展示了unique_ptr::AddSelectionTask方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderSetupTask
void
My_TestGLDrawing::InitTest()
{
_renderIndex = HdRenderIndex::New(&_renderDelegate);
TF_VERIFY(_renderIndex != nullptr);
_delegate.reset(new Hdx_UnitTestDelegate(_renderIndex));
// prepare render task
SdfPath renderSetupTask("/renderSetupTask");
SdfPath renderTask("/renderTask");
SdfPath selectionTask("/selectionTask");
_delegate->AddRenderSetupTask(renderSetupTask);
_delegate->AddRenderTask(renderTask);
_delegate->AddSelectionTask(selectionTask);
// render task parameters.
VtValue vParam = _delegate->GetTaskParam(renderSetupTask, HdTokens->params);
HdxRenderTaskParams param = vParam.Get<HdxRenderTaskParams>();
param.enableLighting = true; // use default lighting
_delegate->SetTaskParam(renderSetupTask, HdTokens->params,
VtValue(param));
_delegate->SetTaskParam(renderTask, HdTokens->collection,
VtValue(HdRprimCollection(HdTokens->geometry,
HdReprSelector(HdReprTokens->hull))));
HdxSelectionTaskParams selParam;
selParam.enableSelection = true;
selParam.selectionColor = GfVec4f(1, 1, 0, 1);
selParam.locateColor = GfVec4f(1, 0, 1, 1);
_delegate->SetTaskParam(selectionTask, HdTokens->params,
VtValue(selParam));
// prepare scene
_InitScene();
SetCameraTranslate(GfVec3f(0, 0, -20));
// picking related init
_pickablesCol = HdRprimCollection(_tokens->pickables,
HdReprSelector(HdReprTokens->hull));
_marquee.InitGLResources();
_picker.InitIntersector(_renderIndex);
_SetPickParams();
// We have to unfortunately explictly add collections besides 'geometry'
// See HdRenderIndex constructor.
_delegate->GetRenderIndex().GetChangeTracker().AddCollection(_tokens->pickables);
// XXX: Setup a VAO, the current drawing engine will not yet do this.
glGenVertexArrays(1, &vao);
glBindVertexArray(vao);
glBindVertexArray(0);
}