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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkWidgetRepresentation.h
vtkBorderRepresentation::Inside
@ Inside
Definition: vtkBorderRepresentation.h:196
vtkBorderRepresentation::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkBorderRepresentation::Tolerance
int Tolerance
Definition: vtkBorderRepresentation.h:248
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:52
vtkBorderRepresentation::AdjustingP3
@ AdjustingP3
Definition: vtkBorderRepresentation.h:200
vtkBorderRepresentation
represent a vtkBorderWidget
Definition: vtkBorderRepresentation.h:59
vtkBorderRepresentation::ShowVerticalBorder
int ShowVerticalBorder
Definition: vtkBorderRepresentation.h:244
vtkBorderRepresentation::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
These methods are necessary to make this representation behave as a vtkProp.
vtkBorderRepresentation::SetShowBorder
virtual void SetShowBorder(int border)
Specify when and if the border should appear.
vtkBorderRepresentation::UpdateShowBorder
virtual void UpdateShowBorder()
vtkBorderRepresentation::New
static vtkBorderRepresentation * New()
Instantiate this class.
vtkBorderRepresentation::BWTransform
vtkTransform * BWTransform
Definition: vtkBorderRepresentation.h:273
vtkBorderRepresentation::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:55
vtkBorderRepresentation::Position2Coordinate
vtkCoordinate * Position2Coordinate
Definition: vtkBorderRepresentation.h:254
vtkBorderRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkBorderRepresentation::PositionCoordinate
vtkCoordinate * PositionCoordinate
Definition: vtkBorderRepresentation.h:253
vtkBorderRepresentation::ProportionalResize
int ProportionalResize
Definition: vtkBorderRepresentation.h:247
vtkBorderRepresentation::AdjustingP2
@ AdjustingP2
Definition: vtkBorderRepresentation.h:199
vtkBorderRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
vtkBorderRepresentation::AdjustingP1
@ AdjustingP1
Definition: vtkBorderRepresentation.h:198
vtkBorderRepresentation::SetShowBorderToOff
void SetShowBorderToOff()
Definition: vtkBorderRepresentation.h:106
vtkBorderRepresentation::GetShowBorderMaxValue
virtual int GetShowBorderMaxValue()
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
vtkBorderRepresentation::BWTransformFilter
vtkTransformPolyDataFilter * BWTransformFilter
Definition: vtkBorderRepresentation.h:274
vtkBorderRepresentation::BORDER_ON
@ BORDER_ON
Definition: vtkBorderRepresentation.h:88
vtkBorderRepresentation::SetShowBorderToActive
void SetShowBorderToActive()
Definition: vtkBorderRepresentation.h:108
vtkBorderRepresentation::~vtkBorderRepresentation
~vtkBorderRepresentation()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkMTimeType
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
vtkBorderRepresentation::vtkBorderRepresentation
vtkBorderRepresentation()
vtkBorderRepresentation::SetShowBorderToOn
void SetShowBorderToOn()
Definition: vtkBorderRepresentation.h:107
vtkBorderRepresentation::WidgetInteraction
virtual void WidgetInteraction(double eventPos[2])
vtkBorderRepresentation::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkBorderRepresentation::BorderProperty
vtkProperty2D * BorderProperty
Definition: vtkBorderRepresentation.h:246
vtkBorderRepresentation::NegotiateLayout
virtual void NegotiateLayout()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkBorderRepresentation::GetSize
virtual void GetSize(double size[2])
Definition: vtkBorderRepresentation.h:221
vtkBorderRepresentation::BuildRepresentation
virtual void BuildRepresentation()
Subclasses should implement these methods.
vtkBorderRepresentation::GetShowBorderMinValue
virtual int GetShowBorderMinValue()
vtkBorderRepresentation::AdjustingE1
@ AdjustingE1
Definition: vtkBorderRepresentation.h:202
vtkBorderRepresentation::GetShowBorder
virtual int GetShowBorder()
vtkBorderRepresentation::GetMTime
virtual vtkMTimeType GetMTime()
Return the MTime of this object.
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:71
vtkX3D::size
@ size
Definition: vtkX3D.h:253
vtkBorderRepresentation::BWPolyData
vtkPolyData * BWPolyData
Definition: vtkBorderRepresentation.h:272
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:52
vtkBorderRepresentation::Moving
int Moving
Definition: vtkBorderRepresentation.h:249
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkBorderRepresentation::BWActor
vtkActor2D * BWActor
Definition: vtkBorderRepresentation.h:276
vtkBorderRepresentation::AdjustingE2
@ AdjustingE2
Definition: vtkBorderRepresentation.h:203
vtkCoordinate.h
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBorderRepresentation::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:41
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:46
vtkBorderRepresentation::_InteractionState
_InteractionState
Define the various states that the representation can be in.
Definition: vtkBorderRepresentation.h:194
vtkBorderRepresentation::AdjustingE0
@ AdjustingE0
Definition: vtkBorderRepresentation.h:201
vtkBorderRepresentation::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkBorderRepresentation::Negotiated
int Negotiated
Definition: vtkBorderRepresentation.h:258
vtkBorderRepresentation::ShowHorizontalBorder
int ShowHorizontalBorder
Definition: vtkBorderRepresentation.h:245
vtkBorderRepresentation::BWMapper
vtkPolyDataMapper2D * BWMapper
Definition: vtkBorderRepresentation.h:275
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:39
vtkBorderRepresentation::AdjustingP0
@ AdjustingP0
Definition: vtkBorderRepresentation.h:197
vtkBorderRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkBorderRepresentation::BWPoints
vtkPoints * BWPoints
Definition: vtkBorderRepresentation.h:271