VTK  9.7.1
vtkOpenGLAvatar.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
11 #ifndef vtkOpenGLAvatar_h
12 #define vtkOpenGLAvatar_h
13 
14 #include "vtkAvatar.h"
15 #include "vtkNew.h" // for ivars
16 #include "vtkRenderingVRModelsModule.h" // For export macro
17 
18 VTK_ABI_NAMESPACE_BEGIN
19 class vtkOpenGLActor;
21 class vtkOpenGLRenderer;
22 class vtkVRRay;
23 class vtkFlagpoleLabel;
24 class vtkTextProperty;
25 
26 class VTKRENDERINGVRMODELS_EXPORT vtkOpenGLAvatar : public vtkAvatar
27 {
28 public:
29  static vtkOpenGLAvatar* New();
30  vtkTypeMacro(vtkOpenGLAvatar, vtkAvatar);
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
36  int RenderOpaqueGeometry(vtkViewport* vp) override;
38 
39  double* GetBounds() VTK_SIZEHINT(6) override;
40 
41  void SetUseLeftHand(bool val) override;
42  void SetUseRightHand(bool val) override;
43  void SetShowHandsOnly(bool val) override;
44 
45  // Set Ray parameters
46  void SetLeftShowRay(bool v);
47  void SetRightShowRay(bool v);
48  void SetRayLength(double length);
49 
50  void SetLabel(const char* label);
51  char* GetLabel();
52  vtkTextProperty* GetLabelTextProperty();
53 
54 protected:
56  ~vtkOpenGLAvatar() override;
57 
58  // move the torso and arms based on head/hand inputs.
59  void CalcBody();
60 
62  vtkNew<vtkOpenGLActor> HeadActor;
64  vtkNew<vtkOpenGLActor> LeftHandActor;
65  vtkNew<vtkOpenGLPolyDataMapper> RightHandMapper;
66  vtkNew<vtkOpenGLActor> RightHandActor;
67  vtkNew<vtkOpenGLPolyDataMapper> BodyMapper[NUM_BODY];
68  vtkNew<vtkOpenGLActor> BodyActor[NUM_BODY];
69 
70  vtkNew<vtkVRRay> LeftRay;
71  vtkNew<vtkVRRay> RightRay;
72 
73  vtkNew<vtkFlagpoleLabel> LabelActor;
74 
75 private:
76  vtkOpenGLAvatar(const vtkOpenGLAvatar&) = delete;
77  void operator=(const vtkOpenGLAvatar&) = delete;
78 };
79 
80 VTK_ABI_NAMESPACE_END
81 #endif
PolyDataMapper using OpenGL to render.
abstract specification for Viewports
Definition: vtkViewport.h:46
VR device model.
Definition: vtkVRRay.h:24
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:28
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:21
Allocate and hold a VTK object.
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.