VTK  9.0.20200604
vtkOrientedGlyphFocalPlaneContourRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOrientedGlyphFocalPlaneContourRepresentation.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 =========================================================================*/
31 #ifndef vtkOrientedGlyphFocalPlaneContourRepresentation_h
32 #define vtkOrientedGlyphFocalPlaneContourRepresentation_h
33 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
36 
37 class vtkProperty2D;
38 class vtkActor2D;
40 class vtkPolyData;
41 class vtkGlyph2D;
42 class vtkPoints;
43 class vtkPolyData;
44 
45 class VTKINTERACTIONWIDGETS_EXPORT vtkOrientedGlyphFocalPlaneContourRepresentation
47 {
48 public:
53 
55 
59  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
68  void SetCursorShape(vtkPolyData* cursorShape);
69  vtkPolyData* GetCursorShape();
71 
73 
78  void SetActiveCursorShape(vtkPolyData* activeShape);
79  vtkPolyData* GetActiveCursorShape();
81 
83 
87  vtkGetObjectMacro(Property, vtkProperty2D);
89 
91 
95  vtkGetObjectMacro(ActiveProperty, vtkProperty2D);
97 
99 
102  vtkGetObjectMacro(LinesProperty, vtkProperty2D);
104 
106 
111  void SetRenderer(vtkRenderer* ren) override;
112  void BuildRepresentation() override;
113  void StartWidgetInteraction(double eventPos[2]) override;
114  void WidgetInteraction(double eventPos[2]) override;
115  int ComputeInteractionState(int X, int Y, int modified = 0) override;
117 
119 
122  void GetActors2D(vtkPropCollection*) override;
123  void ReleaseGraphicsResources(vtkWindow*) override;
124  int RenderOverlay(vtkViewport* viewport) override;
125  int RenderOpaqueGeometry(vtkViewport* viewport) override;
126  int RenderTranslucentPolygonalGeometry(vtkViewport* viewport) override;
129 
134 
142  vtkMatrix4x4* GetContourPlaneDirectionCosines(const double origin[3]);
143 
144 protected:
147 
148  // Render the cursor
161 
162  // The polydata represents the contour in display co-ordinates.
166 
167  // The polydata represents the contour in world coordinates. It is updated
168  // (kept in sync with Lines) every time the GetContourRepresentationAsPolyData()
169  // method is called.
171 
172  // Support picking
173  double LastPickPosition[3];
174  double LastEventPosition[2];
175 
176  // Methods to manipulate the cursor
177  void Translate(double eventPos[2]);
178  void Scale(double eventPos[2]);
179  void ShiftContour(double eventPos[2]);
180  void ScaleContour(double eventPos[2]);
181 
182  void ComputeCentroid(double* ioCentroid);
183 
184  // Properties used to control the appearance of selected objects and
185  // the manipulator in general.
189 
191 
192  void CreateDefaultProperties();
193 
194  // Distance between where the mouse event happens and where the
195  // widget is focused - maintain this distance during interaction.
196  double InteractionOffset[2];
197 
198  void BuildLines() override;
199 
200 private:
203  void operator=(const vtkOrientedGlyphFocalPlaneContourRepresentation&) = delete;
204 };
205 
206 #endif
vtkContourRepresentation::StartWidgetInteraction
void StartWidgetInteraction(double e[2]) override=0
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkContourRepresentation::Translate
Definition: vtkContourRepresentation.h:366
vtkFocalPlaneContourRepresentation.h
vtkContourRepresentation::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *w) override=0
Methods required by vtkProp superclass.
vtkOrientedGlyphFocalPlaneContourRepresentation::CursorShape
vtkPolyData * CursorShape
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:155
vtkPolyDataMapper2D
draw vtkPolyData onto the image plane
Definition: vtkPolyDataMapper2D.h:44
vtkOrientedGlyphFocalPlaneContourRepresentation::Mapper
vtkPolyDataMapper2D * Mapper
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:150
vtkContourRepresentation::GetContourRepresentationAsPolyData
virtual vtkPolyData * GetContourRepresentationAsPolyData()=0
Get the points in this contour as a vtkPolyData.
vtkOrientedGlyphFocalPlaneContourRepresentation::Property
vtkProperty2D * Property
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:186
vtkOrientedGlyphFocalPlaneContourRepresentation::Lines
vtkPolyData * Lines
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:163
vtkFocalPlaneContourRepresentation
represent a contour drawn on the focal plane.
Definition: vtkFocalPlaneContourRepresentation.h:41
vtkOrientedGlyphFocalPlaneContourRepresentation::LinesWorldCoordinates
vtkPolyData * LinesWorldCoordinates
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:170
vtkContourRepresentation::RenderOverlay
int RenderOverlay(vtkViewport *viewport) override=0
vtkOrientedGlyphFocalPlaneContourRepresentation::LinesMapper
vtkPolyDataMapper2D * LinesMapper
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:164
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.
vtkOrientedGlyphFocalPlaneContourRepresentation::FocalPoint
vtkPoints * FocalPoint
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:158
vtkGlyph2D
copy oriented and scaled glyph geometry to every input point (2D specialization)
Definition: vtkGlyph2D.h:39
vtkOrientedGlyphFocalPlaneContourRepresentation::ActiveProperty
vtkProperty2D * ActiveProperty
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:187
vtkOrientedGlyphFocalPlaneContourRepresentation::ActiveMapper
vtkPolyDataMapper2D * ActiveMapper
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:153
vtkWidgetRepresentation::GetActors2D
void GetActors2D(vtkPropCollection *) override
Definition: vtkWidgetRepresentation.h:211
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkOrientedGlyphFocalPlaneContourRepresentation::LinesActor
vtkActor2D * LinesActor
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:165
vtkOrientedGlyphFocalPlaneContourRepresentation::LinesProperty
vtkProperty2D * LinesProperty
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:188
vtkOrientedGlyphFocalPlaneContourRepresentation::ActiveActor
vtkActor2D * ActiveActor
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:152
vtkContourRepresentation::HasTranslucentPolygonalGeometry
vtkTypeBool HasTranslucentPolygonalGeometry() override=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkContourRepresentation::WidgetInteraction
void WidgetInteraction(double e[2]) override=0
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkMatrix4x4
represent and manipulate 4x4 transformation matrices
Definition: vtkMatrix4x4.h:35
vtkContourRepresentation::Scale
Definition: vtkContourRepresentation.h:368
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkContourRepresentation::BuildLines
virtual void BuildLines()=0
vtkProperty2D
represent surface properties of a 2D image
Definition: vtkProperty2D.h:37
vtkOrientedGlyphFocalPlaneContourRepresentation
Contours constrained to a focal plane.
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:45
vtkActor2D
a actor that draws 2D data
Definition: vtkActor2D.h:39
vtkOrientedGlyphFocalPlaneContourRepresentation::ActiveFocalPoint
vtkPoints * ActiveFocalPoint
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:160
vtkOrientedGlyphFocalPlaneContourRepresentation::ActiveGlypher
vtkGlyph2D * ActiveGlypher
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:154
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:85
vtkOrientedGlyphFocalPlaneContourRepresentation::FocalData
vtkPolyData * FocalData
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:157
vtkOrientedGlyphFocalPlaneContourRepresentation::Glypher
vtkGlyph2D * Glypher
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:151
vtkOrientedGlyphFocalPlaneContourRepresentation::Actor
vtkActor2D * Actor
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:149
vtkContourRepresentation::ComputeInteractionState
int ComputeInteractionState(int X, int Y, int modified=0) override=0
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...
vtkOrientedGlyphFocalPlaneContourRepresentation::ActiveCursorShape
vtkPolyData * ActiveCursorShape
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:156
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkOrientedGlyphFocalPlaneContourRepresentation::ContourPlaneDirectionCosines
vtkMatrix4x4 * ContourPlaneDirectionCosines
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:190
vtkOrientedGlyphFocalPlaneContourRepresentation::ActiveFocalData
vtkPolyData * ActiveFocalData
Definition: vtkOrientedGlyphFocalPlaneContourRepresentation.h:159
vtkContourRepresentation::RenderTranslucentPolygonalGeometry
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override=0
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkFocalPlaneContourRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkContourRepresentation::BuildRepresentation
void BuildRepresentation() override=0
These are methods that satisfy vtkWidgetRepresentation's API.