VTK  9.3.0
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 "vtkRenderingVRModule.h" // For export macro
17
18VTK_ABI_NAMESPACE_BEGIN
19class vtkOpenGLActor;
22class vtkVRRay;
24class vtkTextProperty;
25
26class VTKRENDERINGVR_EXPORT vtkOpenGLAvatar : public vtkAvatar
27{
28public:
30 vtkTypeMacro(vtkOpenGLAvatar, vtkAvatar);
31 void PrintSelf(ostream& os, vtkIndent indent) override;
32
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 vtkTextProperty* GetLabelTextProperty();
52
53protected:
55 ~vtkOpenGLAvatar() override;
56
57 // move the torso and arms based on head/hand inputs.
58 void CalcBody();
59
63 vtkNew<vtkOpenGLActor> LeftHandActor;
65 vtkNew<vtkOpenGLActor> RightHandActor;
66 vtkNew<vtkOpenGLPolyDataMapper> BodyMapper[NUM_BODY];
67 vtkNew<vtkOpenGLActor> BodyActor[NUM_BODY];
68
69 vtkNew<vtkVRRay> LeftRay;
70 vtkNew<vtkVRRay> RightRay;
71
73
74private:
75 vtkOpenGLAvatar(const vtkOpenGLAvatar&) = delete;
76 void operator=(const vtkOpenGLAvatar&) = delete;
77};
78
79VTK_ABI_NAMESPACE_END
80#endif
Renders head and hands for a user in VR.
Definition vtkAvatar.h:22
Renders a flagpole (line) with a label at the top that faces the camera.
a simple class to control print indentation
Definition vtkIndent.h:29
Allocate and hold a VTK object.
Definition vtkNew.h:51
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:25
abstract specification for Viewports
Definition vtkViewport.h:45
#define VTK_SIZEHINT(...)