VTK  9.3.20240328
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
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 
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkMatrix4x4;
25 class vtkTextureObject;
26 class vtkVRRay;
27 
28 class VTKRENDERINGVR_EXPORT vtkVRModel : public vtkObject
29 {
30 public:
31  vtkTypeMacro(vtkVRModel, vtkObject);
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
35 
36  void Render(vtkOpenGLRenderWindow* win, vtkMatrix4x4* poseInTrackingCoordinates);
37 
38  const std::string& GetName() const { return this->ModelName; }
39  void SetName(const std::string& modelName) { this->ModelName = modelName; }
40 
41  // show the model
42  void SetVisibility(bool v) { this->Visibility = v; }
43  bool GetVisibility() { return this->Visibility; }
44 
45  // Set Ray parameters
46  void SetShowRay(bool v);
47  void SetRayLength(double length);
48  void SetRayColor(double r, double g, double b);
49  vtkVRRay* GetRay() { return this->Ray; }
50 
52 
53 protected:
55  ~vtkVRModel() override;
56 
57  virtual void FillModelHelper() = 0;
58  virtual void SetPositionAndTCoords() = 0;
61 
63 
64  bool Visibility;
65  bool Loaded;
67 
72 
73  // Controller ray
75 
76 private:
77  vtkVRModel(const vtkVRModel&) = delete;
78  void operator=(const vtkVRModel&) = delete;
79 };
80 
81 VTK_ABI_NAMESPACE_END
82 #endif
a simple class to control print indentation
Definition: vtkIndent.h:108
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:140
abstract base class for most VTK objects
Definition: vtkObject.h:161
OpenGL rendering window.
abstracts an OpenGL texture object.
VR device model.
Definition: vtkVRModel.h:29
void Render(vtkOpenGLRenderWindow *win, vtkMatrix4x4 *poseInTrackingCoordinates)
void SetShowRay(bool v)
virtual void SetPositionAndTCoords()=0
virtual void FillModelHelper()=0
std::string ModelName
Definition: vtkVRModel.h:62
const std::string & GetName() const
Definition: vtkVRModel.h:38
vtkNew< vtkVRRay > Ray
Definition: vtkVRModel.h:74
vtkNew< vtkTextureObject > TextureObject
Definition: vtkVRModel.h:70
void SetRayColor(double r, double g, double b)
~vtkVRModel() override
vtkOpenGLVertexBufferObject * ModelVBO
Definition: vtkVRModel.h:69
void SetVisibility(bool v)
Definition: vtkVRModel.h:42
bool Loaded
Definition: vtkVRModel.h:65
bool FailedToLoad
Definition: vtkVRModel.h:66
vtkNew< vtkMatrix4x4 > ModelToProjectionMatrix
Definition: vtkVRModel.h:71
void SetRayLength(double length)
vtkOpenGLHelper ModelHelper
Definition: vtkVRModel.h:68
bool Visibility
Definition: vtkVRModel.h:64
virtual void LoadModelAndTexture(vtkOpenGLRenderWindow *win)=0
vtkVRRay * GetRay()
Definition: vtkVRModel.h:49
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:39
bool GetVisibility()
Definition: vtkVRModel.h:43
void ReleaseGraphicsResources(vtkWindow *win)
bool Build(vtkOpenGLRenderWindow *win)
VR device model.
Definition: vtkVRRay.h:25
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47
@ length
Definition: vtkX3D.h:393
@ string
Definition: vtkX3D.h:490