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 =========================================================================*/
47 #ifndef vtkTexturedButtonRepresentation2D_h
48 #define vtkTexturedButtonRepresentation2D_h
49 
50 #include "vtkInteractionWidgetsModule.h" // For export macro
52 
53 class vtkProperty2D;
54 class vtkImageData;
55 class vtkTextureArray; //PIMPLd
56 class vtkProperty2D;
57 class vtkAlgorithmOutput;
59 class vtkCoordinate;
60 
61 
62 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation2D : public vtkButtonRepresentation
63 {
64 public:
69 
71 
75  void PrintSelf(ostream& os, vtkIndent indent);
77 
79 
83  virtual void SetProperty(vtkProperty2D *p);
84  vtkGetObjectMacro(Property,vtkProperty2D);
86 
88 
91  virtual void SetHoveringProperty(vtkProperty2D *p);
92  vtkGetObjectMacro(HoveringProperty,vtkProperty2D);
94 
96 
99  virtual void SetSelectingProperty(vtkProperty2D *p);
100  vtkGetObjectMacro(SelectingProperty,vtkProperty2D);
102 
104 
108  void SetButtonTexture(int i, vtkImageData *image);
109  vtkImageData *GetButtonTexture(int i);
111 
116  vtkBalloonRepresentation *GetBalloon() {return this->Balloon;}
117 
119 
122  virtual int ComputeInteractionState(int X, int Y, int modify=0);
123  virtual void BuildRepresentation();
124  virtual void Highlight(int state);
126 
134  virtual void PlaceWidget(double bounds[6]);
135 
146  virtual void PlaceWidget(double anchor[3], int size[2]);
147 
149 
152  virtual void ShallowCopy(vtkProp *prop);
153  virtual double *GetBounds();
154  virtual void GetActors(vtkPropCollection *pc);
155  virtual void ReleaseGraphicsResources(vtkWindow*);
156  virtual int RenderOverlay(vtkViewport*);
157  virtual int HasTranslucentPolygonalGeometry();
159 
160 protected:
163 
164  // Representing the button
166 
167  // Properties of the button
171  void CreateDefaultProperties();
172 
173  // Keep track of the images (textures) associated with the N
174  // states of the button.
175  vtkTextureArray *TextureArray;
176 
177  // Tracking world position
179 
180 private:
182  void operator=(const vtkTexturedButtonRepresentation2D&) VTK_DELETE_FUNCTION;
183 };
184 
185 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
virtual int RenderOverlay(vtkViewport *vtkNotUsed(viewport))
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:47
virtual void ShallowCopy(vtkProp *prop)
Satisfy some of vtkProp's API.
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
Proxy object to connect input/output ports.
a list of Props
virtual void Highlight(int)
These methods control the appearance of the button as it is being interacted with.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
void PrintSelf(ostream &os, vtkIndent indent)
Standard methods for the class.
virtual double * GetBounds()
Methods to make this class behave as a vtkProp.
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
a simple class to control print indentation
Definition: vtkIndent.h:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
abstract class defines the representation for a vtkButtonWidget
virtual void GetActors(vtkPropCollection *)
For some exporters and other other operations we must be able to collect all the actors or volumes...
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:70
represent the vtkBalloonWidget
vtkBalloonRepresentation * GetBalloon()
Grab the underlying vtkBalloonRepresentation used to position and display the button texture...
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
The following is a suggested API for widget representations.
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
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...