Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkPlanarRectangle.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 mitkPlanarRectangle_h
14 #define mitkPlanarRectangle_h
15 
16 #include <mitkPlanarPolygon.h>
18 
19 namespace mitk
20 {
21  class PlaneGeometry;
22 
37  {
38  public:
40 
41  itkFactorylessNewMacro(Self);
42 
43  itkCloneMacro(Self);
44 
49  void PlaceFigure(const Point2D &point) override;
50 
52  unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
54  unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
55 
64  bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false) override;
65 
66  protected:
68  PlanarRectangle(const Self& other);
69 
71 
73  void GeneratePolyLine() override;
74 
76  void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
77 
79  void EvaluateFeaturesInternal() override;
80 
81  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
82 
83  const unsigned int FEATURE_ID_CIRCUMFERENCE;
84  const unsigned int FEATURE_ID_AREA;
85 
86  bool Equals(const mitk::PlanarFigure &other) const override;
87 
88  private:
89  };
90 
91 } // namespace mitk
92 
93 #endif
#define MITKPLANARFIGURE_EXPORT
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons,...
Implementation of PlanarFigure representing an axis-aligned rectangle.
void GeneratePolyLine() override
Generates the poly-line representation of the planar figure.
void PlaceFigure(const Point2D &point) override
Places the rectangle at the given point, initializing all four corners.
unsigned int GetMinimumNumberOfControlPoints() const override
Returns 4 – a rectangle requires exactly four control points.
const unsigned int FEATURE_ID_AREA
bool Equals(const mitk::PlanarFigure &other) const override
Compares this PlanarFigure with another for equality.
void EvaluateFeaturesInternal() override
Calculates feature quantities of the planar figure.
void PrintSelf(std::ostream &os, itk::Indent indent) const override
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override
Generates the poly-lines that should be drawn the same size regardless of zoom.
mitkClassMacro(PlanarRectangle, PlanarFigure)
const unsigned int FEATURE_ID_CIRCUMFERENCE
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist=false) override
Sets a control point and updates adjacent corners to maintain the rectangle.
PlanarRectangle(const Self &other)
unsigned int GetMaximumNumberOfControlPoints() const override
Returns 4 – a rectangle requires exactly four control points.
Find image slices visible on a given plane.