VTK  9.2.5
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 "vtkNew.h" // for ivar
29#include "vtkObject.h"
30#include "vtkOpenGLHelper.h" // ivar
31#include "vtkRenderingVRModule.h" // For export macro
32
33class vtkMatrix4x4;
37class vtkVRRay;
38
39class VTKRENDERINGVR_EXPORT vtkVRModel : public vtkObject
40{
41public:
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
64protected:
66 ~vtkVRModel() override;
67
68 virtual void FillModelHelper() = 0;
69 virtual void SetPositionAndTCoords() = 0;
72
73 std::string ModelName;
74
76 bool Loaded;
78
83
84 // Controller ray
86
87private:
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:40
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:42
Allocate and hold a VTK object.
Definition: vtkNew.h:62
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: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
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
const std::string & GetName() const
Definition: vtkVRModel.h:49
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