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) override;
77 
79 
83  virtual void SetProperty(vtkProperty2D *p);
84  vtkGetObjectMacro(Property,vtkProperty2D);
86 
88 
92  vtkGetObjectMacro(HoveringProperty,vtkProperty2D);
94 
96 
100  vtkGetObjectMacro(SelectingProperty,vtkProperty2D);
102 
104 
111 
116  vtkBalloonRepresentation *GetBalloon() {return this->Balloon;}
117 
119 
122  int ComputeInteractionState(int X, int Y, int modify=0) override;
123  void BuildRepresentation() override;
124  void Highlight(int state) override;
126 
134  void PlaceWidget(double bounds[6]) override;
135 
146  virtual void PlaceWidget(double anchor[3], int size[2]);
147 
149 
152  void ShallowCopy(vtkProp *prop) override;
153  double *GetBounds() override;
154  void GetActors(vtkPropCollection *pc) override;
156  int RenderOverlay(vtkViewport*) override;
159 
160 protected:
163 
164  // Representing the button
166 
167  // Properties of the button
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&) = delete;
183 };
184 
185 #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)
vtkTexturedButtonRepresentation2D::~vtkTexturedButtonRepresentation2D
~vtkTexturedButtonRepresentation2D() override
vtkTexturedButtonRepresentation2D::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTexturedButtonRepresentation2D::Property
vtkProperty2D * Property
Definition: vtkTexturedButtonRepresentation2D.h:168
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:165
vtkTexturedButtonRepresentation2D::GetBalloon
vtkBalloonRepresentation * GetBalloon()
Grab the underlying vtkBalloonRepresentation used to position and display the button texture.
Definition: vtkTexturedButtonRepresentation2D.h:116
vtkTexturedButtonRepresentation2D::CreateDefaultProperties
void CreateDefaultProperties()
vtkX3D::image
@ image
Definition: vtkX3D.h:374
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:170
vtkTexturedButtonRepresentation2D::TextureArray
vtkTextureArray * TextureArray
Definition: vtkTexturedButtonRepresentation2D.h:175
vtkTexturedButtonRepresentation2D::Highlight
void Highlight(int state) override
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:46
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
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:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
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:82
vtkTexturedButtonRepresentation2D::HoveringProperty
vtkProperty2D * HoveringProperty
Definition: vtkTexturedButtonRepresentation2D.h:169
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkBalloonRepresentation
represent the vtkBalloonWidget
Definition: vtkBalloonRepresentation.h:83
vtkTexturedButtonRepresentation2D::GetBounds
double * GetBounds() override
Get the bounds for this Prop as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:53
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:41
vtkTexturedButtonRepresentation2D::BuildRepresentation
void BuildRepresentation() override
vtkTexturedButtonRepresentation2D::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
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:40
vtkTexturedButtonRepresentation2D::New
static vtkTexturedButtonRepresentation2D * New()
Instantiate the class.
vtkTexturedButtonRepresentation2D::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkTexturedButtonRepresentation2D::RenderOverlay
int RenderOverlay(vtkViewport *) override
vtkTexturedButtonRepresentation2D::GetActors
void GetActors(vtkPropCollection *pc) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:42
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkTexturedButtonRepresentation2D::Anchor
vtkCoordinate * Anchor
Definition: vtkTexturedButtonRepresentation2D.h:178
vtkTexturedButtonRepresentation2D
defines a representation for a vtkButtonWidget
Definition: vtkTexturedButtonRepresentation2D.h:63