VTK  9.6.20260414
vtkVRModel.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
12
13#ifndef vtkVRModel_h
14#define vtkVRModel_h
15
16#include "vtkNew.h" // for ivar
17#include "vtkObject.h"
18#include "vtkOpenGLHelper.h" // ivar
19#include "vtkRenderingVRModule.h" // For export macro
20#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
21
22VTK_ABI_NAMESPACE_BEGIN
23class vtkMatrix4x4;
27class vtkVRRay;
28
29class VTKRENDERINGVR_EXPORT VTK_MARSHALAUTO vtkVRModel : public vtkObject
30{
31public:
32 vtkTypeMacro(vtkVRModel, vtkObject);
33 void PrintSelf(ostream& os, vtkIndent indent) override;
34
36
37 void Render(vtkOpenGLRenderWindow* win, vtkMatrix4x4* poseInTrackingCoordinates);
38
39 const std::string& GetName() const { return this->ModelName; }
40 void SetName(const std::string& modelName) { this->ModelName = modelName; }
41
42 // show the model
43 void SetVisibility(bool v) { this->Visibility = v; }
44 bool GetVisibility() { return this->Visibility; }
45
46 // Set Ray parameters
47 void SetShowRay(bool v);
48 void SetRayLength(double length);
49 void SetRayColor(double r, double g, double b);
50 vtkVRRay* GetRay() { return this->Ray; }
51
53
54protected:
56 ~vtkVRModel() override;
57
58 virtual void FillModelHelper() = 0;
59 virtual void SetPositionAndTCoords() = 0;
62
63 std::string ModelName;
64
66 bool Loaded;
68
73
74 // Controller ray
76
77private:
78 vtkVRModel(const vtkVRModel&) = delete;
79 void operator=(const vtkVRModel&) = delete;
80};
81
82VTK_ABI_NAMESPACE_END
83#endif
a simple class to control print indentation
Definition vtkIndent.h:108
represent and manipulate 4x4 transformation matrices
Allocate and hold a VTK object.
Definition vtkNew.h:168
OpenGL rendering window.
abstracts an OpenGL texture object.
void Render(vtkOpenGLRenderWindow *win, vtkMatrix4x4 *poseInTrackingCoordinates)
void SetShowRay(bool v)
virtual void SetPositionAndTCoords()=0
virtual void FillModelHelper()=0
std::string ModelName
Definition vtkVRModel.h:63
vtkNew< vtkVRRay > Ray
Definition vtkVRModel.h:75
vtkNew< vtkTextureObject > TextureObject
Definition vtkVRModel.h:71
void SetRayColor(double r, double g, double b)
~vtkVRModel() override
vtkOpenGLVertexBufferObject * ModelVBO
Definition vtkVRModel.h:70
void SetVisibility(bool v)
Definition vtkVRModel.h:43
bool Loaded
Definition vtkVRModel.h:66
bool FailedToLoad
Definition vtkVRModel.h:67
vtkNew< vtkMatrix4x4 > ModelToProjectionMatrix
Definition vtkVRModel.h:72
const std::string & GetName() const
Definition vtkVRModel.h:39
void SetRayLength(double length)
vtkOpenGLHelper ModelHelper
Definition vtkVRModel.h:69
bool Visibility
Definition vtkVRModel.h:65
virtual void LoadModelAndTexture(vtkOpenGLRenderWindow *win)=0
vtkVRRay * GetRay()
Definition vtkVRModel.h:50
virtual void CreateTextureObject(vtkOpenGLRenderWindow *win)=0
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetName(const std::string &modelName)
Definition vtkVRModel.h:40
bool GetVisibility()
Definition vtkVRModel.h:44
void ReleaseGraphicsResources(vtkWindow *win)
bool Build(vtkOpenGLRenderWindow *win)
VR device model.
Definition vtkVRRay.h:25
window superclass for vtkRenderWindow
Definition vtkWindow.h:61
#define VTK_MARSHALAUTO