VTK
vtkTexturedButtonRepresentation2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkTexturedButtonRepresentation2D.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 =========================================================================*/
44 #ifndef vtkTexturedButtonRepresentation2D_h
45 #define vtkTexturedButtonRepresentation2D_h
46 
47 #include "vtkInteractionWidgetsModule.h" // For export macro
49 
50 class vtkProperty2D;
51 class vtkImageData;
52 class vtkTextureArray; //PIMPLd
53 class vtkProperty2D;
54 class vtkAlgorithmOutput;
56 class vtkCoordinate;
57 
58 
59 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation2D : public vtkButtonRepresentation
60 {
61 public:
66 
68 
72  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
74 
76 
80  virtual void SetProperty(vtkProperty2D *p);
81  vtkGetObjectMacro(Property,vtkProperty2D);
83 
85 
88  virtual void SetHoveringProperty(vtkProperty2D *p);
89  vtkGetObjectMacro(HoveringProperty,vtkProperty2D);
91 
93 
96  virtual void SetSelectingProperty(vtkProperty2D *p);
97  vtkGetObjectMacro(SelectingProperty,vtkProperty2D);
99 
101 
105  void SetButtonTexture(int i, vtkImageData *image);
106  vtkImageData *GetButtonTexture(int i);
108 
113  vtkBalloonRepresentation *GetBalloon() {return this->Balloon;}
114 
116 
119  int ComputeInteractionState(int X, int Y, int modify=0) VTK_OVERRIDE;
120  void BuildRepresentation() VTK_OVERRIDE;
121  void Highlight(int state) VTK_OVERRIDE;
123 
131  void PlaceWidget(double bounds[6]) VTK_OVERRIDE;
132 
143  virtual void PlaceWidget(double anchor[3], int size[2]);
144 
146 
149  void ShallowCopy(vtkProp *prop) VTK_OVERRIDE;
150  double *GetBounds() VTK_OVERRIDE;
151  void GetActors(vtkPropCollection *pc) VTK_OVERRIDE;
152  void ReleaseGraphicsResources(vtkWindow*) VTK_OVERRIDE;
153  int RenderOverlay(vtkViewport*) VTK_OVERRIDE;
154  int HasTranslucentPolygonalGeometry() VTK_OVERRIDE;
156 
157 protected:
159  ~vtkTexturedButtonRepresentation2D() VTK_OVERRIDE;
160 
161  // Representing the button
163 
164  // Properties of the button
165  vtkProperty2D *Property;
166  vtkProperty2D *HoveringProperty;
167  vtkProperty2D *SelectingProperty;
168  void CreateDefaultProperties();
169 
170  // Keep track of the images (textures) associated with the N
171  // states of the button.
172  vtkTextureArray *TextureArray;
173 
174  // Tracking world position
176 
177 private:
178  vtkTexturedButtonRepresentation2D(const vtkTexturedButtonRepresentation2D&) VTK_DELETE_FUNCTION;
179  void operator=(const vtkTexturedButtonRepresentation2D&) VTK_DELETE_FUNCTION;
180 };
181 
182 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
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
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
abstract class defines the representation for a vtkButtonWidget
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:72
represent the vtkBalloonWidget
vtkBalloonRepresentation * GetBalloon()
Grab the underlying vtkBalloonRepresentation used to position and display the button texture...
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
defines a representation for a vtkButtonWidget
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...