VTK  9.2.6
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 
30 class vtkOpenGLActor;
32 class vtkOpenGLRenderer;
33 class vtkVRRay;
34 class vtkFlagpoleLabel;
35 class vtkTextProperty;
36 
37 class VTKRENDERINGVR_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  int RenderOpaqueGeometry(vtkViewport* vp) override;
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 
64 protected:
66  ~vtkOpenGLAvatar() override;
67 
68  // move the torso and arms based on head/hand inputs.
69  void CalcBody();
70 
72  vtkNew<vtkOpenGLActor> HeadActor;
74  vtkNew<vtkOpenGLActor> LeftHandActor;
75  vtkNew<vtkOpenGLPolyDataMapper> RightHandMapper;
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 
83  vtkNew<vtkFlagpoleLabel> LabelActor;
84 
85 private:
86  vtkOpenGLAvatar(const vtkOpenGLAvatar&) = delete;
87  void operator=(const vtkOpenGLAvatar&) = delete;
88 };
89 
90 #endif
PolyDataMapper using OpenGL to render.
abstract specification for Viewports
Definition: vtkViewport.h:55
VR device model.
Definition: vtkVRRay.h:35
Renders a flagpole (line) with a label at the top that faces the camera.
OpenGL actor.
a simple class to control print indentation
Definition: vtkIndent.h:39
static vtkAvatar * New()
#define VTK_SIZEHINT(...)
double * GetBounds() override
Return a reference to the Prop3D's composite transform.
represent text properties.
Renders head and hands for a user in VR.
Definition: vtkAvatar.h:32
Allocate and hold a VTK object.
Definition: vtkMeta.h:30
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Support the standard render methods.
OpenGL Avatar.
OpenGL renderer.
int RenderOpaqueGeometry(vtkViewport *viewport) override
Support the standard render methods.