VTK  9.1.0
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 =========================================================================*/
63 #ifndef vtkTexturedButtonRepresentation2D_h
64 #define vtkTexturedButtonRepresentation2D_h
65 
67 #include "vtkInteractionWidgetsModule.h" // For export macro
68 
69 class vtkProperty2D;
70 class vtkImageData;
71 class vtkTextureArray; // PIMPLd
72 class vtkProperty2D;
73 class vtkAlgorithmOutput;
75 class vtkCoordinate;
76 
77 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation2D
79 {
80 public:
85 
87 
91  void PrintSelf(ostream& os, vtkIndent indent) override;
93 
95 
99  virtual void SetProperty(vtkProperty2D* p);
100  vtkGetObjectMacro(Property, vtkProperty2D);
102 
104 
108  vtkGetObjectMacro(HoveringProperty, vtkProperty2D);
110 
112 
116  vtkGetObjectMacro(SelectingProperty, vtkProperty2D);
118 
120 
127 
132  vtkBalloonRepresentation* GetBalloon() { return this->Balloon; }
133 
135 
138  int ComputeInteractionState(int X, int Y, int modify = 0) override;
139  void BuildRepresentation() override;
140  void Highlight(int state) override;
142 
150  void PlaceWidget(double bounds[6]) override;
151 
162  virtual void PlaceWidget(double anchor[3], int size[2]);
163 
165 
168  void ShallowCopy(vtkProp* prop) override;
169  double* GetBounds() override;
170  void GetActors(vtkPropCollection* pc) override;
172  int RenderOverlay(vtkViewport*) override;
175 
176 protected:
179 
180  // Representing the button
182 
183  // Properties of the button
188 
189  // Keep track of the images (textures) associated with the N
190  // states of the button.
191  vtkTextureArray* TextureArray;
192 
193  // Tracking world position
195 
196 private:
198  void operator=(const vtkTexturedButtonRepresentation2D&) = delete;
199 };
200 
201 #endif
vtkTexturedButtonRepresentation2D::SetHoveringProperty
virtual void SetHoveringProperty(vtkProperty2D *p)
Specify the property to use when the hovering over the button.
vtkTexturedButtonRepresentation2D::GetButtonTexture
vtkImageData * GetButtonTexture(int i)
Add the ith texture corresponding to the ith button state.
vtkTexturedButtonRepresentation2D::~vtkTexturedButtonRepresentation2D
~vtkTexturedButtonRepresentation2D() override
vtkTexturedButtonRepresentation2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
vtkTexturedButtonRepresentation2D::Property
vtkProperty2D * Property
Definition: vtkTexturedButtonRepresentation2D.h:184
vtkTexturedButtonRepresentation2D::SetProperty
virtual void SetProperty(vtkProperty2D *p)
Specify the property to use when the button is to appear "normal" i.e., the mouse pointer is not hove...
vtkTexturedButtonRepresentation2D::Balloon
vtkBalloonRepresentation * Balloon
Definition: vtkTexturedButtonRepresentation2D.h:181
vtkTexturedButtonRepresentation2D::GetBalloon
vtkBalloonRepresentation * GetBalloon()
Grab the underlying vtkBalloonRepresentation used to position and display the button texture.
Definition: vtkTexturedButtonRepresentation2D.h:132
vtkTexturedButtonRepresentation2D::CreateDefaultProperties
void CreateDefaultProperties()
vtkX3D::image
@ image
Definition: vtkX3D.h:380
vtkTexturedButtonRepresentation2D::vtkTexturedButtonRepresentation2D
vtkTexturedButtonRepresentation2D()
vtkTexturedButtonRepresentation2D::ShallowCopy
void ShallowCopy(vtkProp *prop) override
Provide the necessary methods to satisfy the rendering API.
vtkTexturedButtonRepresentation2D::SelectingProperty
vtkProperty2D * SelectingProperty
Definition: vtkTexturedButtonRepresentation2D.h:186
vtkTexturedButtonRepresentation2D::TextureArray
vtkTextureArray * TextureArray
Definition: vtkTexturedButtonRepresentation2D.h:191
vtkTexturedButtonRepresentation2D::Highlight
void Highlight(int state) override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
vtkButtonRepresentation.h
vtkTexturedButtonRepresentation2D::PlaceWidget
virtual void PlaceWidget(double anchor[3], int size[2])
This alternative PlaceWidget() method can be used to anchor the button to a 3D point.
vtkButtonRepresentation
abstract class defines the representation for a vtkButtonWidget
Definition: vtkButtonRepresentation.h:48
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkTexturedButtonRepresentation2D::PlaceWidget
void PlaceWidget(double bounds[6]) override
Conventional PlaceWidget() method to satisfy the vtkWidgetRepresentation API.
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkTexturedButtonRepresentation2D::SetButtonTexture
void SetButtonTexture(int i, vtkImageData *image)
Add the ith texture corresponding to the ith button state.
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:186
vtkTexturedButtonRepresentation2D::HoveringProperty
vtkProperty2D * HoveringProperty
Definition: vtkTexturedButtonRepresentation2D.h:185
vtkX3D::size
@ size
Definition: vtkX3D.h:259
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkBalloonRepresentation
represent the vtkBalloonWidget
Definition: vtkBalloonRepresentation.h:96
vtkTexturedButtonRepresentation2D::GetBounds
double * GetBounds() override
Provide the necessary methods to satisfy the rendering API.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
vtkTexturedButtonRepresentation2D::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modify=0) override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:147
vtkTexturedButtonRepresentation2D::BuildRepresentation
void BuildRepresentation() override
Provide the necessary methods to satisfy the vtkWidgetRepresentation API.
vtkTexturedButtonRepresentation2D::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Provide the necessary methods to satisfy the rendering API.
vtkTexturedButtonRepresentation2D::SetSelectingProperty
virtual void SetSelectingProperty(vtkProperty2D *p)
Specify the property to use when selecting the button.
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:66
vtkTexturedButtonRepresentation2D::New
static vtkTexturedButtonRepresentation2D * New()
Instantiate the class.
vtkTexturedButtonRepresentation2D::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
Provide the necessary methods to satisfy the rendering API.
vtkTexturedButtonRepresentation2D::RenderOverlay
int RenderOverlay(vtkViewport *) override
Provide the necessary methods to satisfy the rendering API.
vtkTexturedButtonRepresentation2D::GetActors
void GetActors(vtkPropCollection *pc) override
Provide the necessary methods to satisfy the rendering API.
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:85
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkTexturedButtonRepresentation2D::Anchor
vtkCoordinate * Anchor
Definition: vtkTexturedButtonRepresentation2D.h:194
vtkTexturedButtonRepresentation2D
defines a representation for a vtkButtonWidget
Definition: vtkTexturedButtonRepresentation2D.h:79