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 =========================================================================*/
41 #ifndef vtkBorderRepresentation_h
42 #define vtkBorderRepresentation_h
43 
44 #include "vtkInteractionWidgetsModule.h" // For export macro
46 #include "vtkCoordinate.h" //Because of the viewport coordinate macro
47 
48 class vtkPoints;
49 class vtkPolyData;
50 class vtkTransform;
53 class vtkActor2D;
54 class vtkProperty2D;
55 
56 
58 {
59 public:
61  static vtkBorderRepresentation *New();
62 
64 
66  void PrintSelf(ostream& os, vtkIndent indent);
68 
70 
77  vtkViewportCoordinateMacro(Position);
78  vtkViewportCoordinateMacro(Position2);
80 
81 //BTX
82  enum {BORDER_OFF=0,BORDER_ON,BORDER_ACTIVE};
83 //ETX
85 
92  virtual void SetShowBorder(int border);
93  virtual int GetShowBorderMinValue();
94  virtual int GetShowBorderMaxValue();
95  virtual int GetShowBorder();
96  void SetShowBorderToOff() {this->SetShowBorder(BORDER_OFF);}
97  void SetShowBorderToOn() {this->SetShowBorder(BORDER_ON);}
98  void SetShowBorderToActive() {this->SetShowBorder(BORDER_ACTIVE);}
100 
102 
104  vtkSetClampMacro(ShowVerticalBorder,int,BORDER_OFF,BORDER_ACTIVE);
105  vtkGetMacro(ShowVerticalBorder,int);
107 
109 
111  vtkSetClampMacro(ShowHorizontalBorder,int,BORDER_OFF,BORDER_ACTIVE);
112  vtkGetMacro(ShowHorizontalBorder,int);
114 
116 
117  vtkGetObjectMacro(BorderProperty,vtkProperty2D);
119 
121 
126  vtkSetMacro(ProportionalResize,int);
127  vtkGetMacro(ProportionalResize,int);
128  vtkBooleanMacro(ProportionalResize,int);
130 
132 
135  vtkSetVector2Macro(MinimumSize,int);
136  vtkGetVector2Macro(MinimumSize,int);
137  vtkSetVector2Macro(MaximumSize,int);
138  vtkGetVector2Macro(MaximumSize,int);
140 
142 
145  vtkSetClampMacro(Tolerance,int,1,10);
146  vtkGetMacro(Tolerance,int);
148 
150 
152  vtkGetVectorMacro(SelectionPoint,double,2);
154 
156 
159  vtkSetMacro(Moving,int);
160  vtkGetMacro(Moving,int);
161  vtkBooleanMacro(Moving,int);
163 
164 //BTX
166 
168  {
169  Outside=0,
178  AdjustingE3
179  };
180 //ETX
182 
184 
186  virtual void BuildRepresentation();
187  virtual void StartWidgetInteraction(double eventPos[2]);
188  virtual void WidgetInteraction(double eventPos[2]);
189  virtual void GetSize(double size[2])
190  {size[0]=1.0; size[1]=1.0;}
191  virtual int ComputeInteractionState(int X, int Y, int modify=0);
193 
195 
197  virtual void GetActors2D(vtkPropCollection*);
198  virtual void ReleaseGraphicsResources(vtkWindow*);
199  virtual int RenderOverlay(vtkViewport*);
200  virtual int RenderOpaqueGeometry(vtkViewport*);
202  virtual int HasTranslucentPolygonalGeometry();
204 
205 protected:
208 
209  // Ivars
215  int Moving;
216  double SelectionPoint[2];
217 
218  // Layout (position of lower left and upper right corners of border)
221 
222  // Sometimes subclasses must negotiate with their superclasses
223  // to achieve the correct layout.
225  virtual void NegotiateLayout();
226 
227  // Update the border visibility based on InteractionState.
228  // See Also: SetShowHorizontalBorder(), SetShowHorizontalBorder(),
229  // ComputeInteractionState()
230  virtual void UpdateShowBorder();
231 
232  // Keep track of start position when moving border
233  double StartPosition[2];
234 
235  // Border representation. Subclasses may use the BWTransform class
236  // to transform their geometry into the region surrounded by the border.
243 
244  // Constraints on size
245  int MinimumSize[2];
246  int MaximumSize[2];
247 
248 private:
249  vtkBorderRepresentation(const vtkBorderRepresentation&); //Not implemented
250  void operator=(const vtkBorderRepresentation&); //Not implemented
251 };
252 
253 #endif
virtual int RenderOverlay(vtkViewport *vtkNotUsed(viewport))
virtual int ComputeInteractionState(int X, int Y, int modify=0)
abstract specification for Viewports
Definition: vtkViewport.h:46
virtual void StartWidgetInteraction(double eventPos[2])
vtkTransformPolyDataFilter * BWTransformFilter
a actor that draws 2D data
Definition: vtkActor2D.h:44
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:59
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:83
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
a list of Props
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
virtual void GetSize(double size[2])
#define VTKINTERACTIONWIDGETS_EXPORT
virtual int HasTranslucentPolygonalGeometry()
a simple class to control print indentation
Definition: vtkIndent.h:38
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:69
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void GetActors2D(vtkPropCollection *)
represent surface properties of a 2D image
Definition: vtkProperty2D.h:39
vtkPolyDataMapper2D * BWMapper
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport))
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:38