VTK  9.0.1
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 "vtkRenderingOpenVRModule.h" // For export macro
29 
30 class vtkOpenGLActor;
32 class vtkOpenGLRenderer;
33 class vtkOpenVRRay;
34 class vtkFlagpoleLabel;
35 class vtkTextProperty;
36 
37 class VTKRENDERINGOPENVR_EXPORT vtkOpenGLAvatar : public vtkAvatar
38 {
39 public:
40  static vtkOpenGLAvatar* New();
41  vtkTypeMacro(vtkOpenGLAvatar, vtkAvatar);
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  // void Render(vtkRenderer *ren, vtkMapper *mapper) override;
48  int RenderOpaqueGeometry(vtkViewport* vp) override;
50 
51  double* GetBounds() VTK_SIZEHINT(6) override;
52 
53  void SetUseLeftHand(bool val) override;
54  void SetUseRightHand(bool val) override;
55  void SetShowHandsOnly(bool val) override;
56 
57  // Set Ray parameters
58  void SetLeftShowRay(bool v);
59  void SetRightShowRay(bool v);
60  void SetRayLength(double length);
61 
62  void SetLabel(const char* label);
63  vtkTextProperty* GetLabelTextProperty();
64 
65 protected:
67  ~vtkOpenGLAvatar() override;
68 
69  // move the torso and arms based on head/hand inputs.
70  void CalcBody();
71 
73  vtkNew<vtkOpenGLActor> HeadActor;
75  vtkNew<vtkOpenGLActor> LeftHandActor;
76  vtkNew<vtkOpenGLPolyDataMapper> RightHandMapper;
77  vtkNew<vtkOpenGLActor> RightHandActor;
78  vtkNew<vtkOpenGLPolyDataMapper> BodyMapper[NUM_BODY];
79  vtkNew<vtkOpenGLActor> BodyActor[NUM_BODY];
80 
81  vtkNew<vtkOpenVRRay> LeftRay;
82  vtkNew<vtkOpenVRRay> RightRay;
83 
84  vtkNew<vtkFlagpoleLabel> LabelActor;
85 
86 private:
87  vtkOpenGLAvatar(const vtkOpenGLAvatar&) = delete;
88  void operator=(const vtkOpenGLAvatar&) = delete;
89 };
90 
91 #endif
vtkActor::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.
vtkOpenVRRay
OpenVR device model.
Definition: vtkOpenVRRay.h:35
vtkOpenGLAvatar
OpenGL Avatar.
Definition: vtkOpenGLAvatar.h:37
vtkX3D::length
@ length
Definition: vtkX3D.h:399
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkActor::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkOpenGLRenderer
OpenGL renderer.
Definition: vtkOpenGLRenderer.h:45
vtkAvatar::New
static vtkAvatar * New()
vtkNew
Allocate and hold a VTK object.
Definition: vtkMeta.h:30
vtkActor::GetBounds
double * GetBounds() override
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkTextProperty
represent text properties.
Definition: vtkTextProperty.h:33
vtkAvatar::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkAvatar.h
vtkFlagpoleLabel
Renders a flagpole (line) with a label at the top that faces the camera.
Definition: vtkFlagpoleLabel.h:42
vtkNew.h
vtkAvatar
Renders head and hands for a user in VR.
Definition: vtkAvatar.h:29
vtkOpenGLActor
OpenGL actor.
Definition: vtkOpenGLActor.h:34
vtkOpenGLPolyDataMapper
PolyDataMapper using OpenGL to render.
Definition: vtkOpenGLPolyDataMapper.h:57