Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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) itkCloneMacro(Self)
51 
52  mitk::ScalarType GetVolume() override;
53  bool IsInside(const Point3D &p) const override;
54  void UpdateOutputInformation() override;
55 
56  //##Documentation
57  //## @brief Contour to extrude
58  itkGetConstObjectMacro(Contour, mitk::Contour);
59  itkSetObjectMacro(Contour, mitk::Contour);
60 
61  //##Documentation
62  //## @brief Vector to specify the direction of the extrusion
65  itkGetConstMacro(AutomaticVectorGeneration, bool);
66  itkSetMacro(AutomaticVectorGeneration, bool);
67  itkBooleanMacro(AutomaticVectorGeneration);
68 
69  //##Documentation
70  //## @brief Optional vector to specify the orientation of the bounding-box
71  mitkGetVectorMacro(RightVector, mitk::Vector3D);
72  mitkSetVectorMacro(RightVector, mitk::Vector3D);
73 
74  //##Documentation
75  //## @brief Optional geometry for clipping the extruded contour
76  itkGetConstObjectMacro(ClippingGeometry, mitk::BaseGeometry);
77  itkSetObjectMacro(ClippingGeometry, mitk::BaseGeometry);
78 
79  unsigned long GetMTime() const override;
80 
81  protected:
83  ~ExtrudedContour() override;
84 
85  void BuildSurface();
86  void BuildGeometry();
87 
92 
94 
95  vtkPolygon *m_Polygon;
96 
97 #if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
98  double m_ProjectedContourBounds[6];
99 #else
100  float m_ProjectedContourBounds[6];
101 #endif
102 
104  //##Documentation
105  //## @brief For fast projection on plane
106  float m_Right[3];
107  float m_Down[3];
108 
109 #if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
110  double m_Normal[3];
111 #else
112  float m_Normal[3];
113 #endif
114  float m_Origin[3];
115 
116  vtkLinearExtrusionFilter *m_ExtrusionFilter;
117  vtkTriangleFilter *m_TriangleFilter;
118  vtkDecimatePro *m_Decimate;
119  vtkLinearSubdivisionFilter *m_SubdivisionFilter;
120  vtkPlanes *m_ClippingBox;
121  vtkClipPolyData *m_ClipPolyDataFilter;
122 
124  };
125 }
126 #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.