Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
Loading...
Searching...
No Matches
vtkSlicerPlaneRepresentation3D.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
32#ifndef vtkSlicerPlaneRepresentation3D_h
33#define vtkSlicerPlaneRepresentation3D_h
34
35#include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
37
38class vtkActor;
39class vtkArrayCalculator;
40class vtkAppendPolyData;
41class vtkArrowSource;
42class vtkGlyph3DMapper;
43class vtkLookupTable;
45class vtkPlaneSource;
46class vtkPolyDataMapper;
47class vtkPolyData;
48class vtkTransformPolyDataFilter;
49class vtkTubeFilter;
50
51class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerPlaneRepresentation3D : public vtkSlicerMarkupsWidgetRepresentation3D
52{
53public:
56
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
64 void UpdateFromMRMLInternal(vtkMRMLNode* caller, unsigned long event, void *callData=nullptr) override;
65
67 void GetActors(vtkPropCollection *) override;
68 void ReleaseGraphicsResources(vtkWindow *) override;
69 int RenderOverlay(vtkViewport *viewport) override;
70 int RenderOpaqueGeometry(vtkViewport *viewport) override;
71 int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
72 vtkTypeBool HasTranslucentPolygonalGeometry() override;
73
75 double* GetBounds() VTK_SIZEHINT(6) override;
76
77 bool GetTransformationReferencePoint(double referencePointWorld[3]) override;
78
79 void CanInteract(vtkMRMLInteractionEventData* interactionEventData,
80 int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override;
81
82 void CanInteractWithPlane(vtkMRMLInteractionEventData* interactionEventData,
83 int& foundComponentType, int& foundComponentIndex, double& closestDistance2);
84
85protected:
88
89 vtkNew<vtkPlaneSource> PlaneFillFilter;
90 vtkNew<vtkArrowSource> ArrowFilter;
91 vtkNew<vtkGlyph3D> ArrowGlypher;
92 vtkNew<vtkPolyData> PlaneOutlineInputPolyData;
93 vtkNew<vtkTubeFilter> PlaneOutlineFilter;
94 vtkNew<vtkArrayCalculator> ArrowColorFilter;
95 vtkNew<vtkArrayCalculator> PlaneOutlineColorFilter;
96 vtkNew<vtkArrayCalculator> PlaneFillColorFilter;
97 vtkNew<vtkAppendPolyData> Append;
98
99 vtkNew<vtkActor> PlaneActor;
100 vtkNew<vtkActor> PlaneOccludedActor;
101
102 vtkNew<vtkPolyDataMapper> PlaneMapper;
103 vtkNew<vtkPolyDataMapper> PlaneOccludedMapper;
104
105 vtkNew<vtkLookupTable> PlaneColorLUT;
106
107 std::string LabelFormat;
108
109 // Setup the pipeline for plane display
110 void BuildPlane();
111
112private:
114 void operator=(const vtkSlicerPlaneRepresentation3D&) = delete;
115};
116
117#endif
Abstract Superclass for all specific types of MRML nodes.
Default representation for the markups widget in 3D views.
Default representation for the plane widget.
void PrintSelf(ostream &os, vtkIndent indent) override
void UpdateFromMRMLInternal(vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
static vtkSlicerPlaneRepresentation3D * New()
Instantiate this class.
int RenderOverlay(vtkViewport *viewport) override
void ReleaseGraphicsResources(vtkWindow *) override
double * GetBounds() VTK_SIZEHINT(6) override
Return the bounds of the representation.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
vtkTypeBool HasTranslucentPolygonalGeometry() override
int RenderOpaqueGeometry(vtkViewport *viewport) override
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.