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 =========================================================================*/
47 #ifndef vtkTexturedButtonRepresentation_h
48 #define vtkTexturedButtonRepresentation_h
49 
50 #include "vtkInteractionWidgetsModule.h" // For export macro
52 
53 class vtkCellPicker;
54 class vtkActor;
55 class vtkProperty;
56 class vtkImageData;
57 class vtkTextureArray; //PIMPLd
58 class vtkPolyData;
59 class vtkPolyDataMapper;
60 class vtkAlgorithmOutput;
61 class vtkTexture;
62 class vtkFollower;
63 
64 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation : public vtkButtonRepresentation
65 {
66 public:
71 
73 
77  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
79 
81 
84  void SetButtonGeometry(vtkPolyData *pd);
85  void SetButtonGeometryConnection(vtkAlgorithmOutput* algOutput);
86  vtkPolyData *GetButtonGeometry();
88 
90 
94  vtkSetMacro(FollowCamera,int);
95  vtkGetMacro(FollowCamera,int);
96  vtkBooleanMacro(FollowCamera,int);
98 
100 
104  virtual void SetProperty(vtkProperty *p);
105  vtkGetObjectMacro(Property,vtkProperty);
107 
109 
112  virtual void SetHoveringProperty(vtkProperty *p);
113  vtkGetObjectMacro(HoveringProperty,vtkProperty);
115 
117 
120  virtual void SetSelectingProperty(vtkProperty *p);
121  vtkGetObjectMacro(SelectingProperty,vtkProperty);
123 
125 
129  void SetButtonTexture(int i, vtkImageData *image);
130  vtkImageData *GetButtonTexture(int i);
132 
141  virtual void PlaceWidget(double scale, double point[3], double normal[3]);
142 
144 
147  int ComputeInteractionState(int X, int Y, int modify=0) VTK_OVERRIDE;
148  void PlaceWidget(double bounds[6]) VTK_OVERRIDE;
149  void BuildRepresentation() VTK_OVERRIDE;
150  void Highlight(int state) VTK_OVERRIDE;
152 
154 
157  void ShallowCopy(vtkProp *prop) VTK_OVERRIDE;
158  double *GetBounds() VTK_OVERRIDE;
159  void GetActors(vtkPropCollection *pc) VTK_OVERRIDE;
160  void ReleaseGraphicsResources(vtkWindow*) VTK_OVERRIDE;
161  int RenderOpaqueGeometry(vtkViewport*) VTK_OVERRIDE;
162  int RenderTranslucentPolygonalGeometry(vtkViewport*) VTK_OVERRIDE;
163  int HasTranslucentPolygonalGeometry() VTK_OVERRIDE;
165 
166 protected:
168  ~vtkTexturedButtonRepresentation() VTK_OVERRIDE;
169 
170  // Representing the button
171  vtkActor *Actor;
172  vtkFollower *Follower;
174  vtkTexture *Texture;
175 
176  // Camera
177  int FollowCamera;
178 
179  // Properties of the button
180  vtkProperty *Property;
181  vtkProperty *HoveringProperty;
182  vtkProperty *SelectingProperty;
183  void CreateDefaultProperties();
184 
185  // Keep track of the images (textures) associated with the N
186  // states of the button. This is a PIMPLd stl map.
187  vtkTextureArray *TextureArray;
188 
189  // For picking the button
190  vtkCellPicker *Picker;
191 
192  // Register internal Pickers within PickingManager
193  void RegisterPickers() VTK_OVERRIDE;
194 
195 private:
196  vtkTexturedButtonRepresentation(const vtkTexturedButtonRepresentation&) VTK_DELETE_FUNCTION;
197  void operator=(const vtkTexturedButtonRepresentation&) VTK_DELETE_FUNCTION;
198 };
199 
200 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
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:44
represent surface properties of a geometric object
Definition: vtkProperty.h:58
defines a representation for a vtkButtonWidget
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Proxy object to connect input/output ports.
an ordered list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
handles properties associated with a texture map
Definition: vtkTexture.h:64
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:40
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:63
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...