Medical Imaging Interaction Toolkit  2018.4.99-1bab67a2
Medical Imaging Interaction Toolkit
mitkExtrudedContour.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED
14 #define MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED
15 
16 #include "mitkBoundingObject.h"
18 #include <mitkContour.h>
19 #include <mitkPlaneGeometry.h>
20 #include <vtkConfigure.h>
21 #include <vtkVersionMacros.h>
22 
23 class vtkLinearExtrusionFilter;
24 class vtkPlanes;
25 class vtkClipPolyData;
26 class vtkLinearSubdivisionFilter;
27 class vtkTriangleFilter;
28 class vtkDecimatePro;
29 class vtkPolygon;
30 
31 namespace mitk
32 {
33  //##Documentation
34  //## @brief Data class containing a bounding-object created by
35  //## extruding a Contour along a vector
36  //##
37  //## The m_Contour is extruded in the direction m_Vector until
38  //## reaching m_ClippingGeometry.
39  //## @ingroup Data
40 
47  {
48  public:
50  itkFactorylessNewMacro(Self);
51  itkCloneMacro(Self);
52 
53  mitk::ScalarType GetVolume() override;
54  bool IsInside(const Point3D &p) const override;
55  void UpdateOutputInformation() override;
56 
57  //##Documentation
58  //## @brief Contour to extrude
59  itkGetConstObjectMacro(Contour, mitk::Contour);
60  itkSetObjectMacro(Contour, mitk::Contour);
61 
62  //##Documentation
63  //## @brief Vector to specify the direction of the extrusion
66  itkGetConstMacro(AutomaticVectorGeneration, bool);
67  itkSetMacro(AutomaticVectorGeneration, bool);
68  itkBooleanMacro(AutomaticVectorGeneration);
69 
70  //##Documentation
71  //## @brief Optional vector to specify the orientation of the bounding-box
72  mitkGetVectorMacro(RightVector, mitk::Vector3D);
73  mitkSetVectorMacro(RightVector, mitk::Vector3D);
74 
75  //##Documentation
76  //## @brief Optional geometry for clipping the extruded contour
77  itkGetConstObjectMacro(ClippingGeometry, mitk::BaseGeometry);
78  itkSetObjectMacro(ClippingGeometry, mitk::BaseGeometry);
79 
80  unsigned long GetMTime() const override;
81 
82  protected:
84  ~ExtrudedContour() override;
85 
86  void BuildSurface();
87  void BuildGeometry();
88 
93 
95 
96  vtkPolygon *m_Polygon;
97 
98 #if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
99  double m_ProjectedContourBounds[6];
100 #else
101  float m_ProjectedContourBounds[6];
102 #endif
103 
105  //##Documentation
106  //## @brief For fast projection on plane
107  float m_Right[3];
108  float m_Down[3];
109 
110 #if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
111  double m_Normal[3];
112 #else
113  float m_Normal[3];
114 #endif
115  float m_Origin[3];
116 
117  vtkLinearExtrusionFilter *m_ExtrusionFilter;
118  vtkTriangleFilter *m_TriangleFilter;
119  vtkDecimatePro *m_Decimate;
120  vtkLinearSubdivisionFilter *m_SubdivisionFilter;
121  vtkPlanes *m_ClippingBox;
122  vtkClipPolyData *m_ClipPolyDataFilter;
123 
125  };
126 }
127 #endif /* MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED */
vtkDecimatePro * m_Decimate
Data class containing a bounding-object created by extruding a Contour along a vector.
Base of all data objects.
Definition: mitkBaseData.h:37
double ScalarType
vtkLinearSubdivisionFilter * m_SubdivisionFilter
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
vtkLinearExtrusionFilter * m_ExtrusionFilter
mitk::PlaneGeometry::Pointer m_ProjectionPlane
#define mitkSetVectorMacro(name, type)
Stores vertices for drawing a contour.
Definition: mitkContour.h:31
superclass of all bounding objects (cylinder, cuboid,...)
mitk::Vector3D m_RightVector
mitk::BaseGeometry::Pointer m_ClippingGeometry
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
#define mitkGetVectorMacro(name, type)
vtkClipPolyData * m_ClipPolyDataFilter
mitk::Contour::Pointer m_Contour
itk::TimeStamp m_LastCalculateExtrusionTime
vtkTriangleFilter * m_TriangleFilter
BaseGeometry Describes the geometry of a data object.