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) override;
82 
84 
87  void SetButtonGeometry(vtkPolyData *pd);
88  void SetButtonGeometryConnection(vtkAlgorithmOutput* algOutput);
89  vtkPolyData *GetButtonGeometry();
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 
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) 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;
163  void ReleaseGraphicsResources(vtkWindow*) override;
164  int RenderOpaqueGeometry(vtkViewport*) 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
191  void CreateDefaultProperties();
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 
201 private:
203  void operator=(const vtkTexturedButtonRepresentation&) = delete;
204 };
205 
206 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkTexturedButtonRepresentation::Picker
vtkCellPicker * Picker
Definition: vtkTexturedButtonRepresentation.h:198
vtkWidgetRepresentation::GetActors
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
Definition: vtkWidgetRepresentation.h:217
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:46
vtkX3D::scale
Definition: vtkX3D.h:229
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkX3D::image
Definition: vtkX3D.h:374
vtkTexturedButtonRepresentation::SelectingProperty
vtkProperty * SelectingProperty
Definition: vtkTexturedButtonRepresentation.h:190
vtkButtonRepresentation.h
vtkButtonRepresentation::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Satisfy some of vtkProp's API.
vtkButtonRepresentation
abstract class defines the representation for a vtkButtonWidget
Definition: vtkButtonRepresentation.h:45
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkTexturedButtonRepresentation::FollowCamera
vtkTypeBool FollowCamera
Definition: vtkTexturedButtonRepresentation.h:185
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkTexturedButtonRepresentation::Texture
vtkTexture * Texture
Definition: vtkTexturedButtonRepresentation.h:182
vtkWidgetRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:223
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:220
vtkTexturedButtonRepresentation::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkTexturedButtonRepresentation.h:181
vtkX3D::point
Definition: vtkX3D.h:236
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:71
vtkWidgetRepresentation::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
Definition: vtkWidgetRepresentation.h:215
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkWidgetRepresentation::RegisterPickers
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
vtkButtonRepresentation::Highlight
void Highlight(int) override
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:52
vtkWidgetRepresentation::PlaceWidget
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
The following is a suggested API for widget representations.
Definition: vtkWidgetRepresentation.h:135
vtkTexturedButtonRepresentation::Property
vtkProperty * Property
Definition: vtkTexturedButtonRepresentation.h:188
vtkWidgetRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:222
vtkTexturedButtonRepresentation::Follower
vtkFollower * Follower
Definition: vtkTexturedButtonRepresentation.h:180
vtkTexturedButtonRepresentation
defines a representation for a vtkButtonWidget
Definition: vtkTexturedButtonRepresentation.h:67
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkTexturedButtonRepresentation::Actor
vtkActor * Actor
Definition: vtkTexturedButtonRepresentation.h:179
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:66
vtkWidgetRepresentation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkWidgetRepresentation.h:225
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:41
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:69
vtkButtonRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkTexturedButtonRepresentation::TextureArray
vtkTextureArray * TextureArray
Definition: vtkTexturedButtonRepresentation.h:195
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkTexturedButtonRepresentation::HoveringProperty
vtkProperty * HoveringProperty
Definition: vtkTexturedButtonRepresentation.h:189