VTK  9.2.6
vtkTexturedButtonRepresentation2D.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkTexturedButtonRepresentation2D.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
56#ifndef vtkTexturedButtonRepresentation2D_h
57#define vtkTexturedButtonRepresentation2D_h
58
60#include "vtkInteractionWidgetsModule.h" // For export macro
61
62class vtkProperty2D;
63class vtkImageData;
64class vtkTextureArray; // PIMPLd
65class vtkProperty2D;
68class vtkCoordinate;
69
70class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation2D
72{
73public:
78
80
84 void PrintSelf(ostream& os, vtkIndent indent) override;
86
88
92 virtual void SetProperty(vtkProperty2D* p);
93 vtkGetObjectMacro(Property, vtkProperty2D);
95
97
101 vtkGetObjectMacro(HoveringProperty, vtkProperty2D);
103
105
109 vtkGetObjectMacro(SelectingProperty, vtkProperty2D);
111
113
117 void SetButtonTexture(int i, vtkImageData* image);
120
125 vtkBalloonRepresentation* GetBalloon() { return this->Balloon; }
126
128
131 int ComputeInteractionState(int X, int Y, int modify = 0) override;
132 void BuildRepresentation() override;
133 void Highlight(int state) override;
135
143 void PlaceWidget(double bounds[6]) override;
144
155 virtual void PlaceWidget(double anchor[3], int size[2]);
156
158
161 void ShallowCopy(vtkProp* prop) override;
162 double* GetBounds() override;
163 void GetActors(vtkPropCollection* pc) override;
168
169protected:
172
173 // Representing the button
175
176 // Properties of the button
181
182 // Keep track of the images (textures) associated with the N
183 // states of the button.
184 vtkTextureArray* TextureArray;
185
186 // Tracking world position
188
189private:
191 void operator=(const vtkTexturedButtonRepresentation2D&) = delete;
192};
193
194#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:49
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:66
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:65
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:69