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:
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 
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 
233  virtual int RenderOverlay(vtkViewport*);
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
a actor that draws 2D data
Definition: vtkActor2D.h:46
represent a vtkBorderWidget
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
virtual void GetSize(double size[2])
static vtkBorderRepresentation * New()
Instantiate this class.
virtual int GetShowBorderMinValue()
virtual int RenderOverlay(vtkViewport *)
vtkPolyDataMapper2D * BWMapper
_InteractionState
Define the various states that the representation can be in.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual int ComputeInteractionState(int X, int Y, int modify=0)
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkTransformPolyDataFilter * BWTransformFilter
virtual void WidgetInteraction(double eventPos[2])
virtual void NegotiateLayout()
virtual void StartWidgetInteraction(double eventPos[2])
virtual vtkMTimeType GetMTime()
Return the MTime of this object.
virtual void SetShowBorder(int border)
Specify when and if the border should appear.
virtual int GetShowBorderMaxValue()
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
virtual void GetActors2D(vtkPropCollection *)
These methods are necessary to make this representation behave as a vtkProp.
virtual int GetShowBorder()
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual void BuildRepresentation()
Subclasses should implement these methods.
virtual void UpdateShowBorder()
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:71
a simple class to control print indentation
Definition: vtkIndent.h:40
represent and manipulate 3D points
Definition: vtkPoints.h:40
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
a list of Props
represent surface properties of a 2D image
Definition: vtkProperty2D.h:41
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
abstract specification for Viewports
Definition: vtkViewport.h:48
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ size
Definition: vtkX3D.h:253
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248