VTK  9.1.0
vtkVRModel.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: Visualization Toolkit
4Module: vtkVRModel.h
5
6Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7All rights reserved.
8See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10This software is distributed WITHOUT ANY WARRANTY; without even
11the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12PURPOSE. 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
37class vtkMatrix4x4;
38class vtkVRRay;
39
40class VTKRENDERINGVR_EXPORT vtkVRModel : public vtkObject
41{
42public:
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
66 vtkEventDataDevice TrackedDevice = vtkEventDataDevice::Unknown;
67
68protected:
70 ~vtkVRModel() override;
71
72 virtual void FillModelHelper() = 0;
73 virtual void SetPositionAndTCoords() = 0;
76
77 std::string ModelName;
78
80 bool Loaded;
82
87
88 // Controller ray
90
91private:
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:113
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:145
Allocate and hold a VTK object.
Definition: vtkNew.h:165
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: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])
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
const std::string & GetName() const
Definition: vtkVRModel.h:50
void SetRayLength(double length)
vtkOpenGLHelper ModelHelper
Definition: vtkVRModel.h:83
bool Visibility
Definition: vtkVRModel.h:79
virtual void LoadModelAndTexture(vtkOpenGLRenderWindow *win)=0
vtkVRRay * GetRay()
Definition: vtkVRModel.h:61
vtkNew< vtkMatrix4x4 > PoseMatrix
Definition: vtkVRModel.h:86
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
vtkEventDataDevice
platform-independent event data structures
Definition: vtkEventData.h:26