Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
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, int& foundComponentType, int& foundComponentIndex, double& closestDistance2) override;
77
78 void CanInteractWithPlane(vtkMRMLInteractionEventData* interactionEventData, int& foundComponentType, int& foundComponentIndex, double& closestDistance2);
79
80 bool GetTransformationReferencePoint(double referencePointWorld[3]) override;
81
82 void BuildPlane();
83
84protected:
87
88 virtual void UpdatePlaneFillColorMap(vtkDiscretizableColorTransferFunction* colormap, double color[3]);
89 virtual void UpdatePlaneOutlineColorMap(vtkDiscretizableColorTransferFunction* colormap, double color[3]);
90
91 vtkNew<vtkPlaneSource> PlaneFilter;
92 vtkNew<vtkPlaneCutter> PlaneCutter;
93
94 vtkNew<vtkClipPolyData> PlaneClipperSlicePlane;
95 vtkNew<vtkClipPolyData> PlaneClipperStartFadeNear;
96 vtkNew<vtkClipPolyData> PlaneClipperEndFadeNear;
97 vtkNew<vtkClipPolyData> PlaneClipperStartFadeFar;
98 vtkNew<vtkClipPolyData> PlaneClipperEndFadeFar;
99
100 vtkNew<vtkGeometryFilter> PlaneGeometryFilter;
101 vtkNew<vtkAppendPolyData> PlaneAppend;
102 vtkNew<vtkTransformPolyDataFilter> PlaneWorldToSliceTransformer;
103 vtkNew<vtkPolyDataMapper2D> PlaneFillMapper;
104 vtkNew<vtkActor2D> PlaneFillActor;
105
106 vtkNew<vtkFeatureEdges> PlaneOutlineFilter;
107 vtkNew<vtkDiscretizableColorTransferFunction> PlaneOutlineColorMap;
108 vtkNew<vtkTransformPolyDataFilter> PlaneOutlineWorldToSliceTransformer;
109 vtkNew<vtkPolyDataMapper2D> PlaneOutlineMapper;
110 vtkNew<vtkActor2D> PlaneOutlineActor;
111
112 vtkNew<vtkAppendPolyData> PlanePickingAppend;
113
114 vtkNew<vtkGlyphSource2D> ArrowFilter;
115 vtkNew<vtkGlyph2D> ArrowGlypher;
116 vtkNew<vtkPolyDataMapper2D> ArrowMapper;
117 vtkNew<vtkActor2D> ArrowActor;
118
119 vtkNew<vtkDiscretizableColorTransferFunction> PlaneFillColorMap;
120 vtkNew<vtkSampleImplicitFunctionFilter> PlaneSliceDistance;
121 std::string LabelFormat;
122
123private:
125 void operator=(const vtkSlicerPlaneRepresentation2D&) = delete;
126};
127
128#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.