Slicer  5.3
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 #include "vtkLookupTable.h"
37 
38 class vtkArcSource;
39 class vtkDiscretizableColorTransferFunction;
40 class vtkSampleImplicitFunctionFilter;
41 class vtkTubeFilter;
42 
44 
45 class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerAngleRepresentation2D : public vtkSlicerMarkupsWidgetRepresentation2D
46 {
47 public:
49  static vtkSlicerAngleRepresentation2D *New();
50 
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
58  void UpdateFromMRML(vtkMRMLNode* caller, unsigned long event, void *callData = nullptr) override;
59 
61  void GetActors(vtkPropCollection *) override;
62  void ReleaseGraphicsResources(vtkWindow *) override;
63  int RenderOverlay(vtkViewport *viewport) override;
64  int RenderOpaqueGeometry(vtkViewport *viewport) override;
65  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
66  vtkTypeBool HasTranslucentPolygonalGeometry() override;
67 
69  double *GetBounds() override;
70 
71  void CanInteract(vtkMRMLInteractionEventData* interactionEventData,
72  int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override;
73 
74  bool GetTransformationReferencePoint(double referencePointWorld[3]) override;
75 
76 protected:
79 
80  void SetMarkupsNode(vtkMRMLMarkupsNode *markupsNode) override;
81 
82  void BuildArc();
83 
84  // Update visibility of interaction handles for representation
85  void UpdateInteractionPipeline() override;
86 
87  vtkSmartPointer<vtkPolyData> Line;
88  vtkSmartPointer<vtkPolyDataMapper2D> LineMapper;
89  vtkSmartPointer<vtkActor2D> LineActor;
90  vtkSmartPointer<vtkArcSource> Arc;
91  vtkSmartPointer<vtkPolyDataMapper2D> ArcMapper;
92  vtkSmartPointer<vtkActor2D> ArcActor;
93  vtkSmartPointer<vtkDiscretizableColorTransferFunction> ColorMap;
94 
95  vtkSmartPointer<vtkTubeFilter> TubeFilter;
96  vtkSmartPointer<vtkTubeFilter> ArcTubeFilter;
97 
98  vtkSmartPointer<vtkTransformPolyDataFilter> LineWorldToSliceTransformer;
99  vtkSmartPointer<vtkTransformPolyDataFilter> ArcWorldToSliceTransformer;
100 
101  vtkSmartPointer<vtkSampleImplicitFunctionFilter> LineSliceDistance;
102  vtkSmartPointer<vtkSampleImplicitFunctionFilter> ArcSliceDistance;
103 
104 private:
106  void operator=(const vtkSlicerAngleRepresentation2D&) = delete;
107 };
108 
109 #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.