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) override;
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,vtkTypeBool);
145  vtkGetMacro(ProportionalResize,vtkTypeBool);
146  vtkBooleanMacro(ProportionalResize,vtkTypeBool);
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,vtkTypeBool);
186  vtkGetMacro(Moving,vtkTypeBool);
187  vtkBooleanMacro(Moving,vtkTypeBool);
189 
194  {
195  Outside=0,
204  AdjustingE3
205  };
206 
211  vtkMTimeType GetMTime() override;
212 
214 
218  void BuildRepresentation() override;
219  void StartWidgetInteraction(double eventPos[2]) override;
220  void WidgetInteraction(double eventPos[2]) override;
221  virtual void GetSize(double size[2])
222  {size[0]=1.0; size[1]=1.0;}
223  int ComputeInteractionState(int X, int Y, int modify=0) override;
225 
227 
233  int RenderOverlay(vtkViewport*) override;
238 
239 protected:
242 
243  // Ivars
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:
284  void operator=(const vtkBorderRepresentation&) = delete;
285 };
286 
287 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkWidgetRepresentation.h
vtkBorderRepresentation::Inside
@ Inside
Definition: vtkBorderRepresentation.h:196
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::SetShowBorder
virtual void SetShowBorder(int border)
Specify when and if the border should appear.
vtkBorderRepresentation::UpdateShowBorder
virtual void UpdateShowBorder()
vtkBorderRepresentation::WidgetInteraction
void WidgetInteraction(double eventPos[2]) override
vtkBorderRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkBorderRepresentation::New
static vtkBorderRepresentation * New()
Instantiate this class.
vtkBorderRepresentation::BWTransform
vtkTransform * BWTransform
Definition: vtkBorderRepresentation.h:273
vtkBorderRepresentation::Moving
vtkTypeBool Moving
Definition: vtkBorderRepresentation.h:249
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:61
vtkBorderRepresentation::Position2Coordinate
vtkCoordinate * Position2Coordinate
Definition: vtkBorderRepresentation.h:254
vtkBorderRepresentation::PositionCoordinate
vtkCoordinate * PositionCoordinate
Definition: vtkBorderRepresentation.h:253
vtkBorderRepresentation::AdjustingP2
@ AdjustingP2
Definition: vtkBorderRepresentation.h:199
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::BuildRepresentation
void BuildRepresentation() override
Subclasses should implement these methods.
vtkBorderRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkBorderRepresentation::SetShowBorderToActive
void SetShowBorderToActive()
Definition: vtkBorderRepresentation.h:108
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkBorderRepresentation::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modify=0) override
vtkBorderRepresentation::vtkBorderRepresentation
vtkBorderRepresentation()
vtkBorderRepresentation::GetActors2D
void GetActors2D(vtkPropCollection *) override
These methods are necessary to make this representation behave as a vtkProp.
vtkBorderRepresentation::SetShowBorderToOn
void SetShowBorderToOn()
Definition: vtkBorderRepresentation.h:107
vtkBorderRepresentation::BorderProperty
vtkProperty2D * BorderProperty
Definition: vtkBorderRepresentation.h:246
vtkBorderRepresentation::NegotiateLayout
virtual void NegotiateLayout()
vtkBorderRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
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::GetShowBorderMinValue
virtual int GetShowBorderMinValue()
vtkBorderRepresentation::AdjustingE1
@ AdjustingE1
Definition: vtkBorderRepresentation.h:202
vtkBorderRepresentation::GetShowBorder
virtual int GetShowBorder()
vtkCoordinate
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:82
vtkBorderRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
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
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
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:41
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:46
vtkBorderRepresentation::ProportionalResize
vtkTypeBool ProportionalResize
Definition: vtkBorderRepresentation.h:247
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::GetMTime
vtkMTimeType GetMTime() override
Return the MTime of this object.
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkBorderRepresentation::StartWidgetInteraction
void StartWidgetInteraction(double eventPos[2]) override
vtkBorderRepresentation::BORDER_ON
@ BORDER_ON
Definition: vtkBorderRepresentation.h:88
vtkBorderRepresentation::Negotiated
int Negotiated
Definition: vtkBorderRepresentation.h:258
vtkBorderRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *) override
vtkBorderRepresentation::ShowHorizontalBorder
int ShowHorizontalBorder
Definition: vtkBorderRepresentation.h:245
vtkBorderRepresentation::~vtkBorderRepresentation
~vtkBorderRepresentation() override
vtkBorderRepresentation::BWMapper
vtkPolyDataMapper2D * BWMapper
Definition: vtkBorderRepresentation.h:275
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:42
vtkBorderRepresentation::AdjustingP0
@ AdjustingP0
Definition: vtkBorderRepresentation.h:197
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkBorderRepresentation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
vtkBorderRepresentation::BWPoints
vtkPoints * BWPoints
Definition: vtkBorderRepresentation.h:271