VTK  9.2.5
vtkTexturedButtonRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTexturedButtonRepresentation.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 =========================================================================*/
50 #ifndef vtkTexturedButtonRepresentation_h
51 #define vtkTexturedButtonRepresentation_h
52 
54 #include "vtkInteractionWidgetsModule.h" // For export macro
55 
56 class vtkCellPicker;
57 class vtkActor;
58 class vtkProperty;
59 class vtkImageData;
60 class vtkTextureArray; // PIMPLd
61 class vtkPolyData;
62 class vtkPolyDataMapper;
63 class vtkAlgorithmOutput;
64 class vtkTexture;
65 class vtkFollower;
66 
67 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation : public vtkButtonRepresentation
68 {
69 public:
74 
76 
80  void PrintSelf(ostream& os, vtkIndent indent) override;
82 
84 
91 
93 
97  vtkSetMacro(FollowCamera, vtkTypeBool);
98  vtkGetMacro(FollowCamera, vtkTypeBool);
99  vtkBooleanMacro(FollowCamera, vtkTypeBool);
101 
103 
107  virtual void SetProperty(vtkProperty* p);
108  vtkGetObjectMacro(Property, vtkProperty);
110 
112 
116  vtkGetObjectMacro(HoveringProperty, vtkProperty);
118 
120 
124  vtkGetObjectMacro(SelectingProperty, vtkProperty);
126 
128 
135 
144  virtual void PlaceWidget(double scale, double point[3], double normal[3]);
145 
147 
150  int ComputeInteractionState(int X, int Y, int modify = 0) override;
151  void PlaceWidget(double bounds[6]) override;
152  void BuildRepresentation() override;
153  void Highlight(int state) override;
155 
157 
160  void ShallowCopy(vtkProp* prop) override;
161  double* GetBounds() override;
162  void GetActors(vtkPropCollection* pc) override;
168 
169  /*
170  * Register internal Pickers within PickingManager
171  */
172  void RegisterPickers() override;
173 
174 protected:
177 
178  // Representing the button
183 
184  // Camera
186 
187  // Properties of the button
192 
193  // Keep track of the images (textures) associated with the N
194  // states of the button. This is a PIMPLd stl map.
195  vtkTextureArray* TextureArray;
196 
197  // For picking the button
199 
200 private:
202  void operator=(const vtkTexturedButtonRepresentation&) = delete;
203 };
204 
205 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
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:123
topologically and geometrically regular array of data
Definition: vtkImageData.h:163
a simple class to control print indentation
Definition: vtkIndent.h:119
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:200
an ordered list of Props
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
represent surface properties of a geometric object
Definition: vtkProperty.h:177
handles properties associated with a texture map
Definition: vtkTexture.h:178
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:56
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
@ point
Definition: vtkX3D.h:242
@ scale
Definition: vtkX3D.h:235
@ image
Definition: vtkX3D.h:380
int vtkTypeBool
Definition: vtkABI.h:69