Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkSlicerPlaneRepresentation2D.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4 Queen's University, Kingston, ON, Canada. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 This file was originally developed by Kyle Sunderland, PerkLab, Queen's University
16 and was supported through CANARIE's Research Software Program, Cancer
17 Care Ontario, OpenAnatomy, and Brigham and Women's Hospital through NIH grant R01MH112748.
18
19==============================================================================*/
20
31
32#ifndef vtkSlicerPlaneRepresentation2D_h
33#define vtkSlicerPlaneRepresentation2D_h
34
35#include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
38#include "vtkGlyphSource2D.h"
39
40class vtkAppendPolyData;
41class vtkClipPolyData;
42class vtkDiscretizableColorTransferFunction;
43class vtkFeatureEdges;
44class vtkGeometryFilter;
46class vtkPlaneCutter;
47class vtkPlaneSource;
48class vtkSampleImplicitFunctionFilter;
49
50class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerPlaneRepresentation2D : public vtkSlicerMarkupsWidgetRepresentation2D
51{
52public:
55
58 void PrintSelf(ostream& os, vtkIndent indent) override;
59
63 void UpdateFromMRMLInternal(vtkMRMLNode* caller, unsigned long event, void *callData = nullptr) override;
64
66 void GetActors(vtkPropCollection *) override;
67 void ReleaseGraphicsResources(vtkWindow *) override;
68 int RenderOverlay(vtkViewport *viewport) override;
69 int RenderOpaqueGeometry(vtkViewport *viewport) override;
70 int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
71 vtkTypeBool HasTranslucentPolygonalGeometry() override;
72
74 double* GetBounds() VTK_SIZEHINT(6) override;
75
76 void CanInteract(vtkMRMLInteractionEventData* interactionEventData,
77 int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override;
78
80 int& foundComponentType, int& foundComponentIndex, double& closestDistance2);
81
82 bool GetTransformationReferencePoint(double referencePointWorld[3]) override;
83
84 void BuildPlane();
85
86protected:
89
90 virtual void UpdatePlaneFillColorMap(vtkDiscretizableColorTransferFunction* colormap, double color[3]);
91 virtual void UpdatePlaneOutlineColorMap(vtkDiscretizableColorTransferFunction* colormap, double color[3]);
92
93 vtkNew<vtkPlaneSource> PlaneFilter;
94 vtkNew<vtkPlaneCutter> PlaneCutter;
95
96 vtkNew<vtkClipPolyData> PlaneClipperSlicePlane;
97 vtkNew<vtkClipPolyData> PlaneClipperStartFadeNear;
98 vtkNew<vtkClipPolyData> PlaneClipperEndFadeNear;
99 vtkNew<vtkClipPolyData> PlaneClipperStartFadeFar;
100 vtkNew<vtkClipPolyData> PlaneClipperEndFadeFar;
101
102 vtkNew<vtkGeometryFilter> PlaneGeometryFilter;
103 vtkNew<vtkAppendPolyData> PlaneAppend;
104 vtkNew<vtkTransformPolyDataFilter> PlaneWorldToSliceTransformer;
105 vtkNew<vtkPolyDataMapper2D> PlaneFillMapper;
106 vtkNew<vtkActor2D> PlaneFillActor;
107
108 vtkNew<vtkFeatureEdges> PlaneOutlineFilter;
109 vtkNew<vtkDiscretizableColorTransferFunction> PlaneOutlineColorMap;
110 vtkNew<vtkTransformPolyDataFilter> PlaneOutlineWorldToSliceTransformer;
111 vtkNew<vtkPolyDataMapper2D> PlaneOutlineMapper;
112 vtkNew<vtkActor2D> PlaneOutlineActor;
113
114 vtkNew<vtkAppendPolyData> PlanePickingAppend;
115
116 vtkNew<vtkGlyphSource2D> ArrowFilter;
117 vtkNew<vtkGlyph2D> ArrowGlypher;
118 vtkNew<vtkPolyDataMapper2D> ArrowMapper;
119 vtkNew<vtkActor2D> ArrowActor;
120
121 vtkNew<vtkDiscretizableColorTransferFunction> PlaneFillColorMap;
122 vtkNew<vtkSampleImplicitFunctionFilter> PlaneSliceDistance;
123 std::string LabelFormat;
124
125private:
127 void operator=(const vtkSlicerPlaneRepresentation2D&) = delete;
128};
129
130#endif
Abstract Superclass for all specific types of MRML nodes.
vtkNew< vtkClipPolyData > PlaneClipperStartFadeFar
vtkNew< vtkDiscretizableColorTransferFunction > PlaneOutlineColorMap
static vtkSlicerPlaneRepresentation2D * New()
Instantiate this class.
vtkNew< vtkGeometryFilter > PlaneGeometryFilter
virtual void UpdatePlaneFillColorMap(vtkDiscretizableColorTransferFunction *colormap, double color[3])
double * GetBounds() VTK_SIZEHINT(6) override
Return the bounds of the representation.
vtkNew< vtkTransformPolyDataFilter > PlaneOutlineWorldToSliceTransformer
bool GetTransformationReferencePoint(double referencePointWorld[3]) override
Translation, rotation, scaling will happen around this position.
void UpdateFromMRMLInternal(vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
vtkNew< vtkDiscretizableColorTransferFunction > PlaneFillColorMap
vtkNew< vtkPolyDataMapper2D > PlaneFillMapper
virtual void UpdatePlaneOutlineColorMap(vtkDiscretizableColorTransferFunction *colormap, double color[3])
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
void ReleaseGraphicsResources(vtkWindow *) override
vtkNew< vtkPolyDataMapper2D > PlaneOutlineMapper
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
int RenderOverlay(vtkViewport *viewport) override
int RenderOpaqueGeometry(vtkViewport *viewport) override
void PrintSelf(ostream &os, vtkIndent indent) override
void CanInteractWithPlane(vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2)
vtkNew< vtkTransformPolyDataFilter > PlaneWorldToSliceTransformer
vtkTypeBool HasTranslucentPolygonalGeometry() override
vtkNew< vtkSampleImplicitFunctionFilter > PlaneSliceDistance
vtkNew< vtkClipPolyData > PlaneClipperEndFadeNear
vtkNew< vtkClipPolyData > PlaneClipperStartFadeNear
void CanInteract(vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override
Position is displayed (slice) position.