VTK
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 "vtkRenderingOpenVRModule.h" // For export macro
27 #include "vtkObject.h"
28 #include "vtkOpenGLHelper.h"
29 #include "vtkNew.h"
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 
45  bool Build(vtkOpenVRRenderWindow *win);
46  void Render(vtkOpenVRRenderWindow *win,
47  const vr::TrackedDevicePose_t &pose);
48 
49  const std::string & GetName() const {
50  return this->ModelName;
51  }
52  void SetName(const std::string & modelName) {
53  this->ModelName = modelName;
54  };
55 
56  // show the model
57  void SetShow(bool v) {
58  this->Show = v;
59  };
60  bool GetShow() {
61  return this->Show;
62  };
63 
64  //Set Ray parameters
65  void SetShowRay(bool v);
66  void SetRayLength(double length);
67 
68  void ReleaseGraphicsResources(vtkRenderWindow *win);
69 
70  vr::RenderModel_t *RawModel;
71 
72 protected:
74  ~vtkOpenVRModel();
75 
77 
78  bool Show;
79  bool Loaded;
81 
82  vr::RenderModel_TextureMap_t *RawTexture;
87 
88  //Controller ray
90 };
91 
92 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:53
vtkNew< vtkTextureObject > TextureObject
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
vtkNew< vtkOpenVRRay > Ray
vr::RenderModel_TextureMap_t * RawTexture
void SetName(const std::string &modelName)
const std::string & GetName() const
vr::RenderModel_t * RawModel
abstracts an OpenGL texture object.
OpenVR rendering window.
create a window for renderers to draw into
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkOpenGLVertexBufferObject * ModelVBO
vtkOpenGLHelper ModelHelper
void SetShow(bool v)
OpenVR device model.
std::string ModelName
vtkNew< vtkMatrix4x4 > PoseMatrix