VTK  9.0.3
vtkOpenVRModel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 
5 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
6 All rights reserved.
7 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
23 #ifndef vtkOpenVRModel_h
24 #define vtkOpenVRModel_h
25 
26 #include "vtkNew.h" // for ivar
27 #include "vtkObject.h"
28 #include "vtkOpenGLHelper.h" // ivar
29 #include "vtkRenderingOpenVRModule.h" // For export macro
30 #include <openvr.h> // for ivars
31 
33 class vtkRenderWindow;
35 class vtkTextureObject;
36 class vtkMatrix4x4;
37 class vtkOpenVRRay;
38 
39 class VTKRENDERINGOPENVR_EXPORT vtkOpenVRModel : public vtkObject
40 {
41 public:
42  static vtkOpenVRModel* New();
43  vtkTypeMacro(vtkOpenVRModel, vtkObject);
44  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
47  void Render(vtkOpenVRRenderWindow* win, const vr::TrackedDevicePose_t& pose);
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  vtkOpenVRRay* GetRay() { return this->Ray; }
61 
63 
64  // the tracked device this model represents if any
65  vr::TrackedDeviceIndex_t TrackedDevice;
66 
67  vr::RenderModel_t* RawModel;
68 
69 protected:
71  ~vtkOpenVRModel() override;
72 
74 
75  bool Visibility;
76  bool Loaded;
78 
79  vr::RenderModel_TextureMap_t* RawTexture;
84 
85  // Controller ray
87 
88 private:
89  vtkOpenVRModel(const vtkOpenVRModel&) = delete;
90  void operator=(const vtkOpenVRModel&) = delete;
91 };
92 
93 #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:54
OpenVR device model.
~vtkOpenVRModel() override
vtkOpenVRRay * GetRay()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew< vtkTextureObject > TextureObject
bool Build(vtkOpenVRRenderWindow *win)
const std::string & GetName() const
std::string ModelName
vr::RenderModel_TextureMap_t * RawTexture
void SetRayColor(double r, double g, double b)
void ReleaseGraphicsResources(vtkWindow *win)
vtkNew< vtkOpenVRRay > Ray
vtkNew< vtkMatrix4x4 > PoseMatrix
void SetName(const std::string &modelName)
void SetShowRay(bool v)
static vtkOpenVRModel * New()
bool GetVisibility()
void SetRayLength(double length)
void SetVisibility(bool v)
void Render(vtkOpenVRRenderWindow *win, const vr::TrackedDevicePose_t &pose)
vtkOpenGLVertexBufferObject * ModelVBO
vtkOpenGLHelper ModelHelper
vr::RenderModel_t * RawModel
vr::TrackedDeviceIndex_t TrackedDevice
OpenVR device model.
Definition: vtkOpenVRRay.h:36
OpenVR rendering window.
create a window for renderers to draw into
abstracts an OpenGL texture object.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ length
Definition: vtkX3D.h:399
@ string
Definition: vtkX3D.h:496