Medical Imaging Interaction Toolkit  2025.12.02
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 {
22  {
23  public:
25  itkFactorylessNewMacro(Self);
26  itkCloneMacro(Self);
27 
28  unsigned int GetNumberOfSegments() const;
29  void SetNumberOfSegments(unsigned int numSegments);
30 
35  int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override;
36 
37  unsigned int GetMaximumNumberOfControlPoints() const override;
38  unsigned int GetMinimumNumberOfControlPoints() const override;
39  bool IsHelperToBePainted(unsigned int index) const override;
40 
41  const unsigned int FEATURE_ID_LENGTH;
42 
43  bool Equals(const mitk::PlanarFigure &other) const override;
44 
45  protected:
47 
49 
50  void EvaluateFeaturesInternal() override;
51  void GenerateHelperPolyLine(double, unsigned int) override;
52  void GeneratePolyLine() override;
53 
54  private:
55  Point2D ComputeDeCasteljauPoint(ScalarType t);
56 
57  std::vector<mitk::Point2D> m_DeCasteljauPoints;
58  unsigned int m_NumberOfSegments;
59  };
60 }
61 
62 #endif
#define MITKPLANARFIGURE_EXPORT
void SetNumberOfSegments(unsigned int numSegments)
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 allowed for this figure (e.g. 3 for triangles).
int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override
Returns the id of the control-point that corresponds to the given polyline-point.
unsigned int GetMinimumNumberOfControlPoints() const override
Returns the minimum number of control points needed to represent this figure.
const unsigned int FEATURE_ID_LENGTH
bool Equals(const mitk::PlanarFigure &other) const override
Compare two PlanarFigure objects Note: all subclasses have to implement the method on their own.
mitkClassMacro(PlanarBezierCurve, PlanarFigure)
unsigned int GetNumberOfSegments() const
bool IsHelperToBePainted(unsigned int index) const override
Returns whether a helper polyline should be painted or not.
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