VTK  9.3.0
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
44 #ifndef vtkTexturedButtonRepresentation2D_h
45 #define vtkTexturedButtonRepresentation2D_h
46 
48 #include "vtkInteractionWidgetsModule.h" // For export macro
49 
50 VTK_ABI_NAMESPACE_BEGIN
51 class vtkProperty2D;
52 class vtkImageData;
53 class vtkTextureArray; // PIMPLd
54 class vtkProperty2D;
55 class vtkAlgorithmOutput;
57 class vtkCoordinate;
58 
59 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation2D
61 {
62 public:
67 
69 
73  void PrintSelf(ostream& os, vtkIndent indent) override;
75 
77 
81  virtual void SetProperty(vtkProperty2D* p);
82  vtkGetObjectMacro(Property, vtkProperty2D);
84 
86 
90  vtkGetObjectMacro(HoveringProperty, vtkProperty2D);
92 
94 
98  vtkGetObjectMacro(SelectingProperty, vtkProperty2D);
100 
102 
109 
114  vtkBalloonRepresentation* GetBalloon() { return this->Balloon; }
115 
117 
120  int ComputeInteractionState(int X, int Y, int modify = 0) override;
121  void BuildRepresentation() override;
122  void Highlight(int state) override;
124 
132  void PlaceWidget(double bounds[6]) override;
133 
144  virtual void PlaceWidget(double anchor[3], int size[2]);
145 
147 
150  void ShallowCopy(vtkProp* prop) override;
151  double* GetBounds() override;
152  void GetActors(vtkPropCollection* pc) override;
154  int RenderOverlay(vtkViewport*) override;
157 
158 protected:
161 
162  // Representing the button
164 
165  // Properties of the button
170 
171  // Keep track of the images (textures) associated with the N
172  // states of the button.
173  vtkTextureArray* TextureArray;
174 
175  // Tracking world position
177 
178 private:
180  void operator=(const vtkTexturedButtonRepresentation2D&) = delete;
181 };
182 
183 VTK_ABI_NAMESPACE_END
184 #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
Definition: vtkCoordinate.h:78
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
a simple class to control print indentation
Definition: vtkIndent.h:38
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:55
represent surface properties of a 2D image
Definition: vtkProperty2D.h:39
defines a representation for a vtkButtonWidget
static vtkTexturedButtonRepresentation2D * New()
Instantiate the class.
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...
vtkImageData * GetButtonTexture(int i)
Add the ith texture corresponding to the ith button state.
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.
vtkBalloonRepresentation * GetBalloon()
Grab the underlying vtkBalloonRepresentation used to position and display the button texture.
void Highlight(int state) 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.
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.
void BuildRepresentation() override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Provide the necessary methods to satisfy the rendering API.
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:54
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
@ image
Definition: vtkX3D.h:374
@ size
Definition: vtkX3D.h:253
int vtkTypeBool
Definition: vtkABI.h:64