VTK  9.3.1
vtkTexturedButtonRepresentation2D.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
35 #ifndef vtkTexturedButtonRepresentation2D_h
36 #define vtkTexturedButtonRepresentation2D_h
37 
39 #include "vtkInteractionWidgetsModule.h" // For export macro
40 
41 VTK_ABI_NAMESPACE_BEGIN
42 class vtkProperty2D;
43 class vtkImageData;
44 class vtkTextureArray; // PIMPLd
45 class vtkProperty2D;
46 class vtkAlgorithmOutput;
48 class vtkCoordinate;
49 
50 class VTKINTERACTIONWIDGETS_EXPORT vtkTexturedButtonRepresentation2D
52 {
53 public:
58 
60 
64  void PrintSelf(ostream& os, vtkIndent indent) override;
66 
68 
72  virtual void SetProperty(vtkProperty2D* p);
73  vtkGetObjectMacro(Property, vtkProperty2D);
75 
77 
80  virtual void SetHoveringProperty(vtkProperty2D* p);
81  vtkGetObjectMacro(HoveringProperty, vtkProperty2D);
83 
85 
88  virtual void SetSelectingProperty(vtkProperty2D* p);
89  vtkGetObjectMacro(SelectingProperty, vtkProperty2D);
91 
93 
97  void SetButtonTexture(int i, vtkImageData* image);
98  vtkImageData* GetButtonTexture(int i);
100 
105  vtkBalloonRepresentation* GetBalloon() { return this->Balloon; }
106 
108 
111  int ComputeInteractionState(int X, int Y, int modify = 0) override;
112  void BuildRepresentation() override;
113  void Highlight(int state) override;
115 
123  void PlaceWidget(double bounds[6]) override;
124 
135  virtual void PlaceWidget(double anchor[3], int size[2]);
136 
138 
141  void ShallowCopy(vtkProp* prop) override;
142  double* GetBounds() override;
143  void GetActors(vtkPropCollection* pc) override;
144  void ReleaseGraphicsResources(vtkWindow*) override;
145  int RenderOverlay(vtkViewport*) override;
148 
149 protected:
152 
153  // Representing the button
155 
156  // Properties of the button
160  void CreateDefaultProperties();
161 
162  // Keep track of the images (textures) associated with the N
163  // states of the button.
164  vtkTextureArray* TextureArray;
165 
166  // Tracking world position
168 
169 private:
171  void operator=(const vtkTexturedButtonRepresentation2D&) = delete;
172 };
173 
174 VTK_ABI_NAMESPACE_END
175 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:45
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
virtual void PlaceWidget(double vtkNotUsed(bounds)[6])
The following is a suggested API for widget representations.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:44
void ShallowCopy(vtkProp *prop) override
Satisfy some of vtkProp's API.
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
Proxy object to connect input/output ports.
double * GetBounds() override
Methods to make this class behave as a vtkProp.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
a simple class to control print indentation
Definition: vtkIndent.h:28
void Highlight(int) override
These methods control the appearance of the button as it is being interacted with.
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
abstract class defines the representation for a vtkButtonWidget
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
represent the vtkBalloonWidget
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
vtkBalloonRepresentation * GetBalloon()
Grab the underlying vtkBalloonRepresentation used to position and display the button texture...
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
represent surface properties of a 2D image
Definition: vtkProperty2D.h:29
defines a representation for a vtkButtonWidget
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...