VTK
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 
53 #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) VTK_OVERRIDE;
82 
84 
87  void SetButtonGeometry(vtkPolyData *pd);
88  void SetButtonGeometryConnection(vtkAlgorithmOutput* algOutput);
89  vtkPolyData *GetButtonGeometry();
91 
93 
97  vtkSetMacro(FollowCamera,int);
98  vtkGetMacro(FollowCamera,int);
99  vtkBooleanMacro(FollowCamera,int);
101 
103 
107  virtual void SetProperty(vtkProperty *p);
108  vtkGetObjectMacro(Property,vtkProperty);
110 
112 
115  virtual void SetHoveringProperty(vtkProperty *p);
116  vtkGetObjectMacro(HoveringProperty,vtkProperty);
118 
120 
123  virtual void SetSelectingProperty(vtkProperty *p);
124  vtkGetObjectMacro(SelectingProperty,vtkProperty);
126 
128 
132  void SetButtonTexture(int i, vtkImageData *image);
133  vtkImageData *GetButtonTexture(int i);
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) VTK_OVERRIDE;
151  void PlaceWidget(double bounds[6]) VTK_OVERRIDE;
152  void BuildRepresentation() VTK_OVERRIDE;
153  void Highlight(int state) VTK_OVERRIDE;
155 
157 
160  void ShallowCopy(vtkProp *prop) VTK_OVERRIDE;
161  double *GetBounds() VTK_OVERRIDE;
162  void GetActors(vtkPropCollection *pc) VTK_OVERRIDE;
163  void ReleaseGraphicsResources(vtkWindow*) VTK_OVERRIDE;
164  int RenderOpaqueGeometry(vtkViewport*) VTK_OVERRIDE;
165  int RenderTranslucentPolygonalGeometry(vtkViewport*) VTK_OVERRIDE;
166  int HasTranslucentPolygonalGeometry() VTK_OVERRIDE;
168 
169 protected:
171  ~vtkTexturedButtonRepresentation() VTK_OVERRIDE;
172 
173  // Representing the button
174  vtkActor *Actor;
175  vtkFollower *Follower;
177  vtkTexture *Texture;
178 
179  // Camera
180  int FollowCamera;
181 
182  // Properties of the button
183  vtkProperty *Property;
184  vtkProperty *HoveringProperty;
185  vtkProperty *SelectingProperty;
186  void CreateDefaultProperties();
187 
188  // Keep track of the images (textures) associated with the N
189  // states of the button. This is a PIMPLd stl map.
190  vtkTextureArray *TextureArray;
191 
192  // For picking the button
193  vtkCellPicker *Picker;
194 
195  // Register internal Pickers within PickingManager
196  void RegisterPickers() VTK_OVERRIDE;
197 
198 private:
199  vtkTexturedButtonRepresentation(const vtkTexturedButtonRepresentation&) VTK_DELETE_FUNCTION;
200  void operator=(const vtkTexturedButtonRepresentation&) VTK_DELETE_FUNCTION;
201 };
202 
203 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:47
represent surface properties of a geometric object
Definition: vtkProperty.h:64
defines a representation for a vtkButtonWidget
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
Proxy object to connect input/output ports.
an ordered list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
handles properties associated with a texture map
Definition: vtkTexture.h:70
abstract class defines the representation for a vtkButtonWidget
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
map vtkPolyData to graphics primitives
a subclass of actor that always faces the camera
Definition: vtkFollower.h:46
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
The following is a suggested API for widget representations.
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:69
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...