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);
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,int);
145  vtkGetMacro(ProportionalResize,int);
146  vtkBooleanMacro(ProportionalResize,int);
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,int);
186  vtkGetMacro(Moving,int);
187  vtkBooleanMacro(Moving,int);
189 
194  {
195  Outside=0,
204  AdjustingE3
205  };
206 
211  virtual vtkMTimeType GetMTime();
212 
214 
218  virtual void BuildRepresentation();
219  virtual void StartWidgetInteraction(double eventPos[2]);
220  virtual void WidgetInteraction(double eventPos[2]);
221  virtual void GetSize(double size[2])
222  {size[0]=1.0; size[1]=1.0;}
223  virtual int ComputeInteractionState(int X, int Y, int modify=0);
225 
227 
231  virtual void GetActors2D(vtkPropCollection*);
232  virtual void ReleaseGraphicsResources(vtkWindow*);
233  virtual int RenderOverlay(vtkViewport*);
234  virtual int RenderOpaqueGeometry(vtkViewport*);
236  virtual int HasTranslucentPolygonalGeometry();
238 
239 protected:
242 
243  // Ivars
249  int Moving;
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:
283  vtkBorderRepresentation(const vtkBorderRepresentation&) VTK_DELETE_FUNCTION;
284  void operator=(const vtkBorderRepresentation&) VTK_DELETE_FUNCTION;
285 };
286 
287 #endif
virtual int RenderOverlay(vtkViewport *vtkNotUsed(viewport))
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:47
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
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
a list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
virtual void GetSize(double size[2])
Subclasses should implement these methods.
void SetShowBorderToOn()
Specify when and if the border should appear.
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
a simple class to control print indentation
Definition: vtkIndent.h:39
void SetShowBorderToActive()
Specify when and if the border should appear.
virtual vtkMTimeType GetMTime()
Return this object's modified time.
virtual void WidgetInteraction(double newEventPos[2])
represent a vtkBorderWidget
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems ...
Definition: vtkCoordinate.h:70
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
_InteractionState
Define the various states that the representation can be in.
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void GetActors2D(vtkPropCollection *)
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
vtkPolyDataMapper2D * BWMapper
void PrintSelf(ostream &os, vtkIndent indent)
Standard methods for instances of this class.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport))
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:39