VTK  9.5.20250814
vtkTexturedButtonRepresentation2D.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
64#ifndef vtkTexturedButtonRepresentation2D_h
65#define vtkTexturedButtonRepresentation2D_h
66
68#include "vtkInteractionWidgetsModule.h" // For export macro
69
70VTK_ABI_NAMESPACE_BEGIN
71class vtkProperty2D;
72class vtkImageData;
73class vtkTextureArray; // PIMPLd
74class vtkProperty2D;
77class vtkCoordinate;
78
79class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation2D
81{
82public:
87
89
93 void PrintSelf(ostream& os, vtkIndent indent) override;
95
97
101 virtual void SetProperty(vtkProperty2D* p);
102 vtkGetObjectMacro(Property, vtkProperty2D);
104
106
110 vtkGetObjectMacro(HoveringProperty, vtkProperty2D);
112
114
118 vtkGetObjectMacro(SelectingProperty, vtkProperty2D);
120
122
126 void SetButtonTexture(int i, vtkImageData* image);
129
134 vtkBalloonRepresentation* GetBalloon() { return this->Balloon; }
135
137
140 int ComputeInteractionState(int X, int Y, int modify = 0) override;
141 void BuildRepresentation() override;
142 void Highlight(int state) override;
144
152 void PlaceWidget(double bounds[6]) override;
153
164 virtual void PlaceWidget(double anchor[3], int size[2]);
165
167
170 void ShallowCopy(vtkProp* prop) override;
171 double* GetBounds() override;
172 void GetActors(vtkPropCollection* pc) override;
177
178protected:
181
182 // Representing the button
184
185 // Properties of the button
190
191 // Keep track of the images (textures) associated with the N
192 // states of the button.
193 vtkTextureArray* TextureArray;
194
195 // Tracking world position
197
198private:
200 void operator=(const vtkTexturedButtonRepresentation2D&) = delete;
201};
202
203VTK_ABI_NAMESPACE_END
204#endif
Proxy object to connect input/output ports.
represent the vtkBalloonWidget
abstract class defines the representation for a vtkButtonWidget
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
topologically and geometrically regular array of data
a simple class to control print indentation
Definition vtkIndent.h:108
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:69
represent surface properties of a 2D image
defines a representation for a vtkButtonWidget
virtual void SetProperty(vtkProperty2D *p)
Specify the property to use when the button is to appear "normal" i.e., the mouse pointer is not hove...
void ReleaseGraphicsResources(vtkWindow *) override
Provide the necessary methods to satisfy the rendering API.
void PlaceWidget(double bounds[6]) override
Conventional PlaceWidget() method to satisfy the vtkWidgetRepresentation API.
virtual void SetHoveringProperty(vtkProperty2D *p)
Specify the property to use when the hovering over the button.
void Highlight(int state) override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
vtkImageData * GetButtonTexture(int i)
Add the ith texture corresponding to the ith button state.
void SetButtonTexture(int i, vtkImageData *image)
Add the ith texture corresponding to the ith button state.
virtual void PlaceWidget(double anchor[3], int size[2])
This alternative PlaceWidget() method can be used to anchor the button to a 3D point.
virtual void SetSelectingProperty(vtkProperty2D *p)
Specify the property to use when selecting the button.
int RenderOverlay(vtkViewport *) override
Provide the necessary methods to satisfy the rendering API.
double * GetBounds() override
Provide the necessary methods to satisfy the rendering API.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
static vtkTexturedButtonRepresentation2D * New()
Instantiate the class.
void BuildRepresentation() override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Provide the necessary methods to satisfy the rendering API.
vtkBalloonRepresentation * GetBalloon()
Grab the underlying vtkBalloonRepresentation used to position and display the button texture.
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.
int ComputeInteractionState(int X, int Y, int modify=0) override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
abstract specification for Viewports
Definition vtkViewport.h:66
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64