VTK  9.0.2
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
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:34
Allocate and hold a VTK object.
Definition: vtkNew.h:56
OpenGL actor.
OpenGL Avatar.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RenderTranslucentPolygonalGeometry(vtkViewport *vp) override
static vtkOpenGLAvatar * New()
double * GetBounds() override
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
int RenderOpaqueGeometry(vtkViewport *vp) override
Actual Avatar render method.
PolyDataMapper using OpenGL to render.
OpenGL renderer.
OpenVR device model.
Definition: vtkOpenVRRay.h:36
represent text properties.
abstract specification for Viewports
Definition: vtkViewport.h:45
@ length
Definition: vtkX3D.h:399
#define VTK_SIZEHINT(...)