VTK  9.2.6
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 "vtkNew.h" // for ivar
29 #include "vtkObject.h"
30 #include "vtkOpenGLHelper.h" // ivar
31 #include "vtkRenderingVRModule.h" // For export macro
32 
33 class vtkMatrix4x4;
36 class vtkTextureObject;
37 class vtkVRRay;
38 
39 class VTKRENDERINGVR_EXPORT vtkVRModel : public vtkObject
40 {
41 public:
42  vtkTypeMacro(vtkVRModel, vtkObject);
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
46 
47  void Render(vtkOpenGLRenderWindow* win, vtkMatrix4x4* poseInTrackingCoordinates);
48 
49  const std::string& GetName() const { return this->ModelName; }
50  void SetName(const std::string& modelName) { this->ModelName = modelName; }
51 
52  // show the model
53  void SetVisibility(bool v) { this->Visibility = v; }
54  bool GetVisibility() { return this->Visibility; }
55 
56  // Set Ray parameters
57  void SetShowRay(bool v);
58  void SetRayLength(double length);
59  void SetRayColor(double r, double g, double b);
60  vtkVRRay* GetRay() { return this->Ray; }
61 
63 
64 protected:
66  ~vtkVRModel() override;
67 
68  virtual void FillModelHelper() = 0;
69  virtual void SetPositionAndTCoords() = 0;
72 
74 
75  bool Visibility;
76  bool Loaded;
78 
83 
84  // Controller ray
86 
87 private:
88  vtkVRModel(const vtkVRModel&) = delete;
89  void operator=(const vtkVRModel&) = delete;
90 };
91 
92 #endif
a simple class to control print indentation
Definition: vtkIndent.h:119
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:151
abstract base class for most VTK objects
Definition: vtkObject.h:82
OpenGL rendering window.
abstracts an OpenGL texture object.
VR device model.
Definition: vtkVRModel.h:40
void Render(vtkOpenGLRenderWindow *win, vtkMatrix4x4 *poseInTrackingCoordinates)
void SetShowRay(bool v)
virtual void SetPositionAndTCoords()=0
virtual void FillModelHelper()=0
std::string ModelName
Definition: vtkVRModel.h:73
const std::string & GetName() const
Definition: vtkVRModel.h:49
vtkNew< vtkVRRay > Ray
Definition: vtkVRModel.h:85
vtkNew< vtkTextureObject > TextureObject
Definition: vtkVRModel.h:81
void SetRayColor(double r, double g, double b)
~vtkVRModel() override
vtkOpenGLVertexBufferObject * ModelVBO
Definition: vtkVRModel.h:80
void SetVisibility(bool v)
Definition: vtkVRModel.h:53
bool Loaded
Definition: vtkVRModel.h:76
bool FailedToLoad
Definition: vtkVRModel.h:77
vtkNew< vtkMatrix4x4 > ModelToProjectionMatrix
Definition: vtkVRModel.h:82
void SetRayLength(double length)
vtkOpenGLHelper ModelHelper
Definition: vtkVRModel.h:79
bool Visibility
Definition: vtkVRModel.h:75
virtual void LoadModelAndTexture(vtkOpenGLRenderWindow *win)=0
vtkVRRay * GetRay()
Definition: vtkVRModel.h:60
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:50
bool GetVisibility()
Definition: vtkVRModel.h:54
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