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:
62 
64 
66  void PrintSelf(ostream& os, vtkIndent indent);
68 
70 
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 
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 
199  virtual int RenderOverlay(vtkViewport*);
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkWidgetRepresentation.h
vtkViewportCoordinateMacro
#define vtkViewportCoordinateMacro(name)
Definition: vtkSetGet.h:588
vtkBorderRepresentation::Inside
@ Inside
Definition: vtkBorderRepresentation.h:170
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkBorderRepresentation::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkBorderRepresentation::Tolerance
int Tolerance
Definition: vtkBorderRepresentation.h:214
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:51
vtkSetVector2Macro
#define vtkSetVector2Macro(name, type)
Definition: vtkSetGet.h:254
vtkBorderRepresentation::AdjustingP3
@ AdjustingP3
Definition: vtkBorderRepresentation.h:174
vtkBorderRepresentation
represent a vtkBorderWidget
Definition: vtkBorderRepresentation.h:58
vtkBorderRepresentation::ShowVerticalBorder
int ShowVerticalBorder
Definition: vtkBorderRepresentation.h:210
vtkBorderRepresentation::GetActors2D
virtual void GetActors2D(vtkPropCollection *)
vtkGetVector2Macro
#define vtkGetVector2Macro(name, type)
Definition: vtkSetGet.h:270
vtkBorderRepresentation::SetShowBorder
virtual void SetShowBorder(int border)
vtkBorderRepresentation::UpdateShowBorder
virtual void UpdateShowBorder()
vtkBorderRepresentation::New
static vtkBorderRepresentation * New()
vtkBorderRepresentation::BWTransform
vtkTransform * BWTransform
Definition: vtkBorderRepresentation.h:239
vtkBorderRepresentation::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:54
vtkBorderRepresentation::Position2Coordinate
vtkCoordinate * Position2Coordinate
Definition: vtkBorderRepresentation.h:220
vtkInteractionWidgetsModule.h
vtkBorderRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkBorderRepresentation::PositionCoordinate
vtkCoordinate * PositionCoordinate
Definition: vtkBorderRepresentation.h:219
vtkBorderRepresentation::ProportionalResize
int ProportionalResize
Definition: vtkBorderRepresentation.h:213
vtkBorderRepresentation::AdjustingP2
@ AdjustingP2
Definition: vtkBorderRepresentation.h:173
vtkBorderRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
vtkBorderRepresentation::AdjustingP1
@ AdjustingP1
Definition: vtkBorderRepresentation.h:172
vtkBorderRepresentation::SetShowBorderToOff
void SetShowBorderToOff()
Definition: vtkBorderRepresentation.h:96
vtkBorderRepresentation::GetShowBorderMaxValue
virtual int GetShowBorderMaxValue()
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkgl::border
GLint GLint GLsizei GLsizei GLsizei GLint border
Definition: vtkgl.h:11316
vtkGetVectorMacro
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:424
vtkBorderRepresentation::BWTransformFilter
vtkTransformPolyDataFilter * BWTransformFilter
Definition: vtkBorderRepresentation.h:240
vtkBorderRepresentation::SetShowBorderToActive
void SetShowBorderToActive()
Definition: vtkBorderRepresentation.h:98
vtkBorderRepresentation::~vtkBorderRepresentation
~vtkBorderRepresentation()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkBorderRepresentation::vtkBorderRepresentation
vtkBorderRepresentation()
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkBorderRepresentation::SetShowBorderToOn
void SetShowBorderToOn()
Definition: vtkBorderRepresentation.h:97
vtkBorderRepresentation::WidgetInteraction
virtual void WidgetInteraction(double eventPos[2])
vtkBorderRepresentation::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
vtkBorderRepresentation::BorderProperty
vtkProperty2D * BorderProperty
Definition: vtkBorderRepresentation.h:212
vtkBorderRepresentation::NegotiateLayout
virtual void NegotiateLayout()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkBorderRepresentation::GetSize
virtual void GetSize(double size[2])
Definition: vtkBorderRepresentation.h:189
vtkBorderRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkBorderRepresentation::GetShowBorderMinValue
virtual int GetShowBorderMinValue()
vtkBorderRepresentation::AdjustingE1
@ AdjustingE1
Definition: vtkBorderRepresentation.h:176
vtkBorderRepresentation::GetShowBorder
virtual int GetShowBorder()
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:70
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkBorderRepresentation::BWPolyData
vtkPolyData * BWPolyData
Definition: vtkBorderRepresentation.h:238
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:51
vtkBorderRepresentation::Moving
int Moving
Definition: vtkBorderRepresentation.h:215
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkBorderRepresentation::BWActor
vtkActor2D * BWActor
Definition: vtkBorderRepresentation.h:242
vtkBorderRepresentation::AdjustingE2
@ AdjustingE2
Definition: vtkBorderRepresentation.h:177
vtkCoordinate.h
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkBorderRepresentation::BORDER_ON
@ BORDER_ON
Definition: vtkBorderRepresentation.h:82
vtkBorderRepresentation::RenderOverlay
virtual int RenderOverlay(vtkViewport *)
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:40
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:45
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkBorderRepresentation::_InteractionState
_InteractionState
Definition: vtkBorderRepresentation.h:168
vtkBorderRepresentation::AdjustingE0
@ AdjustingE0
Definition: vtkBorderRepresentation.h:175
vtkBorderRepresentation::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkBorderRepresentation::Negotiated
int Negotiated
Definition: vtkBorderRepresentation.h:224
vtkBorderRepresentation::ShowHorizontalBorder
int ShowHorizontalBorder
Definition: vtkBorderRepresentation.h:211
vtkBorderRepresentation::BWMapper
vtkPolyDataMapper2D * BWMapper
Definition: vtkBorderRepresentation.h:241
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkBorderRepresentation::AdjustingP0
@ AdjustingP0
Definition: vtkBorderRepresentation.h:171
vtkBorderRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkgl::size
GLsizeiptr size
Definition: vtkgl.h:11843
vtkBorderRepresentation::BWPoints
vtkPoints * BWPoints
Definition: vtkBorderRepresentation.h:237