VTK  9.0.20201030
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 =========================================================================*/
28 #ifndef vtkOrientedGlyphContourRepresentation_h
29 #define vtkOrientedGlyphContourRepresentation_h
30 
32 #include "vtkInteractionWidgetsModule.h" // For export macro
33 
34 class vtkProperty;
35 class vtkActor;
36 class vtkPolyDataMapper;
37 class vtkPolyData;
38 class vtkGlyph3D;
39 class vtkPoints;
40 
41 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphContourRepresentation
43 {
44 public:
49 
51 
55  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
59 
64  void SetCursorShape(vtkPolyData* cursorShape);
65  vtkPolyData* GetCursorShape();
67 
69 
74  void SetActiveCursorShape(vtkPolyData* activeShape);
75  vtkPolyData* GetActiveCursorShape();
77 
79 
83  vtkGetObjectMacro(Property, vtkProperty);
85 
87 
91  vtkGetObjectMacro(ActiveProperty, vtkProperty);
93 
95 
98  vtkGetObjectMacro(LinesProperty, vtkProperty);
100 
102 
107  void SetRenderer(vtkRenderer* ren) override;
108  void BuildRepresentation() override;
109  void StartWidgetInteraction(double eventPos[2]) override;
110  void WidgetInteraction(double eventPos[2]) override;
111  int ComputeInteractionState(int X, int Y, int modified = 0) override;
113 
115 
118  void GetActors(vtkPropCollection*) override;
119  void ReleaseGraphicsResources(vtkWindow*) override;
120  int RenderOverlay(vtkViewport* viewport) override;
121  int RenderOpaqueGeometry(vtkViewport* viewport) override;
122  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
125 
130 
132 
138  vtkSetMacro(AlwaysOnTop, vtkTypeBool);
139  vtkGetMacro(AlwaysOnTop, vtkTypeBool);
140  vtkBooleanMacro(AlwaysOnTop, vtkTypeBool);
142 
147  void SetLineColor(double r, double g, double b);
148 
153  void SetShowSelectedNodes(vtkTypeBool) override;
154 
158  double* GetBounds() override;
159 
160 protected:
163 
164  // Render the cursor
177 
184  void CreateSelectedNodesRepresentation();
185 
189 
190  // Support picking
191  double LastPickPosition[3];
192  double LastEventPosition[2];
193 
194  // Methods to manipulate the cursor
195  void Translate(double eventPos[2]);
196  void Scale(double eventPos[2]);
197  void ShiftContour(double eventPos[2]);
198  void ScaleContour(double eventPos[2]);
199 
200  void ComputeCentroid(double* ioCentroid);
201 
202  // Properties used to control the appearance of selected objects and
203  // the manipulator in general.
207  void CreateDefaultProperties();
208 
209  // Distance between where the mouse event happens and where the
210  // widget is focused - maintain this distance during interaction.
211  double InteractionOffset[2];
212 
214 
215  void BuildLines() override;
216 
217 private:
219  void operator=(const vtkOrientedGlyphContourRepresentation&) = delete;
220 };
221 
222 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:36
vtkContourRepresentation::StartWidgetInteraction
void StartWidgetInteraction(double e[2]) override=0
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkOrientedGlyphContourRepresentation::ActiveProperty
vtkProperty * ActiveProperty
Definition: vtkOrientedGlyphContourRepresentation.h:205
vtkWidgetRepresentation::GetActors
void GetActors(vtkPropCollection *) override
For some exporters and other other operations we must be able to collect all the actors or volumes.
Definition: vtkWidgetRepresentation.h:210
vtkOrientedGlyphContourRepresentation::ActiveFocalPoint
vtkPoints * ActiveFocalPoint
Definition: vtkOrientedGlyphContourRepresentation.h:176
vtkContourRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *w) override=0
Methods required by vtkProp superclass.
vtkOrientedGlyphContourRepresentation::FocalData
vtkPolyData * FocalData
Definition: vtkOrientedGlyphContourRepresentation.h:173
vtkContourRepresentation::GetContourRepresentationAsPolyData
virtual vtkPolyData * GetContourRepresentationAsPolyData()=0
Get the points in this contour as a vtkPolyData.
vtkOrientedGlyphContourRepresentation::AlwaysOnTop
vtkTypeBool AlwaysOnTop
Definition: vtkOrientedGlyphContourRepresentation.h:213
vtkOrientedGlyphContourRepresentation::SelectedNodesData
vtkPolyData * SelectedNodesData
Definition: vtkOrientedGlyphContourRepresentation.h:178
vtkContourRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *viewport) override=0
vtkOrientedGlyphContourRepresentation::LinesProperty
vtkProperty * LinesProperty
Definition: vtkOrientedGlyphContourRepresentation.h:206
vtkWidgetRepresentation::SetRenderer
virtual void SetRenderer(vtkRenderer *ren)
Subclasses of vtkWidgetRepresentation must implement these methods.
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkOrientedGlyphContourRepresentation::Glypher
vtkGlyph3D * Glypher
Definition: vtkOrientedGlyphContourRepresentation.h:167
vtkContourRepresentation
represent the vtkContourWidget
Definition: vtkContourRepresentation.h:117
vtkOrientedGlyphContourRepresentation::ActiveFocalData
vtkPolyData * ActiveFocalData
Definition: vtkOrientedGlyphContourRepresentation.h:175
vtkOrientedGlyphContourRepresentation::SelectedNodesMapper
vtkPolyDataMapper * SelectedNodesMapper
Definition: vtkOrientedGlyphContourRepresentation.h:181
vtkContourRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
vtkOrientedGlyphContourRepresentation::SelectedNodesCursorShape
vtkPolyData * SelectedNodesCursorShape
Definition: vtkOrientedGlyphContourRepresentation.h:183
vtkWidgetRepresentation::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
Definition: vtkWidgetRepresentation.h:208
vtkOrientedGlyphContourRepresentation::Mapper
vtkPolyDataMapper * Mapper
Definition: vtkOrientedGlyphContourRepresentation.h:166
vtkOrientedGlyphContourRepresentation::LinesMapper
vtkPolyDataMapper * LinesMapper
Definition: vtkOrientedGlyphContourRepresentation.h:187
vtkContourRepresentation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkOrientedGlyphContourRepresentation::ActiveActor
vtkActor * ActiveActor
Definition: vtkOrientedGlyphContourRepresentation.h:168
vtkContourRepresentation::Translate
Definition: vtkContourRepresentation.h:366
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
vtkContourRepresentation::WidgetInteraction
void WidgetInteraction(double e[2]) override=0
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkContourRepresentation.h
vtkOrientedGlyphContourRepresentation::ActiveCursorShape
vtkPolyData * ActiveCursorShape
Definition: vtkOrientedGlyphContourRepresentation.h:172
vtkOrientedGlyphContourRepresentation::LinesActor
vtkActor * LinesActor
Definition: vtkOrientedGlyphContourRepresentation.h:188
vtkOrientedGlyphContourRepresentation
Default representation for the contour widget.
Definition: vtkOrientedGlyphContourRepresentation.h:41
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkContourRepresentation::BuildLines
virtual void BuildLines()=0
vtkOrientedGlyphContourRepresentation::Property
vtkProperty * Property
Definition: vtkOrientedGlyphContourRepresentation.h:204
vtkGlyph3D
copy oriented and scaled glyph geometry to every input point
Definition: vtkGlyph3D.h:106
vtkContourRepresentation::Scale
Definition: vtkContourRepresentation.h:368
vtkOrientedGlyphContourRepresentation::Lines
vtkPolyData * Lines
Definition: vtkOrientedGlyphContourRepresentation.h:186
vtkOrientedGlyphContourRepresentation::SelectedNodesPoints
vtkPoints * SelectedNodesPoints
Definition: vtkOrientedGlyphContourRepresentation.h:179
vtkOrientedGlyphContourRepresentation::ActiveMapper
vtkPolyDataMapper * ActiveMapper
Definition: vtkOrientedGlyphContourRepresentation.h:169
vtkOrientedGlyphContourRepresentation::ActiveGlypher
vtkGlyph3D * ActiveGlypher
Definition: vtkOrientedGlyphContourRepresentation.h:170
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkOrientedGlyphContourRepresentation::SelectedNodesActor
vtkActor * SelectedNodesActor
Definition: vtkOrientedGlyphContourRepresentation.h:180
vtkOrientedGlyphContourRepresentation::FocalPoint
vtkPoints * FocalPoint
Definition: vtkOrientedGlyphContourRepresentation.h:174
vtkContourRepresentation::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modified=0) override=0
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:61
vtkContourRepresentation::RenderOpaqueGeometry
int RenderOpaqueGeometry(vtkViewport *viewport) override=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkOrientedGlyphContourRepresentation::SelectedNodesGlypher
vtkGlyph3D * SelectedNodesGlypher
Definition: vtkOrientedGlyphContourRepresentation.h:182
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkContourRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override=0
vtkOrientedGlyphContourRepresentation::Actor
vtkActor * Actor
Definition: vtkOrientedGlyphContourRepresentation.h:165
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkContourRepresentation::SetShowSelectedNodes
virtual void SetShowSelectedNodes(vtkTypeBool)
A flag to indicate whether to show the Selected nodes Default is to set it to false.
vtkOrientedGlyphContourRepresentation::CursorShape
vtkPolyData * CursorShape
Definition: vtkOrientedGlyphContourRepresentation.h:171
vtkContourRepresentation::BuildRepresentation
void BuildRepresentation() override=0
These are methods that satisfy vtkWidgetRepresentation's API.