Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkSlicerCurveRepresentation3D.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 
31 #ifndef vtkSlicerCurveRepresentation3D_h
32 #define vtkSlicerCurveRepresentation3D_h
33 
34 #include "vtkSlicerMarkupsModuleVTKWidgetsExport.h"
36 
37 class vtkActor;
38 class vtkCellLocator;
39 class vtkPolyDataMapper;
40 class vtkPolyData;
41 class vtkTubeFilter;
42 
44 
45 class VTK_SLICER_MARKUPS_MODULE_VTKWIDGETS_EXPORT vtkSlicerCurveRepresentation3D : public vtkSlicerMarkupsWidgetRepresentation3D
46 {
47 public:
49  static vtkSlicerCurveRepresentation3D *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  void CanInteractWithCurve(vtkMRMLInteractionEventData* interactionEventData,
75  int &foundComponentType, int &componentIndex, double &closestDistance2);
76 
77 protected:
80 
81  void SetMarkupsNode(vtkMRMLMarkupsNode *markupsNode) override;
82 
83  vtkSmartPointer<vtkPolyData> Line;
84  vtkSmartPointer<vtkTubeFilter> TubeFilter;
85 
86  vtkSmartPointer<vtkPolyDataMapper> LineMapper;
87  vtkSmartPointer<vtkPolyDataMapper> LineOccludedMapper;
88 
89  vtkSmartPointer<vtkActor> LineActor;
90  vtkSmartPointer<vtkActor> LineOccludedActor;
91 
92  vtkSmartPointer<vtkCellLocator> CurvePointLocator;
93 
94  double PreviousSpecularLightingCoeff{0.0};
95 
96 private:
98  void operator=(const vtkSlicerCurveRepresentation3D&) = delete;
99 };
100 
101 #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.
int RenderTranslucentPolygonalGeometry(vtkViewport *viewport) override
virtual void SetMarkupsNode(vtkMRMLMarkupsNode *markupsNode)
vtkSmartPointer< vtkPolyDataMapper > LineMapper
vtkSmartPointer< vtkActor > LineOccludedActor
void UpdateFromMRML(vtkMRMLNode *caller, unsigned long event, void *callData=nullptr) override
vtkSmartPointer< vtkPolyDataMapper > LineOccludedMapper
double * GetBounds() override
Return the bounds of the representation.
int RenderOverlay(vtkViewport *viewport) override
void CanInteract(vtkMRMLInteractionEventData *interactionEventData, int &foundComponentType, int &foundComponentIndex, double &closestDistance2) override
Abstract Superclass for all specific types of MRML nodes.
Definition: vtkMRMLNode.h:167
void ReleaseGraphicsResources(vtkWindow *) override
vtkSmartPointer< vtkTubeFilter > TubeFilter
Default representation for the curve widget.
void GetActors(vtkPropCollection *) override
Methods to make this class behave as a vtkProp.
vtkSmartPointer< vtkCellLocator > CurvePointLocator