Medical Imaging Interaction Toolkit  2018.4.99-08619e4f
Medical Imaging Interaction Toolkit
mitkPlanarSubdivisionPolygon.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 _MITK_PLANAR_SUBDIVISION_POLYGON_H_
14 #define _MITK_PLANAR_SUBDIVISION_POLYGON_H_
15 
16 #include "mitkPlanarFigure.h"
17 #include "mitkPlanarPolygon.h"
19 
20 namespace mitk
21 {
22  class PlaneGeometry;
23 
29  {
30  public:
32 
33  itkFactorylessNewMacro(Self);
34 
35  itkCloneMacro(Self);
36 
38  unsigned int GetMinimumNumberOfControlPoints() const override
39  {
40  return 3;
41  }
42 
44  unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
46  unsigned int GetSubdivisionRounds() const { return m_SubdivisionRounds; }
47  void SetSubdivisionRounds(int subdivisionRounds) { m_SubdivisionRounds = subdivisionRounds; }
52  int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override;
53 
59  float GetTensionParameter() const { return m_TensionParameter; }
60  void SetTensionParameter(float tensionParameter) { m_TensionParameter = tensionParameter; }
61  std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
62 
63  void IncreaseSubdivisions();
64  void DecreaseSubdivisions();
65 
66  bool Equals(const mitk::PlanarFigure &other) const override;
67 
68  protected:
70 
72 
74  void GeneratePolyLine() override;
75 
78 
79  private:
80  };
81 
82 } // namespace mitk
83 
84 #endif //_MITK_PLANAR_SUBDIVISION_POLYGON_H_
unsigned int GetSubdivisionRounds() const
How many times should we generate a round of subdivisions?
Base of all data objects.
Definition: mitkBaseData.h:42
unsigned int GetMinimumNumberOfControlPoints() const override
Subdivision Polygon has 3 control points per definition.
DataCollection - Class to facilitate loading/accessing structured data.
Implementation of PlanarFigure representing a polygon with two or more control points.
Implementation of PlanarFigure representing a polygon with two or more control points.
unsigned int GetMaximumNumberOfControlPoints() const override
Polygon maximum number of control points is principally not limited.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
void SetSubdivisionRounds(int subdivisionRounds)
float GetTensionParameter() const
Parameter w_tension defines the tension. the higher w_tension, the lower the "tension" on points...
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:158
#define MITKPLANARFIGURE_EXPORT
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
void SetTensionParameter(float tensionParameter)