VTK
vtkBorderRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkBorderRepresentation.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 =========================================================================*/
42 #ifndef vtkBorderRepresentation_h
43 #define vtkBorderRepresentation_h
44 
45 #include "vtkInteractionWidgetsModule.h" // For export macro
47 #include "vtkCoordinate.h" //Because of the viewport coordinate macro
48 
49 class vtkPoints;
50 class vtkPolyData;
51 class vtkTransform;
54 class vtkActor2D;
55 class vtkProperty2D;
56 
57 
58 class VTKINTERACTIONWIDGETS_EXPORT vtkBorderRepresentation : public vtkWidgetRepresentation
59 {
60 public:
64  static vtkBorderRepresentation *New();
65 
67 
71  void PrintSelf(ostream& os, vtkIndent indent) override;
73 
75 
84  vtkViewportCoordinateMacro(Position);
85  vtkViewportCoordinateMacro(Position2);
87 
88  enum {BORDER_OFF=0,BORDER_ON,BORDER_ACTIVE};
89 
91 
102  virtual void SetShowBorder(int border);
103  virtual int GetShowBorderMinValue();
104  virtual int GetShowBorderMaxValue();
105  virtual int GetShowBorder();
106  void SetShowBorderToOff() {this->SetShowBorder(BORDER_OFF);}
107  void SetShowBorderToOn() {this->SetShowBorder(BORDER_ON);}
108  void SetShowBorderToActive() {this->SetShowBorder(BORDER_ACTIVE);}
110 
112 
116  vtkSetClampMacro(ShowVerticalBorder,int,BORDER_OFF,BORDER_ACTIVE);
117  vtkGetMacro(ShowVerticalBorder,int);
119 
121 
125  vtkSetClampMacro(ShowHorizontalBorder,int,BORDER_OFF,BORDER_ACTIVE);
126  vtkGetMacro(ShowHorizontalBorder,int);
128 
130 
133  vtkGetObjectMacro(BorderProperty,vtkProperty2D);
135 
137 
144  vtkSetMacro(ProportionalResize,vtkTypeBool);
145  vtkGetMacro(ProportionalResize,vtkTypeBool);
146  vtkBooleanMacro(ProportionalResize,vtkTypeBool);
148 
150 
155  vtkSetVector2Macro(MinimumSize,int);
156  vtkGetVector2Macro(MinimumSize,int);
157  vtkSetVector2Macro(MaximumSize,int);
158  vtkGetVector2Macro(MaximumSize,int);
160 
162 
167  vtkSetClampMacro(Tolerance,int,1,10);
168  vtkGetMacro(Tolerance,int);
170 
172 
176  vtkGetVectorMacro(SelectionPoint,double,2);
178 
180 
185  vtkSetMacro(Moving,vtkTypeBool);
186  vtkGetMacro(Moving,vtkTypeBool);
187  vtkBooleanMacro(Moving,vtkTypeBool);
189 
194  {
195  Outside=0,
204  AdjustingE3
205  };
206 
211  vtkMTimeType GetMTime() override;
212 
214 
218  void BuildRepresentation() override;
219  void StartWidgetInteraction(double eventPos[2]) override;
220  void WidgetInteraction(double eventPos[2]) override;
221  virtual void GetSize(double size[2])
222  {size[0]=1.0; size[1]=1.0;}
223  int ComputeInteractionState(int X, int Y, int modify=0) override;
225 
227 
231  void GetActors2D(vtkPropCollection*) override;
232  void ReleaseGraphicsResources(vtkWindow*) override;
233  int RenderOverlay(vtkViewport*) override;
234  int RenderOpaqueGeometry(vtkViewport*) override;
238 
239 protected:
241  ~vtkBorderRepresentation() override;
242 
243  // Ivars
250  double SelectionPoint[2];
251 
252  // Layout (position of lower left and upper right corners of border)
255 
256  // Sometimes subclasses must negotiate with their superclasses
257  // to achieve the correct layout.
259  virtual void NegotiateLayout();
260 
261  // Update the border visibility based on InteractionState.
262  // See Also: SetShowHorizontalBorder(), SetShowHorizontalBorder(),
263  // ComputeInteractionState()
264  virtual void UpdateShowBorder();
265 
266  // Keep track of start position when moving border
267  double StartPosition[2];
268 
269  // Border representation. Subclasses may use the BWTransform class
270  // to transform their geometry into the region surrounded by the border.
277 
278  // Constraints on size
279  int MinimumSize[2];
280  int MaximumSize[2];
281 
282 private:
284  void operator=(const vtkBorderRepresentation&) = delete;
285 };
286 
287 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
abstract specification for Viewports
Definition: vtkViewport.h:47
void GetActors2D(vtkPropCollection *) override
virtual void StartWidgetInteraction(double eventPos[2])
vtkTransformPolyDataFilter * BWTransformFilter
a actor that draws 2D data
Definition: vtkActor2D.h:45
void SetShowBorderToOff()
Specify when and if the border should appear.
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
an ordered list of Props
int vtkTypeBool
Definition: vtkABI.h:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
virtual void GetSize(double size[2])
Subclasses should implement these methods.
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
void SetShowBorderToOn()
Specify when and if the border should appear.
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetShowBorderToActive()
Specify when and if the border should appear.
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
represent a vtkBorderWidget
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:81
_InteractionState
Define the various states that the representation can be in.
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:40
vtkPolyDataMapper2D * BWMapper
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:39