VTK  9.0.1
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 
51 #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) override;
79 
81 
84  void SetButtonGeometry(vtkPolyData* pd);
85  void SetButtonGeometryConnection(vtkAlgorithmOutput* algOutput);
86  vtkPolyData* GetButtonGeometry();
88 
90 
94  vtkSetMacro(FollowCamera, vtkTypeBool);
95  vtkGetMacro(FollowCamera, vtkTypeBool);
96  vtkBooleanMacro(FollowCamera, vtkTypeBool);
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) override;
148  void PlaceWidget(double bounds[6]) override;
149  void BuildRepresentation() override;
150  void Highlight(int state) override;
152 
154 
157  void ShallowCopy(vtkProp* prop) override;
158  double* GetBounds() override;
159  void GetActors(vtkPropCollection* pc) override;
160  void ReleaseGraphicsResources(vtkWindow*) override;
161  int RenderOpaqueGeometry(vtkViewport*) override;
165 
166  /*
167  * Register internal Pickers within PickingManager
168  */
169  void RegisterPickers() override;
170 
171 protected:
174 
175  // Representing the button
180 
181  // Camera
183 
184  // Properties of the button
188  void CreateDefaultProperties();
189 
190  // Keep track of the images (textures) associated with the N
191  // states of the button. This is a PIMPLd stl map.
192  vtkTextureArray* TextureArray;
193 
194  // For picking the button
196 
197 private:
199  void operator=(const vtkTexturedButtonRepresentation&) = delete;
200 };
201 
202 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:36
vtkTexturedButtonRepresentation::Picker
vtkCellPicker * Picker
Definition: vtkTexturedButtonRepresentation.h:195
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:210
vtkFollower
a subclass of actor that always faces the camera
Definition: vtkFollower.h:40
vtkX3D::scale
@ scale
Definition: vtkX3D.h:235
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkX3D::image
@ image
Definition: vtkX3D.h:380
vtkTexturedButtonRepresentation::SelectingProperty
vtkProperty * SelectingProperty
Definition: vtkTexturedButtonRepresentation.h:187
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:47
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkTexturedButtonRepresentation::FollowCamera
vtkTypeBool FollowCamera
Definition: vtkTexturedButtonRepresentation.h:182
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkTexturedButtonRepresentation::Texture
vtkTexture * Texture
Definition: vtkTexturedButtonRepresentation.h:179
vtkWidgetRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:216
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:213
vtkTexturedButtonRepresentation::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkTexturedButtonRepresentation.h:178
vtkX3D::point
@ point
Definition: vtkX3D.h:242
vtkTexture
handles properties associated with a texture map
Definition: vtkTexture.h:65
vtkWidgetRepresentation::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
Definition: vtkWidgetRepresentation.h:208
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
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:44
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
vtkWidgetRepresentation::PlaceWidget
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
The following is a suggested API for widget representations.
Definition: vtkWidgetRepresentation.h:134
vtkTexturedButtonRepresentation::Property
vtkProperty * Property
Definition: vtkTexturedButtonRepresentation.h:185
vtkWidgetRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:215
vtkTexturedButtonRepresentation::Follower
vtkFollower * Follower
Definition: vtkTexturedButtonRepresentation.h:177
vtkTexturedButtonRepresentation
defines a representation for a vtkButtonWidget
Definition: vtkTexturedButtonRepresentation.h:64
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkTexturedButtonRepresentation::Actor
vtkActor * Actor
Definition: vtkTexturedButtonRepresentation.h:176
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:61
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:218
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:66
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:192
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkTexturedButtonRepresentation::HoveringProperty
vtkProperty * HoveringProperty
Definition: vtkTexturedButtonRepresentation.h:186