VTK  9.1.0
vtkVRModel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkVRModel.h
5 
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #ifndef vtkVRModel_h
26 #define vtkVRModel_h
27 
28 #include "vtkEventData.h" // for vtkEventDataDevice
29 #include "vtkNew.h" // for ivar
30 #include "vtkObject.h"
31 #include "vtkOpenGLHelper.h" // ivar
32 #include "vtkRenderingVRModule.h" // For export macro
33 
36 class vtkTextureObject;
37 class vtkMatrix4x4;
38 class vtkVRRay;
39 
40 class VTKRENDERINGVR_EXPORT vtkVRModel : public vtkObject
41 {
42 public:
43  vtkTypeMacro(vtkVRModel, vtkObject);
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47 
48  void Render(vtkOpenGLRenderWindow* win, const float poseInTrackingCoordinates[][4]);
49 
50  const std::string& GetName() const { return this->ModelName; }
51  void SetName(const std::string& modelName) { this->ModelName = modelName; }
52 
53  // show the model
54  void SetVisibility(bool v) { this->Visibility = v; }
55  bool GetVisibility() { return this->Visibility; }
56 
57  // Set Ray parameters
58  void SetShowRay(bool v);
59  void SetRayLength(double length);
60  void SetRayColor(double r, double g, double b);
61  vtkVRRay* GetRay() { return this->Ray; }
62 
64 
65  // The tracked device this model represents if any
67 
68 protected:
70  ~vtkVRModel() override;
71 
72  virtual void FillModelHelper() = 0;
73  virtual void SetPositionAndTCoords() = 0;
76 
78 
79  bool Visibility;
80  bool Loaded;
82 
87 
88  // Controller ray
90 
91 private:
92  vtkVRModel(const vtkVRModel&) = delete;
93  void operator=(const vtkVRModel&) = delete;
94 };
95 
96 #endif
a simple class to control print indentation
Definition: vtkIndent.h:34
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:36
abstract base class for most VTK objects
Definition: vtkObject.h:63
OpenGL rendering window.
abstracts an OpenGL texture object.
VR device model.
Definition: vtkVRModel.h:41
void SetShowRay(bool v)
virtual void SetPositionAndTCoords()=0
virtual void FillModelHelper()=0
std::string ModelName
Definition: vtkVRModel.h:77
void Render(vtkOpenGLRenderWindow *win, const float poseInTrackingCoordinates[][4])
const std::string & GetName() const
Definition: vtkVRModel.h:50
vtkNew< vtkVRRay > Ray
Definition: vtkVRModel.h:89
vtkNew< vtkTextureObject > TextureObject
Definition: vtkVRModel.h:85
void SetRayColor(double r, double g, double b)
~vtkVRModel() override
vtkOpenGLVertexBufferObject * ModelVBO
Definition: vtkVRModel.h:84
void SetVisibility(bool v)
Definition: vtkVRModel.h:54
bool Loaded
Definition: vtkVRModel.h:80
bool FailedToLoad
Definition: vtkVRModel.h:81
void SetRayLength(double length)
vtkOpenGLHelper ModelHelper
Definition: vtkVRModel.h:83
bool Visibility
Definition: vtkVRModel.h:79
virtual void LoadModelAndTexture(vtkOpenGLRenderWindow *win)=0
vtkNew< vtkMatrix4x4 > PoseMatrix
Definition: vtkVRModel.h:86
vtkVRRay * GetRay()
Definition: vtkVRModel.h:61
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:51
bool GetVisibility()
Definition: vtkVRModel.h:55
void ReleaseGraphicsResources(vtkWindow *win)
bool Build(vtkOpenGLRenderWindow *win)
VR device model.
Definition: vtkVRRay.h:36
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
@ length
Definition: vtkX3D.h:399
@ string
Definition: vtkX3D.h:496
vtkEventDataDevice
platform-independent event data structures
Definition: vtkEventData.h:26