Medical Imaging Interaction Toolkit  2025.12.02
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 
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 
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
#define MITKPLANARFIGURE_EXPORT
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Implementation of PlanarFigure representing a polygon with two or more control points.
Implementation of PlanarFigure representing a polygon with two or more control points.
mitkClassMacro(PlanarSubdivisionPolygon, PlanarFigure)
int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override
Returns the id of the control-point that corresponds to the given polyline-point.
void SetTensionParameter(float tensionParameter)
bool Equals(const mitk::PlanarFigure &other) const override
Compare two PlanarFigure objects Note: all subclasses have to implement the method on their own.
unsigned int GetMaximumNumberOfControlPoints() const override
Polygon maximum number of control points is principally not limited.
unsigned int GetMinimumNumberOfControlPoints() const override
Subdivision Polygon has 3 control points per definition.
unsigned int GetSubdivisionRounds() const
How many times should we generate a round of subdivisions?
void SetSubdivisionRounds(int subdivisionRounds)
std::vector< mitk::Point2D > CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const
float GetTensionParameter() const
Parameter w_tension defines the tension. the higher w_tension, the lower the "tension" on points....
void GeneratePolyLine() override
Generates the poly-line representation of the planar figure.
Find image slices visible on a given plane.