VTK  9.4.20250201
vtkTexturedButtonRepresentation.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
38#ifndef vtkTexturedButtonRepresentation_h
39#define vtkTexturedButtonRepresentation_h
40
42#include "vtkInteractionWidgetsModule.h" // For export macro
43
44VTK_ABI_NAMESPACE_BEGIN
45class vtkCellPicker;
46class vtkActor;
47class vtkProperty;
48class vtkImageData;
49class vtkTextureArray; // PIMPLd
50class vtkPolyData;
53class vtkTexture;
54class vtkFollower;
55
56class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation : public vtkButtonRepresentation
57{
58public:
63
65
69 void PrintSelf(ostream& os, vtkIndent indent) override;
71
73
80
82
86 vtkSetMacro(FollowCamera, vtkTypeBool);
87 vtkGetMacro(FollowCamera, vtkTypeBool);
88 vtkBooleanMacro(FollowCamera, vtkTypeBool);
90
92
96 virtual void SetProperty(vtkProperty* p);
97 vtkGetObjectMacro(Property, vtkProperty);
99
101
105 vtkGetObjectMacro(HoveringProperty, vtkProperty);
107
109
113 vtkGetObjectMacro(SelectingProperty, vtkProperty);
115
117
121 void SetButtonTexture(int i, vtkImageData* image);
124
133 virtual void PlaceWidget(double scale, double point[3], double normal[3]);
134
136
139 int ComputeInteractionState(int X, int Y, int modify = 0) override;
140 void PlaceWidget(double bounds[6]) override;
141 void BuildRepresentation() override;
142 void Highlight(int state) override;
144
146
149 void ShallowCopy(vtkProp* prop) override;
150 double* GetBounds() override;
151 void GetActors(vtkPropCollection* pc) override;
157
158 /*
159 * Register internal Pickers within PickingManager
160 */
161 void RegisterPickers() override;
162
163protected:
166
167 // Representing the button
172
173 // Camera
175
176 // Properties of the button
181
182 // Keep track of the images (textures) associated with the N
183 // states of the button. This is a PIMPLd stl map.
184 vtkTextureArray* TextureArray;
185
186 // For picking the button
188
189private:
191 void operator=(const vtkTexturedButtonRepresentation&) = delete;
192};
193
194VTK_ABI_NAMESPACE_END
195#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:151
Proxy object to connect input/output ports.
abstract class defines the representation for a vtkButtonWidget
ray-cast cell picker for all kinds of Prop3Ds
a subclass of actor that always faces the camera
Definition vtkFollower.h:92
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
represent surface properties of a geometric object
handles properties associated with a texture map
Definition vtkTexture.h:168
defines a representation for a vtkButtonWidget
void SetButtonGeometryConnection(vtkAlgorithmOutput *algOutput)
Set/Get the polydata which defines the button geometry.
static vtkTexturedButtonRepresentation * New()
Instantiate the class.
void Highlight(int state) override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
void ReleaseGraphicsResources(vtkWindow *) override
Provide the necessary methods to satisfy the rendering API.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of the class.
void GetActors(vtkPropCollection *pc) override
Provide the necessary methods to satisfy the rendering API.
void ShallowCopy(vtkProp *prop) override
Provide the necessary methods to satisfy the rendering API.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
virtual void PlaceWidget(double scale, double point[3], double normal[3])
Alternative method for placing a button at a given position (defined by point[3]); at a given orienta...
int RenderOpaqueGeometry(vtkViewport *) override
Provide the necessary methods to satisfy the rendering API.
vtkImageData * GetButtonTexture(int i)
Add the ith texture corresponding to the ith button state.
int ComputeInteractionState(int X, int Y, int modify=0) override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Provide the necessary methods to satisfy the rendering API.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Provide the necessary methods to satisfy the rendering API.
void BuildRepresentation() override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
void SetButtonTexture(int i, vtkImageData *image)
Add the ith texture corresponding to the ith button state.
void PlaceWidget(double bounds[6]) override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
virtual void SetSelectingProperty(vtkProperty *p)
Specify the property to use when selecting the button.
virtual void SetHoveringProperty(vtkProperty *p)
Specify the property to use when the hovering over the button.
double * GetBounds() override
Provide the necessary methods to satisfy the rendering API.
virtual void SetProperty(vtkProperty *p)
Specify the property to use when the button is to appear "normal" i.e., the mouse pointer is not hove...
vtkPolyData * GetButtonGeometry()
Set/Get the polydata which defines the button geometry.
void SetButtonGeometry(vtkPolyData *pd)
Set/Get the polydata which defines the button geometry.
abstract specification for Viewports
Definition vtkViewport.h:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64