VTK  9.4.20241222
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
18VTK_ABI_NAMESPACE_BEGIN
19class vtkOpenGLActor;
22class vtkVRRay;
24class vtkTextProperty;
25
26class VTKRENDERINGVRMODELS_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 char* GetLabel();
52 vtkTextProperty* GetLabelTextProperty();
53
54protected:
56 ~vtkOpenGLAvatar() override;
57
58 // move the torso and arms based on head/hand inputs.
59 void CalcBody();
60
64 vtkNew<vtkOpenGLActor> LeftHandActor;
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
74
75private:
76 vtkOpenGLAvatar(const vtkOpenGLAvatar&) = delete;
77 void operator=(const vtkOpenGLAvatar&) = delete;
78};
79
80VTK_ABI_NAMESPACE_END
81#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:108
Allocate and hold a VTK object.
Definition vtkNew.h:167
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:65
#define VTK_SIZEHINT(...)