VTK  9.3.1
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 
76  void SetButtonGeometry(vtkPolyData* pd);
77  void SetButtonGeometryConnection(vtkAlgorithmOutput* algOutput);
78  vtkPolyData* GetButtonGeometry();
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 
104  virtual void SetHoveringProperty(vtkProperty* p);
105  vtkGetObjectMacro(HoveringProperty, vtkProperty);
107 
109 
112  virtual void SetSelectingProperty(vtkProperty* p);
113  vtkGetObjectMacro(SelectingProperty, vtkProperty);
115 
117 
121  void SetButtonTexture(int i, vtkImageData* image);
122  vtkImageData* GetButtonTexture(int i);
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;
152  void ReleaseGraphicsResources(vtkWindow*) override;
153  int RenderOpaqueGeometry(vtkViewport*) 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
180  void CreateDefaultProperties();
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
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:45
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:40
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
virtual void PlaceWidget(double vtkNotUsed(bounds)[6])
The following is a suggested API for widget representations.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:44
represent surface properties of a geometric object
Definition: vtkProperty.h:56
defines a representation for a vtkButtonWidget
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
void ShallowCopy(vtkProp *prop) override
Satisfy some of vtkProp's API.
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
Proxy object to connect input/output ports.
double * GetBounds() override
Methods to make this class behave as a vtkProp.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
void Highlight(int) override
These methods control the appearance of the button as it is being interacted with.
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
handles properties associated with a texture map
Definition: vtkTexture.h:57
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
abstract class defines the representation for a vtkButtonWidget
map vtkPolyData to graphics primitives
a subclass of actor that always faces the camera
Definition: vtkFollower.h:32
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:61
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...