VTK  9.3.20240419
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 
44 VTK_ABI_NAMESPACE_BEGIN
45 class vtkCellPicker;
46 class vtkActor;
47 class vtkProperty;
48 class vtkImageData;
49 class vtkTextureArray; // PIMPLd
50 class vtkPolyData;
51 class vtkPolyDataMapper;
52 class vtkAlgorithmOutput;
53 class vtkTexture;
54 class vtkFollower;
55 
56 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation : public vtkButtonRepresentation
57 {
58 public:
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 
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 
163 protected:
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 
189 private:
191  void operator=(const vtkTexturedButtonRepresentation&) = delete;
192 };
193 
194 VTK_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
Definition: vtkCellPicker.h:91
a subclass of actor that always faces the camera
Definition: vtkFollower.h:92
topologically and geometrically regular array of data
Definition: vtkImageData.h:156
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
Definition: vtkPolyData.h:181
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:66
represent surface properties of a geometric object
Definition: vtkProperty.h:167
handles properties associated with a texture map
Definition: vtkTexture.h:167
defines a representation for a vtkButtonWidget
void SetButtonGeometryConnection(vtkAlgorithmOutput *algOutput)
Set/Get the polydata which defines the button geometry.
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.
double * GetBounds() 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...
static vtkTexturedButtonRepresentation * New()
Instantiate the class.
vtkPolyData * GetButtonGeometry()
Set/Get the polydata which defines the button geometry.
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.
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...
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
@ point
Definition: vtkX3D.h:236
@ scale
Definition: vtkX3D.h:229
@ image
Definition: vtkX3D.h:374
int vtkTypeBool
Definition: vtkABI.h:64