VTK  9.3.1
vtkMagnifierRepresentation.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
20 #ifndef vtkMagnifierRepresentation_h
21 #define vtkMagnifierRepresentation_h
22 
23 #include "vtkCoordinate.h" //Because of the viewport coordinate macro
24 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
25 #include "vtkInteractionWidgetsModule.h" // For export macro
26 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
28 
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkPropCollection;
31 class vtkPoints;
32 class vtkPolyData;
34 class vtkActor2D;
35 class vtkProperty2D;
36 
37 class VTKINTERACTIONWIDGETS_EXPORT vtkMagnifierRepresentation : public vtkWidgetRepresentation
38 {
39 public:
44 
46 
50  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54 
57  void SetRenderer(vtkRenderer* ren) override { this->Superclass::SetRenderer(ren); }
59 
61 
68  vtkSetClampMacro(MagnificationFactor, double, 0.001, 1000.0);
69  vtkGetMacro(MagnificationFactor, double);
71 
73 
80  void AddViewProp(vtkProp*);
81  vtkPropCollection* GetViewProps() { return this->Props; }
82  int HasViewProp(vtkProp*);
83  void RemoveViewProp(vtkProp*);
84  void RemoveAllViewProps();
86 
88 
91  vtkSetVector2Macro(Size, int);
92  vtkGetVector2Macro(Size, int);
94 
96 
100  vtkSetMacro(Border, bool);
101  vtkGetMacro(Border, bool);
102  vtkBooleanMacro(Border, bool);
104 
106 
109  vtkGetObjectMacro(BorderProperty, vtkProperty2D);
111 
116  {
117  Invisible = 0,
118  Visible
119  };
120 #if !defined(VTK_LEGACY_REMOVE)
121  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
123 #endif
124 
126 
130  void BuildRepresentation() override;
131  void WidgetInteraction(double eventPos[2]) override;
133 
140  vtkSetClampMacro(InteractionState, int, Invisible, Visible);
141 
146  vtkRenderer* GetMagnificationRenderer() { return this->MagnificationRenderer; }
147 
149 
153  void ReleaseGraphicsResources(vtkWindow*) override;
154  int RenderOverlay(vtkViewport*) override;
155  int RenderOpaqueGeometry(vtkViewport*) override;
159 
164  vtkMTimeType GetMTime() override;
165 
166 protected:
168  ~vtkMagnifierRepresentation() override;
169 
170  // Ivars
173  int Size[2];
174  bool Border;
176 
177  // The internal magnification renderer and supporting classes
181 
182  // Border representation.
187 
188 private:
190  void operator=(const vtkMagnifierRepresentation&) = delete;
191 };
192 
193 VTK_ABI_NAMESPACE_END
194 #endif
represent a vtkBorderWidget
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:45
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:270
abstract specification for Viewports
Definition: vtkViewport.h:44
#define VTK_DEPRECATED_IN_9_2_0(reason)
a actor that draws 2D data
Definition: vtkActor2D.h:34
vtkPropCollection * GetViewProps()
Optionally specify and maintain the list of view props (e.g., actors, volumes, etc).
abstract specification for renderers
Definition: vtkRenderer.h:61
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
InteractionStateType
Define the various states that the representation can be in.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:27
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
a simple class to control print indentation
Definition: vtkIndent.h:28
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual vtkMTimeType GetMTime()
Return this object's modified time.
virtual void WidgetInteraction(double newEventPos[2])
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:68
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
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
vtkRenderer * GetMagnificationRenderer()
Provide access to the magnification renderer.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:28
void SetRenderer(vtkRenderer *ren) override
Specify the renderer viewport in which to place the magnifier.