VTK  9.0.1
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 
48 #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 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation2D
60 {
61 public:
66 
68 
72  void PrintSelf(ostream& os, vtkIndent indent) 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) override;
120  void BuildRepresentation() override;
121  void Highlight(int state) override;
123 
131  void PlaceWidget(double bounds[6]) override;
132 
143  virtual void PlaceWidget(double anchor[3], int size[2]);
144 
146 
149  void ShallowCopy(vtkProp* prop) override;
150  double* GetBounds() override;
151  void GetActors(vtkPropCollection* pc) override;
152  void ReleaseGraphicsResources(vtkWindow*) override;
153  int RenderOverlay(vtkViewport*) override;
156 
157 protected:
160 
161  // Representing the button
163 
164  // Properties of the button
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:
179  void operator=(const vtkTexturedButtonRepresentation2D&) = delete;
180 };
181 
182 #endif
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
vtkTexturedButtonRepresentation2D::Property
vtkProperty2D * Property
Definition: vtkTexturedButtonRepresentation2D.h:165
vtkTexturedButtonRepresentation2D::Balloon
vtkBalloonRepresentation * Balloon
Definition: vtkTexturedButtonRepresentation2D.h:162
vtkTexturedButtonRepresentation2D::GetBalloon
vtkBalloonRepresentation * GetBalloon()
Grab the underlying vtkBalloonRepresentation used to position and display the button texture.
Definition: vtkTexturedButtonRepresentation2D.h:113
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
vtkTexturedButtonRepresentation2D::SelectingProperty
vtkProperty2D * SelectingProperty
Definition: vtkTexturedButtonRepresentation2D.h:167
vtkTexturedButtonRepresentation2D::TextureArray
vtkTextureArray * TextureArray
Definition: vtkTexturedButtonRepresentation2D.h:172
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
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
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
vtkWidgetRepresentation::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
Definition: vtkWidgetRepresentation.h:208
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkButtonRepresentation::Highlight
void Highlight(int) override
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkTexturedButtonRepresentation2D::HoveringProperty
vtkProperty2D * HoveringProperty
Definition: vtkTexturedButtonRepresentation2D.h:166
vtkX3D::size
@ size
Definition: vtkX3D.h:259
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkBalloonRepresentation
represent the vtkBalloonWidget
Definition: vtkBalloonRepresentation.h:76
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
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
vtkWidgetRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:214
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:36
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
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
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkTexturedButtonRepresentation2D::Anchor
vtkCoordinate * Anchor
Definition: vtkTexturedButtonRepresentation2D.h:175
vtkTexturedButtonRepresentation2D
defines a representation for a vtkButtonWidget
Definition: vtkTexturedButtonRepresentation2D.h:58