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
vtkVRModel::SetShowRay
void SetShowRay(bool v)
vtkVRModel::Visibility
bool Visibility
Definition: vtkVRModel.h:79
vtkVRModel::Build
bool Build(vtkOpenGLRenderWindow *win)
vtkVRModel::LoadModelAndTexture
virtual void LoadModelAndTexture(vtkOpenGLRenderWindow *win)=0
vtkVRModel::SetVisibility
void SetVisibility(bool v)
Definition: vtkVRModel.h:54
vtkVRModel::FailedToLoad
bool FailedToLoad
Definition: vtkVRModel.h:81
vtkVRModel
VR device model.
Definition: vtkVRModel.h:41
vtkVRModel::PoseMatrix
vtkNew< vtkMatrix4x4 > PoseMatrix
Definition: vtkVRModel.h:86
vtkVRModel::ModelVBO
vtkOpenGLVertexBufferObject * ModelVBO
Definition: vtkVRModel.h:84
vtkOpenGLHelper.h
vtkVRModel::GetRay
vtkVRRay * GetRay()
Definition: vtkVRModel.h:61
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:82
vtkX3D::length
@ length
Definition: vtkX3D.h:399
vtkVRModel::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *win)
vtkVRModel::SetName
void SetName(const std::string &modelName)
Definition: vtkVRModel.h:51
vtkVRModel::Render
void Render(vtkOpenGLRenderWindow *win, const float poseInTrackingCoordinates[][4])
vtkVRModel::GetName
const std::string & GetName() const
Definition: vtkVRModel.h:50
vtkVRModel::SetPositionAndTCoords
virtual void SetPositionAndTCoords()=0
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkVRModel::vtkVRModel
vtkVRModel()
vtkVRModel::SetRayLength
void SetRayLength(double length)
vtkVRModel::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLHelper
Definition: vtkOpenGLHelper.h:31
vtkVRModel::CreateTextureObject
virtual void CreateTextureObject(vtkOpenGLRenderWindow *win)=0
vtkVRModel::TextureObject
vtkNew< vtkTextureObject > TextureObject
Definition: vtkVRModel.h:85
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkTextureObject
abstracts an OpenGL texture object.
Definition: vtkTextureObject.h:60
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:145
vtkOpenGLVertexBufferObject
Definition: vtkOpenGLVertexBufferObject.h:41
vtkEventData.h
vtkVRModel::GetVisibility
bool GetVisibility()
Definition: vtkVRModel.h:55
vtkNew< vtkTextureObject >
vtkVRRay
VR device model.
Definition: vtkVRRay.h:36
vtkObject.h
vtkX3D::string
@ string
Definition: vtkX3D.h:496
vtkVRModel::Ray
vtkNew< vtkVRRay > Ray
Definition: vtkVRModel.h:89
vtkEventDataDevice
vtkEventDataDevice
platform-independent event data structures
Definition: vtkEventData.h:26
vtkNew.h
vtkVRModel::ModelName
std::string ModelName
Definition: vtkVRModel.h:77
vtkVRModel::FillModelHelper
virtual void FillModelHelper()=0
vtkVRModel::SetRayColor
void SetRayColor(double r, double g, double b)
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:83
vtkVRModel::~vtkVRModel
~vtkVRModel() override
vtkVRModel::ModelHelper
vtkOpenGLHelper ModelHelper
Definition: vtkVRModel.h:83
vtkVRModel::Loaded
bool Loaded
Definition: vtkVRModel.h:80
vtkEventDataDevice::Unknown
@ Unknown