Medical Imaging Interaction Toolkit  2026.06.00
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 mitkPlanarSubdivisionPolygon_h
14 #define mitkPlanarSubdivisionPolygon_h
15 
16 #include <mitkPlanarFigure.h>
17 #include <mitkPlanarPolygon.h>
19 
20 namespace mitk
21 {
22  class PlaneGeometry;
23 
38  {
39  public:
41 
42  itkFactorylessNewMacro(Self);
43 
44  itkCloneMacro(Self);
45 
47  unsigned int GetMinimumNumberOfControlPoints() const override
48  {
49  return 3;
50  }
51 
53  unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
54 
59  unsigned int GetSubdivisionRounds() const { return m_SubdivisionRounds; }
60 
68  void SetSubdivisionRounds(int subdivisionRounds) { m_SubdivisionRounds = subdivisionRounds; }
69 
77  int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override;
78 
88  float GetTensionParameter() const { return m_TensionParameter; }
89 
94  void SetTensionParameter(float tensionParameter) { m_TensionParameter = tensionParameter; }
95 
103  std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
104 
109 
115  bool Equals(const mitk::PlanarFigure &other) const override;
116 
117  protected:
119  PlanarSubdivisionPolygon(const Self& other);
120 
122 
124  void GeneratePolyLine() override;
125 
128 
129  private:
130  };
131 
132 } // namespace mitk
133 
134 #endif
#define MITKPLANARFIGURE_EXPORT
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Implementation of PlanarFigure representing a polygon.
Implementation of PlanarFigure representing a subdivision polygon (smooth curve).
int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override
Returns the control point index that corresponds to a given polyline point.
void SetTensionParameter(float tensionParameter)
Sets the tension parameter for the subdivision algorithm.
void DecreaseSubdivisions()
Decreases the number of subdivision rounds by one (minimum 1).
bool Equals(const mitk::PlanarFigure &other) const override
Compares this PlanarSubdivisionPolygon with another PlanarFigure for equality.
unsigned int GetMaximumNumberOfControlPoints() const override
Returns 1000 – control points are practically unlimited.
unsigned int GetMinimumNumberOfControlPoints() const override
Returns 3 – a subdivision polygon requires at least three control points.
unsigned int GetSubdivisionRounds() const
Returns the number of subdivision rounds applied during polyline generation.
void IncreaseSubdivisions()
Increases the number of subdivision rounds by one.
void SetSubdivisionRounds(int subdivisionRounds)
Sets the number of subdivision rounds.
std::vector< mitk::Point2D > CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const
Checks for intersections of a line segment with the subdivision polygon edges.
float GetTensionParameter() const
Returns the tension parameter for the subdivision algorithm.
void GeneratePolyLine() override
Generates the poly-line representation of the planar figure.
PlanarSubdivisionPolygon(const Self &other)
mitkClassMacro(PlanarSubdivisionPolygon, PlanarPolygon)
Find image slices visible on a given plane.