MCPcopy Create free account
hub / github.com/Kitware/VTK / FindOrLoadRenderModel

Method FindOrLoadRenderModel

Rendering/OpenVR/vtkOpenVRRenderWindow.cxx:59–84  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

57
58//------------------------------------------------------------------------------
59vtkOpenVRModel* vtkOpenVRRenderWindow::FindOrLoadRenderModel(const char* pchRenderModelName)
60{
61 // create the model
62 vtkOpenVRModel* pRenderModel = vtkOpenVRModel::New();
63 pRenderModel->SetName(pchRenderModelName);
64
65 // start loading the model
66 auto status = vr::VRRenderModels()->LoadRenderModel_Async(
67 pRenderModel->GetName().c_str(), &pRenderModel->RawModel);
68 if (status == vr::EVRRenderModelError::VRRenderModelError_NoShapes)
69 {
70 pRenderModel->SetVisibility(false);
71 return pRenderModel;
72 }
73
74 if (status > vr::EVRRenderModelError::VRRenderModelError_Loading)
75 {
76 vtkErrorMacro(
77 "Unable to load render model " << pRenderModel->GetName() << " with status " << status);
78 pRenderModel->Delete();
79 return nullptr; // move on to the next tracked device
80 }
81
82 pRenderModel->SetVisibility(true);
83 return pRenderModel;
84}
85
86//------------------------------------------------------------------------------
87void vtkOpenVRRenderWindow::RenderModels()

Callers 1

RenderModelsMethod · 0.95

Calls 6

DeleteMethod · 0.65
NewFunction · 0.50
SetNameMethod · 0.45
c_strMethod · 0.45
GetNameMethod · 0.45
SetVisibilityMethod · 0.45

Tested by

no test coverage detected