Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkSlicerAngleRepresentation2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Copyright (c) ProxSim ltd., Kwun Tong, Hong Kong. All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8  Unless required by applicable law or agreed to in writing, software
9  distributed under the License is distributed on an "AS IS" BASIS,
10  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11  See the License for the specific language governing permissions and
12  limitations under the License.
13 
14  This file was originally developed by Davide Punzo, punzodavide@hotmail.it,
15  and development was supported by ProxSim ltd.
16 
17 =========================================================================*/
18 
30 #ifndef vtkSlicerAngleRepresentation2D_h
31 #define vtkSlicerAngleRepresentation2D_h
32 
33 #include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
35 
36 class vtkArcSource;
37 class vtkDiscretizableColorTransferFunction;
38 class vtkSampleImplicitFunctionFilter;
39 class vtkTubeFilter;
40 
42 
43 class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerAngleRepresentation2D : public vtkSlicerMarkupsWidgetRepresentation2D
44 {
45 public:
47  static vtkSlicerAngleRepresentation2D *New();
48 
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
56  void UpdateFromMRML(vtkMRMLNode* caller, unsigned long event, void *callData = nullptr) override;
57 
59  void GetActors(vtkPropCollection *) override;
60  void ReleaseGraphicsResources(vtkWindow *) override;
61  int RenderOverlay(vtkViewport *viewport) override;
62  int RenderOpaqueGeometry(vtkViewport *viewport) override;
63  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
64  vtkTypeBool HasTranslucentPolygonalGeometry() override;
65 
67  double *GetBounds() override;
68 
69  void CanInteract(vtkMRMLInteractionEventData* interactionEventData,
70  int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override;
71 
72  bool GetTransformationReferencePoint(double referencePointWorld[3]) override;
73 
74 protected:
77 
78  void SetMarkupsNode(vtkMRMLMarkupsNode *markupsNode) override;
79 
80  void BuildArc();
81 
82  // Update visibility of interaction handles for representation
83  void UpdateInteractionPipeline() override;
84 
85  vtkSmartPointer<vtkPolyData> Line;
86  vtkSmartPointer<vtkPolyDataMapper2D> LineMapper;
87  vtkSmartPointer<vtkActor2D> LineActor;
88  vtkSmartPointer<vtkArcSource> Arc;
89  vtkSmartPointer<vtkPolyDataMapper2D> ArcMapper;
90  vtkSmartPointer<vtkActor2D> ArcActor;
91  vtkSmartPointer<vtkDiscretizableColorTransferFunction> ColorMap;
92 
93  vtkSmartPointer<vtkTubeFilter> TubeFilter;
94  vtkSmartPointer<vtkTubeFilter> ArcTubeFilter;
95 
96  vtkSmartPointer<vtkTransformPolyDataFilter> LineWorldToSliceTransformer;
97  vtkSmartPointer<vtkTransformPolyDataFilter> ArcWorldToSliceTransformer;
98 
99  vtkSmartPointer<vtkSampleImplicitFunctionFilter> LineSliceDistance;
100  vtkSmartPointer<vtkSampleImplicitFunctionFilter> ArcSliceDistance;
101 
102 private:
104  void operator=(const vtkSlicerAngleRepresentation2D&) = delete;
105 };
106 
107 #endif
vtkSmartPointer< vtkSampleImplicitFunctionFilter > ArcSliceDistance
vtkSmartPointer< vtkArcSource > Arc
vtkSmartPointer< vtkActor2D > LineActor
vtkSmartPointer< vtkPolyDataMapper2D > ArcMapper
vtkTypeBool HasTranslucentPolygonalGeometry() override
vtkSmartPointer< vtkTubeFilter > ArcTubeFilter
virtual void SetMarkupsNode(vtkMRMLMarkupsNode *markupsNode)
vtkSmartPointer< vtkTubeFilter > TubeFilter
void UpdateInteractionPipeline() override
Update the interaction pipeline.
void UpdateFromMRML(vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
vtkSmartPointer< vtkTransformPolyDataFilter > ArcWorldToSliceTransformer
int RenderOpaqueGeometry(vtkViewport *viewport) override
vtkSmartPointer< vtkTransformPolyDataFilter > LineWorldToSliceTransformer
void PrintSelf(ostream &os, vtkIndent indent) override
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
vtkSmartPointer< vtkSampleImplicitFunctionFilter > LineSliceDistance
vtkSmartPointer< vtkDiscretizableColorTransferFunction > ColorMap
vtkSmartPointer< vtkPolyDataMapper2D > LineMapper
int RenderOverlay(vtkViewport *viewport) override
Default representation for the slicer markups widget.
Default representation for the line widget.
vtkSmartPointer< vtkActor2D > ArcActor
virtual bool GetTransformationReferencePoint(double referencePointWorld[3])
Translation, rotation, scaling will happen around this position.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void ReleaseGraphicsResources(vtkWindow *) override
void CanInteract(vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override
Position is displayed (slice) position.
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.