VTK  9.1.0
vtkOpenGLAvatar.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkOpenGLAvatar.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
23#ifndef vtkOpenGLAvatar_h
24#define vtkOpenGLAvatar_h
25
26#include "vtkAvatar.h"
27#include "vtkNew.h" // for ivars
28#include "vtkRenderingVRModule.h" // For export macro
29
30class vtkOpenGLActor;
33class vtkVRRay;
35class vtkTextProperty;
36
37class VTKRENDERINGVR_EXPORT vtkOpenGLAvatar : public vtkAvatar
38{
39public:
41 vtkTypeMacro(vtkOpenGLAvatar, vtkAvatar);
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
49
50 double* GetBounds() VTK_SIZEHINT(6) override;
51
52 void SetUseLeftHand(bool val) override;
53 void SetUseRightHand(bool val) override;
54 void SetShowHandsOnly(bool val) override;
55
56 // Set Ray parameters
57 void SetLeftShowRay(bool v);
58 void SetRightShowRay(bool v);
59 void SetRayLength(double length);
60
61 void SetLabel(const char* label);
62 vtkTextProperty* GetLabelTextProperty();
63
64protected:
66 ~vtkOpenGLAvatar() override;
67
68 // move the torso and arms based on head/hand inputs.
69 void CalcBody();
70
74 vtkNew<vtkOpenGLActor> LeftHandActor;
76 vtkNew<vtkOpenGLActor> RightHandActor;
77 vtkNew<vtkOpenGLPolyDataMapper> BodyMapper[NUM_BODY];
78 vtkNew<vtkOpenGLActor> BodyActor[NUM_BODY];
79
80 vtkNew<vtkVRRay> LeftRay;
81 vtkNew<vtkVRRay> RightRay;
82
84
85private:
86 vtkOpenGLAvatar(const vtkOpenGLAvatar&) = delete;
87 void operator=(const vtkOpenGLAvatar&) = delete;
88};
89
90#endif
Renders head and hands for a user in VR.
Definition: vtkAvatar.h:30
Renders a flagpole (line) with a label at the top that faces the camera.
a simple class to control print indentation
Definition: vtkIndent.h:113
Allocate and hold a VTK object.
Definition: vtkNew.h:165
OpenGL actor.
OpenGL Avatar.
static vtkOpenGLAvatar * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RenderTranslucentPolygonalGeometry(vtkViewport *vp) override
Support the standard render methods.
double * GetBounds() override
Return a reference to the Prop3D's composite transform.
int RenderOpaqueGeometry(vtkViewport *vp) override
Actual Avatar render method.
PolyDataMapper using OpenGL to render.
OpenGL renderer.
represent text properties.
VR device model.
Definition: vtkVRRay.h:36
abstract specification for Viewports
Definition: vtkViewport.h:47
@ length
Definition: vtkX3D.h:399
#define VTK_SIZEHINT(...)