VTK
9.5.2
Main Page
Related Pages
Topics
Namespaces
Classes
Files
Examples
File List
File Members
Rendering
VR
vtkVRModel.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2
// SPDX-License-Identifier: BSD-3-Clause
12
13
#ifndef vtkVRModel_h
14
#define vtkVRModel_h
15
16
#include "
vtkNew.h
"
// for ivar
17
#include "
vtkObject.h
"
18
#include "
vtkOpenGLHelper.h
"
// ivar
19
#include "vtkRenderingVRModule.h"
// For export macro
20
21
VTK_ABI_NAMESPACE_BEGIN
22
class
vtkMatrix4x4
;
23
class
vtkOpenGLRenderWindow
;
24
class
vtkOpenGLVertexBufferObject
;
25
class
vtkTextureObject
;
26
class
vtkVRRay
;
27
28
class
VTKRENDERINGVR_EXPORT
vtkVRModel
:
public
vtkObject
29
{
30
public
:
31
vtkTypeMacro(
vtkVRModel
,
vtkObject
);
32
void
PrintSelf
(ostream& os,
vtkIndent
indent)
override
;
33
34
bool
Build
(
vtkOpenGLRenderWindow
* win);
35
36
void
Render
(
vtkOpenGLRenderWindow
* win,
vtkMatrix4x4
* poseInTrackingCoordinates);
37
38
const
std::string&
GetName
()
const
{
return
this->
ModelName
; }
39
void
SetName
(
const
std::string& modelName) { this->
ModelName
= modelName; }
40
41
// show the model
42
void
SetVisibility
(
bool
v) { this->
Visibility
= v; }
43
bool
GetVisibility
() {
return
this->
Visibility
; }
44
45
// Set Ray parameters
46
void
SetShowRay
(
bool
v);
47
void
SetRayLength
(
double
length);
48
void
SetRayColor
(
double
r,
double
g,
double
b);
49
vtkVRRay
*
GetRay
() {
return
this->
Ray
; }
50
51
void
ReleaseGraphicsResources
(
vtkWindow
* win);
52
53
protected
:
54
vtkVRModel
();
55
~vtkVRModel
()
override
;
56
57
virtual
void
FillModelHelper
() = 0;
58
virtual
void
SetPositionAndTCoords
() = 0;
59
virtual
void
CreateTextureObject
(
vtkOpenGLRenderWindow
* win) = 0;
60
virtual
void
LoadModelAndTexture
(
vtkOpenGLRenderWindow
* win) = 0;
61
62
std::string
ModelName
;
63
64
bool
Visibility
;
65
bool
Loaded
;
66
bool
FailedToLoad
;
67
68
vtkOpenGLHelper
ModelHelper
;
69
vtkOpenGLVertexBufferObject
*
ModelVBO
;
70
vtkNew<vtkTextureObject>
TextureObject
;
71
vtkNew<vtkMatrix4x4>
ModelToProjectionMatrix
;
72
73
// Controller ray
74
vtkNew<vtkVRRay>
Ray
;
75
76
private
:
77
vtkVRModel
(
const
vtkVRModel
&) =
delete
;
78
void
operator=(
const
vtkVRModel
&) =
delete
;
79
};
80
81
VTK_ABI_NAMESPACE_END
82
#endif
vtkIndent
a simple class to control print indentation
Definition
vtkIndent.h:29
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition
vtkMatrix4x4.h:32
vtkNew
Allocate and hold a VTK object.
Definition
vtkNew.h:58
vtkObject::vtkObject
vtkObject()
vtkOpenGLHelper
Definition
vtkOpenGLHelper.h:21
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition
vtkOpenGLRenderWindow.h:45
vtkOpenGLVertexBufferObject
Definition
vtkOpenGLVertexBufferObject.h:33
vtkTextureObject
In case DepthTextureCompare is true, specify the comparison function in use.
Definition
vtkTextureObject.h:34
vtkVRModel::Render
void Render(vtkOpenGLRenderWindow *win, vtkMatrix4x4 *poseInTrackingCoordinates)
vtkVRModel::SetShowRay
void SetShowRay(bool v)
vtkVRModel::SetPositionAndTCoords
virtual void SetPositionAndTCoords()=0
vtkVRModel::FillModelHelper
virtual void FillModelHelper()=0
vtkVRModel::ModelName
std::string ModelName
Definition
vtkVRModel.h:62
vtkVRModel::Ray
vtkNew< vtkVRRay > Ray
Definition
vtkVRModel.h:74
vtkVRModel::TextureObject
vtkNew< vtkTextureObject > TextureObject
Definition
vtkVRModel.h:70
vtkVRModel::SetRayColor
void SetRayColor(double r, double g, double b)
vtkVRModel::~vtkVRModel
~vtkVRModel() override
vtkVRModel::ModelVBO
vtkOpenGLVertexBufferObject * ModelVBO
Definition
vtkVRModel.h:69
vtkVRModel::vtkVRModel
vtkVRModel()
vtkVRModel::SetVisibility
void SetVisibility(bool v)
Definition
vtkVRModel.h:42
vtkVRModel::Loaded
bool Loaded
Definition
vtkVRModel.h:65
vtkVRModel::FailedToLoad
bool FailedToLoad
Definition
vtkVRModel.h:66
vtkVRModel::ModelToProjectionMatrix
vtkNew< vtkMatrix4x4 > ModelToProjectionMatrix
Definition
vtkVRModel.h:71
vtkVRModel::GetName
const std::string & GetName() const
Definition
vtkVRModel.h:38
vtkVRModel::SetRayLength
void SetRayLength(double length)
vtkVRModel::ModelHelper
vtkOpenGLHelper ModelHelper
Definition
vtkVRModel.h:68
vtkVRModel::Visibility
bool Visibility
Definition
vtkVRModel.h:64
vtkVRModel::LoadModelAndTexture
virtual void LoadModelAndTexture(vtkOpenGLRenderWindow *win)=0
vtkVRModel::GetRay
vtkVRRay * GetRay()
Definition
vtkVRModel.h:49
vtkVRModel::CreateTextureObject
virtual void CreateTextureObject(vtkOpenGLRenderWindow *win)=0
vtkVRModel::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVRModel::SetName
void SetName(const std::string &modelName)
Definition
vtkVRModel.h:39
vtkVRModel::GetVisibility
bool GetVisibility()
Definition
vtkVRModel.h:43
vtkVRModel::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *win)
vtkVRModel::Build
bool Build(vtkOpenGLRenderWindow *win)
vtkVRRay
VR device model.
Definition
vtkVRRay.h:25
vtkWindow
window superclass for vtkRenderWindow
Definition
vtkWindow.h:26
vtkNew.h
vtkObject.h
vtkOpenGLHelper.h
Generated on
for VTK by
1.15.0