VTK  9.1.0
vtkOrientedGlyphContourRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOrientedGlyphContourRepresentation.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 =========================================================================*/
67 #ifndef vtkOrientedGlyphContourRepresentation_h
68 #define vtkOrientedGlyphContourRepresentation_h
69 
71 #include "vtkInteractionWidgetsModule.h" // For export macro
72 
73 class vtkProperty;
74 class vtkActor;
75 class vtkPolyDataMapper;
76 class vtkPolyData;
77 class vtkGlyph3D;
78 class vtkPoints;
79 
80 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
82 {
83 public:
88 
90 
94  void PrintSelf(ostream& os, vtkIndent indent) override;
96 
98 
103  void SetCursorShape(vtkPolyData* cursorShape);
106 
108 
113  void SetActiveCursorShape(vtkPolyData* activeShape);
116 
118 
122  vtkGetObjectMacro(Property, vtkProperty);
124 
126 
130  vtkGetObjectMacro(ActiveProperty, vtkProperty);
132 
134 
137  vtkGetObjectMacro(LinesProperty, vtkProperty);
139 
141 
146  void SetRenderer(vtkRenderer* ren) override;
147  void BuildRepresentation() override;
148  void StartWidgetInteraction(double eventPos[2]) override;
149  void WidgetInteraction(double eventPos[2]) override;
150  int ComputeInteractionState(int X, int Y, int modified = 0) override;
152 
154 
157  void GetActors(vtkPropCollection*) override;
159  int RenderOverlay(vtkViewport* viewport) override;
160  int RenderOpaqueGeometry(vtkViewport* viewport) override;
164 
169 
171 
177  vtkSetMacro(AlwaysOnTop, vtkTypeBool);
178  vtkGetMacro(AlwaysOnTop, vtkTypeBool);
179  vtkBooleanMacro(AlwaysOnTop, vtkTypeBool);
181 
186  void SetLineColor(double r, double g, double b);
187 
193 
197  double* GetBounds() override;
198 
199 protected:
202 
203  // Render the cursor
216 
224 
228 
229  // Support picking
230  double LastPickPosition[3];
231  double LastEventPosition[2];
232 
233  // Methods to manipulate the cursor
234  void Translate(double eventPos[2]);
235  void Scale(double eventPos[2]);
236  void ShiftContour(double eventPos[2]);
237  void ScaleContour(double eventPos[2]);
238 
239  void ComputeCentroid(double* ioCentroid);
240 
241  // Properties used to control the appearance of selected objects and
242  // the manipulator in general.
247 
248  // Distance between where the mouse event happens and where the
249  // widget is focused - maintain this distance during interaction.
250  double InteractionOffset[2];
251 
253 
254  void BuildLines() override;
255 
256 private:
258  void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
259 };
260 
261 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:146
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:143
vtkOrientedGlyphContourRepresentation::ActiveProperty
vtkProperty * ActiveProperty
Definition: vtkOrientedGlyphContourRepresentation.h:244
vtkOrientedGlyphContourRepresentation::New
static vtkOrientedGlyphContourRepresentation * New()
Instantiate this class.
vtkOrientedGlyphContourRepresentation::ActiveFocalPoint
vtkPoints * ActiveFocalPoint
Definition: vtkOrientedGlyphContourRepresentation.h:215
vtkOrientedGlyphContourRepresentation::FocalData
vtkPolyData * FocalData
Definition: vtkOrientedGlyphContourRepresentation.h:212
vtkOrientedGlyphContourRepresentation::SetLineColor
void SetLineColor(double r, double g, double b)
Convenience method to set the line color.
vtkOrientedGlyphContourRepresentation::AlwaysOnTop
vtkTypeBool AlwaysOnTop
Definition: vtkOrientedGlyphContourRepresentation.h:252
vtkOrientedGlyphContourRepresentation::SelectedNodesData
vtkPolyData * SelectedNodesData
Definition: vtkOrientedGlyphContourRepresentation.h:217
vtkOrientedGlyphContourRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
vtkOrientedGlyphContourRepresentation::LinesProperty
vtkProperty * LinesProperty
Definition: vtkOrientedGlyphContourRepresentation.h:245
vtkOrientedGlyphContourRepresentation::GetBounds
double * GetBounds() override
Return the bounds of the representation.
vtkOrientedGlyphContourRepresentation::GetCursorShape
vtkPolyData * GetCursorShape()
Specify the cursor shape.
vtkOrientedGlyphContourRepresentation::Glypher
vtkGlyph3D * Glypher
Definition: vtkOrientedGlyphContourRepresentation.h:206
vtkOrientedGlyphContourRepresentation::CreateDefaultProperties
void CreateDefaultProperties()
vtkContourRepresentation
represent the vtkContourWidget
Definition: vtkContourRepresentation.h:118
vtkOrientedGlyphContourRepresentation::ActiveFocalData
vtkPolyData * ActiveFocalData
Definition: vtkOrientedGlyphContourRepresentation.h:214
vtkOrientedGlyphContourRepresentation::GetActors
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
vtkOrientedGlyphContourRepresentation::BuildLines
void BuildLines() override
vtkOrientedGlyphContourRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
vtkOrientedGlyphContourRepresentation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods to make this class behave as a vtkProp.
vtkOrientedGlyphContourRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
vtkOrientedGlyphContourRepresentation::SelectedNodesMapper
vtkPolyDataMapper * SelectedNodesMapper
Definition: vtkOrientedGlyphContourRepresentation.h:220
vtkOrientedGlyphContourRepresentation::BuildRepresentation
void BuildRepresentation() override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
vtkOrientedGlyphContourRepresentation::CreateSelectedNodesRepresentation
void CreateSelectedNodesRepresentation()
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkOrientedGlyphContourRepresentation::SetShowSelectedNodes
void SetShowSelectedNodes(vtkTypeBool) override
A flag to indicate whether to show the Selected nodes Default is to set it to false.
vtkOrientedGlyphContourRepresentation::SetRenderer
void SetRenderer(vtkRenderer *ren) override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
vtkOrientedGlyphContourRepresentation::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modified=0) override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
vtkOrientedGlyphContourRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
Methods to make this class behave as a vtkProp.
vtkOrientedGlyphContourRepresentation::SelectedNodesCursorShape
vtkPolyData * SelectedNodesCursorShape
Definition: vtkOrientedGlyphContourRepresentation.h:222
vtkOrientedGlyphContourRepresentation::WidgetInteraction
void WidgetInteraction(double eventPos[2]) override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
vtkOrientedGlyphContourRepresentation::SetActiveCursorShape
void SetActiveCursorShape(vtkPolyData *activeShape)
Specify the shape of the cursor (handle) when it is active.
vtkOrientedGlyphContourRepresentation::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkOrientedGlyphContourRepresentation.h:205
vtkOrientedGlyphContourRepresentation::LinesMapper
vtkPolyDataMapper * LinesMapper
Definition: vtkOrientedGlyphContourRepresentation.h:226
vtkOrientedGlyphContourRepresentation::StartWidgetInteraction
void StartWidgetInteraction(double eventPos[2]) override
Subclasses of vtkOrientedGlyphContourRepresentation must implement these methods.
vtkOrientedGlyphContourRepresentation::ActiveActor
vtkActor * ActiveActor
Definition: vtkOrientedGlyphContourRepresentation.h:207
vtkOrientedGlyphContourRepresentation::ComputeCentroid
void ComputeCentroid(double *ioCentroid)
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:155
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkOrientedGlyphContourRepresentation::GetContourRepresentationAsPolyData
vtkPolyData * GetContourRepresentationAsPolyData() override
Get the points in this contour as a vtkPolyData.
vtkContourRepresentation.h
vtkOrientedGlyphContourRepresentation::Translate
void Translate(double eventPos[2])
vtkOrientedGlyphContourRepresentation::ActiveCursorShape
vtkPolyData * ActiveCursorShape
Definition: vtkOrientedGlyphContourRepresentation.h:211
vtkOrientedGlyphContourRepresentation::LinesActor
vtkActor * LinesActor
Definition: vtkOrientedGlyphContourRepresentation.h:227
vtkOrientedGlyphContourRepresentation
Default representation for the contour widget.
Definition: vtkOrientedGlyphContourRepresentation.h:82
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkOrientedGlyphContourRepresentation::Property
vtkProperty * Property
Definition: vtkOrientedGlyphContourRepresentation.h:243
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:216
vtkOrientedGlyphContourRepresentation::Lines
vtkPolyData * Lines
Definition: vtkOrientedGlyphContourRepresentation.h:225
vtkOrientedGlyphContourRepresentation::SelectedNodesPoints
vtkPoints * SelectedNodesPoints
Definition: vtkOrientedGlyphContourRepresentation.h:218
vtkOrientedGlyphContourRepresentation::ShiftContour
void ShiftContour(double eventPos[2])
vtkOrientedGlyphContourRepresentation::ActiveMapper
vtkPolyDataMapper * ActiveMapper
Definition: vtkOrientedGlyphContourRepresentation.h:208
vtkOrientedGlyphContourRepresentation::GetActiveCursorShape
vtkPolyData * GetActiveCursorShape()
Specify the shape of the cursor (handle) when it is active.
vtkOrientedGlyphContourRepresentation::ActiveGlypher
vtkGlyph3D * ActiveGlypher
Definition: vtkOrientedGlyphContourRepresentation.h:209
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkOrientedGlyphContourRepresentation::SetCursorShape
void SetCursorShape(vtkPolyData *cursorShape)
Specify the cursor shape.
vtkOrientedGlyphContourRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *viewport) override
Methods to make this class behave as a vtkProp.
vtkOrientedGlyphContourRepresentation::SelectedNodesActor
vtkActor * SelectedNodesActor
Definition: vtkOrientedGlyphContourRepresentation.h:219
vtkOrientedGlyphContourRepresentation::ScaleContour
void ScaleContour(double eventPos[2])
vtkOrientedGlyphContourRepresentation::FocalPoint
vtkPoints * FocalPoint
Definition: vtkOrientedGlyphContourRepresentation.h:213
vtkOrientedGlyphContourRepresentation::vtkOrientedGlyphContourRepresentation
vtkOrientedGlyphContourRepresentation()
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:171
vtkOrientedGlyphContourRepresentation::~vtkOrientedGlyphContourRepresentation
~vtkOrientedGlyphContourRepresentation() override
vtkOrientedGlyphContourRepresentation::SelectedNodesGlypher
vtkGlyph3D * SelectedNodesGlypher
Definition: vtkOrientedGlyphContourRepresentation.h:221
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:85
vtkOrientedGlyphContourRepresentation::Actor
vtkActor * Actor
Definition: vtkOrientedGlyphContourRepresentation.h:204
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkOrientedGlyphContourRepresentation::Scale
void Scale(double eventPos[2])
vtkOrientedGlyphContourRepresentation::CursorShape
vtkPolyData * CursorShape
Definition: vtkOrientedGlyphContourRepresentation.h:210