Slicer 5.6
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
112
113 // Initialize interaction handle pipeline
114 void SetupInteractionPipeline() override;
115
116 // Update visibility of interaction handles for representation
117 void UpdateInteractionPipeline() override;
118
119 class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT MarkupsInteractionPipelinePlane : public MarkupsInteractionPipeline
120 {
121 public:
124
125 // Initialize scale handles
126 void CreateScaleHandles() override;
127
129
130 // Update scale handle positions
131 virtual void UpdateScaleHandles();
132
133 // Update scale handle visibilities
134 void UpdateHandleVisibility() override;
135
136 void GetHandleColor(int type, int index, double color[4]) override;
137 double GetHandleOpacity(int type, int index) override;
138
139 void GetInteractionHandleAxisWorld(int type, int index, double axis[3]) override;
140 };
142
143private:
145 void operator=(const vtkSlicerPlaneRepresentation3D&) = delete;
146};
147
148#endif
Abstract Superclass for all specific types of MRML nodes.
Default representation for the markups widget in 3D views.
std::vector< MarkupsInteractionPipeline::HandleInfo > HandleInfoList
Default representation for the plane widget.
double GetHandleOpacity(int type, int index) override
Get the opacity of the specified handle.
MarkupsInteractionPipelinePlane(vtkSlicerMarkupsWidgetRepresentation *representation)
void GetInteractionHandleAxisWorld(int type, int index, double axis[3]) override
Get the direction vector of the interaction handle from the interaction origin in world coordinates.
void GetHandleColor(int type, int index, double color[4]) override
HandleInfoList GetHandleInfoList() override
Get the list of info for all interaction handles.
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.