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 =========================================================================*/
39 #ifndef vtkBorderRepresentation_h
40 #define vtkBorderRepresentation_h
41 
42 #include "vtkCoordinate.h" //Because of the viewport coordinate macro
43 #include "vtkInteractionWidgetsModule.h" // For export macro
45 
46 class vtkPoints;
47 class vtkPolyData;
48 class vtkTransform;
51 class vtkActor2D;
52 class vtkProperty2D;
53 
54 class VTKINTERACTIONWIDGETS_EXPORT vtkBorderRepresentation : public vtkWidgetRepresentation
55 {
56 public:
60  static vtkBorderRepresentation* New();
61 
63 
67  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
71 
80  vtkViewportCoordinateMacro(Position);
81  vtkViewportCoordinateMacro(Position2);
83 
84  enum
85  {
86  BORDER_OFF = 0,
88  BORDER_ACTIVE
89  };
90 
92 
103  virtual void SetShowBorder(int border);
104  virtual int GetShowBorderMinValue();
105  virtual int GetShowBorderMaxValue();
106  virtual int GetShowBorder();
107  void SetShowBorderToOff() { this->SetShowBorder(BORDER_OFF); }
108  void SetShowBorderToOn() { this->SetShowBorder(BORDER_ON); }
109  void SetShowBorderToActive() { this->SetShowBorder(BORDER_ACTIVE); }
111 
113 
117  vtkSetClampMacro(ShowVerticalBorder, int, BORDER_OFF, BORDER_ACTIVE);
118  vtkGetMacro(ShowVerticalBorder, int);
120 
122 
126  vtkSetClampMacro(ShowHorizontalBorder, int, BORDER_OFF, BORDER_ACTIVE);
127  vtkGetMacro(ShowHorizontalBorder, int);
129 
131 
134  vtkGetObjectMacro(BorderProperty, vtkProperty2D);
136 
138 
145  vtkSetMacro(ProportionalResize, vtkTypeBool);
146  vtkGetMacro(ProportionalResize, vtkTypeBool);
147  vtkBooleanMacro(ProportionalResize, vtkTypeBool);
149 
151 
156  vtkSetVector2Macro(MinimumSize, int);
157  vtkGetVector2Macro(MinimumSize, int);
158  vtkSetVector2Macro(MaximumSize, int);
159  vtkGetVector2Macro(MaximumSize, int);
161 
163 
168  vtkSetClampMacro(Tolerance, int, 1, 10);
169  vtkGetMacro(Tolerance, int);
171 
173 
177  vtkGetVectorMacro(SelectionPoint, double, 2);
179 
181 
186  vtkSetMacro(Moving, vtkTypeBool);
187  vtkGetMacro(Moving, vtkTypeBool);
188  vtkBooleanMacro(Moving, vtkTypeBool);
190 
195  {
196  Outside = 0,
205  AdjustingE3
206  };
207 
212  vtkMTimeType GetMTime() override;
213 
215 
219  void BuildRepresentation() override;
220  void StartWidgetInteraction(double eventPos[2]) override;
221  void WidgetInteraction(double eventPos[2]) override;
222  virtual void GetSize(double size[2])
223  {
224  size[0] = 1.0;
225  size[1] = 1.0;
226  }
227  int ComputeInteractionState(int X, int Y, int modify = 0) override;
229 
231 
235  void GetActors2D(vtkPropCollection*) override;
236  void ReleaseGraphicsResources(vtkWindow*) override;
237  int RenderOverlay(vtkViewport*) override;
238  int RenderOpaqueGeometry(vtkViewport*) override;
242 
243 protected:
245  ~vtkBorderRepresentation() override;
246 
247  // Ivars
254  double SelectionPoint[2];
255 
256  // Layout (position of lower left and upper right corners of border)
259 
260  // Sometimes subclasses must negotiate with their superclasses
261  // to achieve the correct layout.
263  virtual void NegotiateLayout();
264 
265  // Update the border visibility based on InteractionState.
266  // See Also: SetShowHorizontalBorder(), SetShowHorizontalBorder(),
267  // ComputeInteractionState()
268  virtual void UpdateShowBorder();
269 
270  // Keep track of start position when moving border
271  double StartPosition[2];
272 
273  // Border representation. Subclasses may use the BWTransform class
274  // to transform their geometry into the region surrounded by the border.
281 
282  // Constraints on size
283  int MinimumSize[2];
284  int MaximumSize[2];
285 
286 private:
288  void operator=(const vtkBorderRepresentation&) = delete;
289 };
290 
291 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkWidgetRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
Definition: vtkWidgetRepresentation.h:135
vtkWidgetRepresentation.h
vtkBorderRepresentation::Inside
Definition: vtkBorderRepresentation.h:197
vtkBorderRepresentation::Tolerance
int Tolerance
Definition: vtkBorderRepresentation.h:252
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:44
vtkBorderRepresentation::AdjustingP3
Definition: vtkBorderRepresentation.h:201
vtkBorderRepresentation
represent a vtkBorderWidget
Definition: vtkBorderRepresentation.h:54
vtkBorderRepresentation::BORDER_ON
Definition: vtkBorderRepresentation.h:87
vtkBorderRepresentation::ShowVerticalBorder
int ShowVerticalBorder
Definition: vtkBorderRepresentation.h:248
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkBorderRepresentation::BWTransform
vtkTransform * BWTransform
Definition: vtkBorderRepresentation.h:277
vtkBorderRepresentation::Moving
vtkTypeBool Moving
Definition: vtkBorderRepresentation.h:253
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:59
vtkBorderRepresentation::Position2Coordinate
vtkCoordinate * Position2Coordinate
Definition: vtkBorderRepresentation.h:258
vtkBorderRepresentation::PositionCoordinate
vtkCoordinate * PositionCoordinate
Definition: vtkBorderRepresentation.h:257
vtkBorderRepresentation::AdjustingP2
Definition: vtkBorderRepresentation.h:200
vtkBorderRepresentation::AdjustingP1
Definition: vtkBorderRepresentation.h:199
vtkBorderRepresentation::SetShowBorderToOff
void SetShowBorderToOff()
Definition: vtkBorderRepresentation.h:107
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkWidgetRepresentation::GetActors2D
void GetActors2D(vtkPropCollection *) override
Definition: vtkWidgetRepresentation.h:211
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:54
vtkBorderRepresentation::BWTransformFilter
vtkTransformPolyDataFilter * BWTransformFilter
Definition: vtkBorderRepresentation.h:278
vtkBorderRepresentation::SetShowBorderToActive
void SetShowBorderToActive()
Definition: vtkBorderRepresentation.h:109
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkWidgetRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:216
vtkWidgetRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkWidgetRepresentation.h:213
vtkBorderRepresentation::SetShowBorderToOn
void SetShowBorderToOn()
Definition: vtkBorderRepresentation.h:108
vtkWidgetRepresentation::WidgetInteraction
virtual void WidgetInteraction(double newEventPos[2])
Definition: vtkWidgetRepresentation.h:136
vtkBorderRepresentation::BorderProperty
vtkProperty2D * BorderProperty
Definition: vtkBorderRepresentation.h:250
vtkObject::GetMTime
virtual vtkMTimeType GetMTime()
Return this object's modified time.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkBorderRepresentation::GetSize
virtual void GetSize(double size[2])
Definition: vtkBorderRepresentation.h:222
vtkBorderRepresentation::AdjustingE1
Definition: vtkBorderRepresentation.h:203
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:76
vtkX3D::size
Definition: vtkX3D.h:259
vtkBorderRepresentation::BWPolyData
vtkPolyData * BWPolyData
Definition: vtkBorderRepresentation.h:276
vtkTransformPolyDataFilter
transform points and associated normals and vectors for polygonal dataset
Definition: vtkTransformPolyDataFilter.h:45
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkBorderRepresentation::BWActor
vtkActor2D * BWActor
Definition: vtkBorderRepresentation.h:280
vtkBorderRepresentation::AdjustingE2
Definition: vtkBorderRepresentation.h:204
vtkCoordinate.h
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkBorderRepresentation::ProportionalResize
vtkTypeBool ProportionalResize
Definition: vtkBorderRepresentation.h:251
vtkBorderRepresentation::_InteractionState
_InteractionState
Define the various states that the representation can be in.
Definition: vtkBorderRepresentation.h:194
vtkWidgetRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:214
vtkWidgetRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *vtkNotUsed(viewport)) override
Definition: vtkWidgetRepresentation.h:215
vtkBorderRepresentation::AdjustingE0
Definition: vtkBorderRepresentation.h:202
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkBorderRepresentation::Negotiated
int Negotiated
Definition: vtkBorderRepresentation.h:262
vtkBorderRepresentation::ShowHorizontalBorder
int ShowHorizontalBorder
Definition: vtkBorderRepresentation.h:249
vtkWidgetRepresentation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
Definition: vtkWidgetRepresentation.h:218
vtkBorderRepresentation::BWMapper
vtkPolyDataMapper2D * BWMapper
Definition: vtkBorderRepresentation.h:279
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkBorderRepresentation::AdjustingP0
Definition: vtkBorderRepresentation.h:198
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkWidgetRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:304
vtkWidgetRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBorderRepresentation::BWPoints
vtkPoints * BWPoints
Definition: vtkBorderRepresentation.h:275