Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkSlicerAngleRepresentation3D.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 vtkSlicerAngleRepresentation3D_h
31 #define vtkSlicerAngleRepresentation3D_h
32 
33 #include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
35 
36 class vtkActor;
37 class vtkArcSource;
38 class vtkPolyDataMapper;
39 class vtkPolyData;
40 class vtkTubeFilter;
41 
43 
44 class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerAngleRepresentation3D : public vtkSlicerMarkupsWidgetRepresentation3D
45 {
46 public:
48  static vtkSlicerAngleRepresentation3D *New();
49 
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
57  void UpdateFromMRML(vtkMRMLNode* caller, unsigned long event, void *callData=nullptr) override;
58 
60  void GetActors(vtkPropCollection *) override;
61  void ReleaseGraphicsResources(vtkWindow *) override;
62  int RenderOverlay(vtkViewport *viewport) override;
63  int RenderOpaqueGeometry(vtkViewport *viewport) override;
64  int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override;
65  vtkTypeBool HasTranslucentPolygonalGeometry() override;
66 
68  double *GetBounds() override;
69 
70  bool GetTransformationReferencePoint(double referencePointWorld[3]) override;
71 
72  void CanInteract(vtkMRMLInteractionEventData* interactionEventData,
73  int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override;
74 
75 protected:
78 
79  vtkSmartPointer<vtkPolyData> Line;
80  vtkSmartPointer<vtkArcSource> Arc;
81  vtkSmartPointer<vtkTubeFilter> TubeFilter;
82  vtkSmartPointer<vtkTubeFilter> ArcTubeFilter;
83 
84  vtkSmartPointer<vtkPolyDataMapper> LineMapper;
85  vtkSmartPointer<vtkPolyDataMapper> ArcMapper;
86  vtkSmartPointer<vtkPolyDataMapper> LineOccludedMapper;
87  vtkSmartPointer<vtkPolyDataMapper> ArcOccludedMapper;
88 
89  vtkSmartPointer<vtkActor> LineActor;
90  vtkSmartPointer<vtkActor> ArcActor;
91  vtkSmartPointer<vtkActor> LineOccludedActor;
92  vtkSmartPointer<vtkActor> ArcOccludedActor;
93 
94  void BuildArc();
95 
96  // Update visibility of interaction handles for representation
97  void UpdateInteractionPipeline() override;
98 
99 private:
101  void operator=(const vtkSlicerAngleRepresentation3D&) = delete;
102 };
103 
104 #endif
int RenderOpaqueGeometry(vtkViewport *viewport) override
void PrintSelf(ostream &os, vtkIndent indent) override
vtkTypeBool HasTranslucentPolygonalGeometry() override
Default representation for the markups widget in 3D views.
Default representation for the angle widget.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
vtkSmartPointer< vtkArcSource > Arc
vtkSmartPointer< vtkPolyDataMapper > LineMapper
vtkSmartPointer< vtkTubeFilter > TubeFilter
void UpdateInteractionPipeline() override
Update the interaction pipeline.
vtkSmartPointer< vtkPolyDataMapper > LineOccludedMapper
vtkSmartPointer< vtkActor > ArcOccludedActor
void UpdateFromMRML(vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
double * GetBounds() override
Return the bounds of the representation.
int RenderOverlay(vtkViewport *viewport) override
virtual bool GetTransformationReferencePoint(double referencePointWorld[3])
Translation, rotation, scaling will happen around this position.
vtkSmartPointer< vtkPolyDataMapper > ArcOccludedMapper
void CanInteract(vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
vtkSmartPointer< vtkPolyDataMapper > ArcMapper
void ReleaseGraphicsResources(vtkWindow *) override
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
vtkSmartPointer< vtkActor > LineOccludedActor
vtkSmartPointer< vtkTubeFilter > ArcTubeFilter