VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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;
52 class vtkPolyDataMapper2D;
53 class vtkActor2D;
54 class vtkProperty2D;
55 
56 
57 class VTKINTERACTIONWIDGETS_EXPORT vtkBorderRepresentation : public vtkWidgetRepresentation
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 
90  vtkSetClampMacro(ShowBorder,int,BORDER_OFF,BORDER_ACTIVE);
91  vtkGetMacro(ShowBorder,int);
92  void SetShowBorderToOff() {this->SetShowBorder(BORDER_OFF);}
93  void SetShowBorderToOn() {this->SetShowBorder(BORDER_ON);}
94  void SetShowBorderToActive() {this->SetShowBorder(BORDER_ACTIVE);}
96 
98 
99  vtkGetObjectMacro(BorderProperty,vtkProperty2D);
101 
103 
108  vtkSetMacro(ProportionalResize,int);
109  vtkGetMacro(ProportionalResize,int);
110  vtkBooleanMacro(ProportionalResize,int);
112 
114 
117  vtkSetVector2Macro(MinimumSize,int);
118  vtkGetVector2Macro(MinimumSize,int);
119  vtkSetVector2Macro(MaximumSize,int);
120  vtkGetVector2Macro(MaximumSize,int);
122 
124 
127  vtkSetClampMacro(Tolerance,int,1,10);
128  vtkGetMacro(Tolerance,int);
130 
132 
134  vtkGetVectorMacro(SelectionPoint,double,2);
136 
138 
141  vtkSetMacro(Moving,int);
142  vtkGetMacro(Moving,int);
143  vtkBooleanMacro(Moving,int);
145 
146 //BTX
148 
150  {
151  Outside=0,
160  AdjustingE3
161  };
162 //ETX
164 
166 
168  virtual void BuildRepresentation();
169  virtual void StartWidgetInteraction(double eventPos[2]);
170  virtual void WidgetInteraction(double eventPos[2]);
171  virtual void GetSize(double size[2])
172  {size[0]=1.0; size[1]=1.0;}
173  virtual int ComputeInteractionState(int X, int Y, int modify=0);
175 
177 
179  virtual void GetActors2D(vtkPropCollection*);
180  virtual void ReleaseGraphicsResources(vtkWindow*);
181  virtual int RenderOverlay(vtkViewport*);
182  virtual int RenderOpaqueGeometry(vtkViewport*);
183  virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
184  virtual int HasTranslucentPolygonalGeometry();
186 
187 protected:
190 
191  // Ivars
193  vtkProperty2D *BorderProperty;
196  int Moving;
197  double SelectionPoint[2];
198 
199  // Layout (position of lower left and upper right corners of border)
200  vtkCoordinate *PositionCoordinate;
201  vtkCoordinate *Position2Coordinate;
202 
203  // Sometimes subclasses must negotiate with their superclasses
204  // to achieve the correct layout.
206  virtual void NegotiateLayout();
207 
208  // Keep track of start position when moving border
209  double StartPosition[2];
210 
211  // Border representation. Subclasses may use the BWTransform class
212  // to transform their geometry into the region surrounded by the border.
213  vtkPoints *BWPoints;
217  vtkPolyDataMapper2D *BWMapper;
218  vtkActor2D *BWActor;
219 
220  // Constraints on size
221  int MinimumSize[2];
222  int MaximumSize[2];
223 
224 private:
225  vtkBorderRepresentation(const vtkBorderRepresentation&); //Not implemented
226  void operator=(const vtkBorderRepresentation&); //Not implemented
227 };
228 
229 #endif
virtual int RenderOverlay(vtkViewport *vtkNotUsed(viewport))
virtual int ComputeInteractionState(int X, int Y, int modify=0)
virtual void StartWidgetInteraction(double eventPos[2])
vtkTransformPolyDataFilter * BWTransformFilter
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:82
virtual void ReleaseGraphicsResources(vtkWindow *)
abstract class defines interface between the widget and widget representation classes ...
virtual void BuildRepresentation()=0
virtual void GetSize(double size[2])
virtual int HasTranslucentPolygonalGeometry()
virtual void WidgetInteraction(double newEventPos[2])
represent a vtkBorderWidget
virtual int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport))
virtual void GetActors2D(vtkPropCollection *)
vtkPolyDataMapper2D * BWMapper
void PrintSelf(ostream &os, vtkIndent indent)
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport))