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 
45 #include "vtkCoordinate.h" //Because of the viewport coordinate macro
46 
47 class vtkPoints;
48 class vtkPolyData;
49 class vtkTransform;
52 class vtkActor2D;
53 class vtkProperty2D;
54 
55 
57 {
58 public:
60  static vtkBorderRepresentation *New();
61 
63 
65  void PrintSelf(ostream& os, vtkIndent indent);
67 
69 
76  vtkViewportCoordinateMacro(Position);
77  vtkViewportCoordinateMacro(Position2);
79 
80 //BTX
81  enum {BORDER_OFF=0,BORDER_ON,BORDER_ACTIVE};
82 //ETX
84 
89  vtkSetClampMacro(ShowBorder,int,BORDER_OFF,BORDER_ACTIVE);
90  vtkGetMacro(ShowBorder,int);
91  void SetShowBorderToOff() {this->SetShowBorder(BORDER_OFF);}
92  void SetShowBorderToOn() {this->SetShowBorder(BORDER_ON);}
93  void SetShowBorderToActive() {this->SetShowBorder(BORDER_ACTIVE);}
95 
97 
98  vtkGetObjectMacro(BorderProperty,vtkProperty2D);
100 
102 
107  vtkSetMacro(ProportionalResize,int);
108  vtkGetMacro(ProportionalResize,int);
109  vtkBooleanMacro(ProportionalResize,int);
111 
113 
116  vtkSetVector2Macro(MinimumSize,int);
117  vtkGetVector2Macro(MinimumSize,int);
118  vtkSetVector2Macro(MaximumSize,int);
119  vtkGetVector2Macro(MaximumSize,int);
121 
123 
126  vtkSetClampMacro(Tolerance,int,1,10);
127  vtkGetMacro(Tolerance,int);
129 
131 
133  vtkGetVectorMacro(SelectionPoint,double,2);
135 
137 
140  vtkSetMacro(Moving,int);
141  vtkGetMacro(Moving,int);
142  vtkBooleanMacro(Moving,int);
144 
145 //BTX
147 
149  {
150  Outside=0,
159  AdjustingE3
160  };
161 //ETX
163 
165 
167  virtual void BuildRepresentation();
168  virtual void StartWidgetInteraction(double eventPos[2]);
169  virtual void WidgetInteraction(double eventPos[2]);
170  virtual void GetSize(double size[2])
171  {size[0]=1.0; size[1]=1.0;}
172  virtual int ComputeInteractionState(int X, int Y, int modify=0);
174 
176 
178  virtual void GetActors2D(vtkPropCollection*);
179  virtual void ReleaseGraphicsResources(vtkWindow*);
180  virtual int RenderOverlay(vtkViewport*);
181  virtual int RenderOpaqueGeometry(vtkViewport*);
183  virtual int HasTranslucentPolygonalGeometry();
185 
186 protected:
189 
190  // Ivars
195  int Moving;
196  double SelectionPoint[2];
197 
198  // Layout (position of lower left and upper right corners of border)
201 
202  // Sometimes subclasses must negotiate with their superclasses
203  // to achieve the correct layout.
205  virtual void NegotiateLayout();
206 
207  // Keep track of start position when moving border
208  double StartPosition[2];
209 
210  // Border representation. Subclasses may use the BWTransform class
211  // to transform their geometry into the region surrounded by the border.
218 
219  // Constraints on size
220  int MinimumSize[2];
221  int MaximumSize[2];
222 
223 private:
224  vtkBorderRepresentation(const vtkBorderRepresentation&); //Not implemented
225  void operator=(const vtkBorderRepresentation&); //Not implemented
226 };
227 
228 #endif