Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPlanarBezierCurve.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 mitkPlanarBezierCurve_h
14 #define mitkPlanarBezierCurve_h
15 
17 #include <mitkPlanarFigure.h>
18 
19 namespace mitk
20 {
37  {
38  public:
40  itkFactorylessNewMacro(Self);
41  itkCloneMacro(Self);
42 
47  unsigned int GetNumberOfSegments() const;
48 
56  void SetNumberOfSegments(unsigned int numSegments);
57 
65  int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override;
66 
71  unsigned int GetMaximumNumberOfControlPoints() const override;
72 
77  unsigned int GetMinimumNumberOfControlPoints() const override;
78 
88  bool IsHelperToBePainted(unsigned int index) const override;
89 
91  const unsigned int FEATURE_ID_LENGTH;
92 
98  bool Equals(const mitk::PlanarFigure &other) const override;
99 
100  protected:
102  PlanarBezierCurve(const Self& other);
103 
105 
106  void EvaluateFeaturesInternal() override;
107  void GenerateHelperPolyLine(double, unsigned int) override;
108  void GeneratePolyLine() override;
109 
110  private:
111  Point2D ComputeDeCasteljauPoint(ScalarType t);
112 
113  std::vector<mitk::Point2D> m_DeCasteljauPoints;
114  unsigned int m_NumberOfSegments;
115  };
116 }
117 
118 #endif
#define MITKPLANARFIGURE_EXPORT
Implementation of PlanarFigure representing a Bezier curve.
void SetNumberOfSegments(unsigned int numSegments)
Sets the number of line segments used to approximate the curve.
void EvaluateFeaturesInternal() override
Calculates quantities of all features of this planar figure. Must be implemented in sub-classes.
void GenerateHelperPolyLine(double, unsigned int) override
Generates the poly-lines that should be drawn the same size regardless of zoom. Must be implemented i...
unsigned int GetMaximumNumberOfControlPoints() const override
Returns the maximum number of control points (32).
int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override
Returns the control point index that corresponds to a given polyline point.
unsigned int GetMinimumNumberOfControlPoints() const override
Returns the minimum number of control points (2).
const unsigned int FEATURE_ID_LENGTH
Feature identifier for the curve length.
bool Equals(const mitk::PlanarFigure &other) const override
Compares this PlanarBezierCurve with another PlanarFigure for equality.
mitkClassMacro(PlanarBezierCurve, PlanarFigure)
PlanarBezierCurve(const Self &other)
unsigned int GetNumberOfSegments() const
Returns the number of line segments used to approximate the curve.
bool IsHelperToBePainted(unsigned int index) const override
Returns whether the helper polyline at the given index should be painted.
void GeneratePolyLine() override
Generates the poly-line representation of the planar figure. Must be implemented in sub-classes.
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Find image slices visible on a given plane.
double ScalarType
Scalar type used throughout MITK for geometric computations.