VTK  9.0.1
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:
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 
237  int RenderOverlay(vtkViewport*) override;
242 
243 protected:
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
a actor that draws 2D data
Definition: vtkActor2D.h:40
represent a vtkBorderWidget
virtual void GetSize(double size[2])
static vtkBorderRepresentation * New()
Instantiate this class.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
virtual int GetShowBorderMinValue()
vtkPolyDataMapper2D * BWMapper
_InteractionState
Define the various states that the representation can be in.
void WidgetInteraction(double eventPos[2]) override
void GetActors2D(vtkPropCollection *) override
These methods are necessary to make this representation behave as a vtkProp.
~vtkBorderRepresentation() override
vtkTransformPolyDataFilter * BWTransformFilter
virtual void NegotiateLayout()
vtkTypeBool HasTranslucentPolygonalGeometry() override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
int ComputeInteractionState(int X, int Y, int modify=0) override
virtual void SetShowBorder(int border)
Specify when and if the border should appear.
void StartWidgetInteraction(double eventPos[2]) override
int RenderOpaqueGeometry(vtkViewport *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
virtual int GetShowBorderMaxValue()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int RenderOverlay(vtkViewport *) override
void BuildRepresentation() override
Subclasses should implement these methods.
virtual int GetShowBorder()
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkMTimeType GetMTime() override
Return the MTime of this object.
virtual void UpdateShowBorder()
perform coordinate transformation, and represent position, in a variety of vtk coordinate systems
Definition: vtkCoordinate.h:77
a simple class to control print indentation
Definition: vtkIndent.h:34
represent and manipulate 3D points
Definition: vtkPoints.h:34
draw vtkPolyData onto the image plane
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
an ordered list of Props
represent surface properties of a 2D image
Definition: vtkProperty2D.h:38
transform points and associated normals and vectors for polygonal dataset
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:55
abstract specification for Viewports
Definition: vtkViewport.h:45
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
@ size
Definition: vtkX3D.h:259
int vtkTypeBool
Definition: vtkABI.h:69
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293