Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkPlanarCross.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _MITK_PLANAR_CROSS_H_
18 #define _MITK_PLANAR_CROSS_H_
19 
20 #include "mitkPlanarFigure.h"
22 
23 namespace mitk
24 {
25  class PlaneGeometry;
26 
55  {
56  public:
58 
59  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
60 
61 
63  void SetSingleLineMode(bool singleLineMode);
64 
67  bool GetSingleLineMode() const;
68 
71  itkBooleanMacro(SingleLineMode); // No need to reimplement; calls SetSingleLineMode()
72 
74  unsigned int GetMinimumNumberOfControlPoints() const override { return this->GetSingleLineMode() ? 2 : 4; }
76  unsigned int GetMaximumNumberOfControlPoints() const override { return this->GetSingleLineMode() ? 2 : 4; }
78  virtual bool ResetOnPointSelect() override;
79 
80  virtual bool ResetOnPointSelectNeeded() const override;
81 
83  virtual unsigned int GetNumberOfFeatures() const override;
84 
85  virtual bool Equals(const mitk::PlanarFigure &other) const override;
86 
87  protected:
88  PlanarCross();
89  mitkCloneMacro(Self);
90 
92  virtual Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
93 
95  virtual void GeneratePolyLine() override;
96 
98  virtual void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
99 
101  virtual void EvaluateFeaturesInternal() override;
102 
103  virtual void PrintSelf(std::ostream &os, itk::Indent indent) const override;
104 
105  // Feature identifiers
106  const unsigned int FEATURE_ID_LONGESTDIAMETER;
107  const unsigned int FEATURE_ID_SHORTAXISDIAMETER;
108 
109  private:
111  virtual Point2D InternalApplyControlPointConstraints(unsigned int index, const Point2D &point);
112  };
113 
114 } // namespace mitk
115 
116 #endif //_MITK_PLANAR_CROSS_H_
Base of all data objects.
Definition: mitkBaseData.h:39
const unsigned int FEATURE_ID_LONGESTDIAMETER
DataCollection - Class to facilitate loading/accessing structured data.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
unsigned int GetMaximumNumberOfControlPoints() const override
PlanarCross has either two or four control points, depending on the operation mode.
unsigned int GetMinimumNumberOfControlPoints() const override
PlanarCross has either two or four control points, depending on the operation mode.
#define mitkCloneMacro(classname)
Definition: mitkCommon.h:162
#define MITKPLANARFIGURE_EXPORT
Implementation of PlanarFigure modeling a cross with two orthogonal lines on a plane.
Base-class for geometric planar (2D) figures, such as lines, circles, rectangles, polygons...
const unsigned int FEATURE_ID_SHORTAXISDIAMETER