Slicer  5.3
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkSlicerCurveRepresentation2D.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 vtkSlicerCurveRepresentation2D_h
31 #define vtkSlicerCurveRepresentation2D_h
32 
33 #include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
35 
36 class vtkCellLocator;
37 class vtkDiscretizableColorTransferFunction;
38 class vtkSampleImplicitFunctionFilter;
39 class vtkTubeFilter;
40 
42 
43 class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerCurveRepresentation2D : public vtkSlicerMarkupsWidgetRepresentation2D
44 {
45 public:
47  static vtkSlicerCurveRepresentation2D *New();
48 
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
56  void UpdateFromMRML(vtkMRMLNode* caller, unsigned long event, void *callData = nullptr) override;
57  void CanInteract(vtkMRMLInteractionEventData* interactionEventData,
58  int &foundComponentType, int &foundComponentIndex, double &closestDistance2) 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 CanInteractWithCurve(vtkMRMLInteractionEventData* interactionEventData,
72  int &foundComponentType, int &componentIndex, double &closestDistance2);
73 
74 protected:
77 
78  void SetMarkupsNode(vtkMRMLMarkupsNode *markupsNode) override;
79 
80  void UpdateLineColorMap();
81 
82  vtkSmartPointer<vtkPolyData> Line;
83  vtkSmartPointer<vtkPolyDataMapper2D> LineMapper;
84  vtkSmartPointer<vtkActor2D> LineActor;
85  vtkSmartPointer<vtkDiscretizableColorTransferFunction> LineColorMap;
86 
87  vtkSmartPointer<vtkTubeFilter> TubeFilter;
88 
89  vtkSmartPointer<vtkTransformPolyDataFilter> WorldToSliceTransformer;
90  vtkSmartPointer<vtkCellLocator> SliceCurvePointLocator;
91 
92  vtkSmartPointer<vtkSampleImplicitFunctionFilter> SliceDistance;
93 
94 private:
96  void operator=(const vtkSlicerCurveRepresentation2D&) = delete;
97 };
98 
99 #endif
vtkSmartPointer< vtkSampleImplicitFunctionFilter > SliceDistance
vtkSmartPointer< vtkTransformPolyDataFilter > WorldToSliceTransformer
vtkTypeBool HasTranslucentPolygonalGeometry() override
virtual void SetMarkupsNode(vtkMRMLMarkupsNode *markupsNode)
vtkSmartPointer< vtkActor2D > LineActor
vtkSmartPointer< vtkPolyDataMapper2D > LineMapper
void UpdateFromMRML(vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
int RenderOpaqueGeometry(vtkViewport *viewport) override
void PrintSelf(ostream &os, vtkIndent indent) override
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
Default representation for the line widget.
vtkSmartPointer< vtkTubeFilter > TubeFilter
int RenderOverlay(vtkViewport *viewport) override
Default representation for the slicer markups widget.
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void ReleaseGraphicsResources(vtkWindow *) override
vtkSmartPointer< vtkDiscretizableColorTransferFunction > LineColorMap
vtkSmartPointer< vtkCellLocator > SliceCurvePointLocator
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.