CAnnulusSegmentShape.h
Go to the documentation of this file.
1 #ifndef iview_CAnnulusSegmentShape_included
2 #define iview_CAnnulusSegmentShape_included
3 
4 
5 #include <iview/CAnnulusShape.h>
6 
7 
8 namespace iview
9 {
10 
11 
13 {
14 public:
17 
19 
20  virtual bool IsEditableAngles() const;
21  virtual void SetEditableAngles(bool editable = true);
22 
23  // reimplemented (iview::IMouseActionObserver)
24  virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag);
25  virtual bool OnMouseMove(istd::CIndex2d position);
26 
27  // reimplemented (iview::IVisualizable)
28  virtual void Draw(QPainter& drawContext) const;
29 
30  // reimplemented (imod::IObserver)
31  virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
32 
33  // reimplemented (iview::ITouchable)
34  virtual TouchState IsTouched(istd::CIndex2d position) const;
35 
36 protected:
37  virtual void DrawArea(
38  QPainter& painter,
39  i2d::CVector2d realCenter,
40  i2d::CVector2d center,
41  double realMinRadius,
42  double realMaxRadius,
43  int minRadius,
44  int maxRadius,
45  double startAngle,
46  double stopAngle,
47  bool fillFlag = true) const;
48 
49  double GetDegreeAndleOfPoint(const i2d::CVector2d& center, const QPointF& point) const;
50 
52 
53  enum EditMode
54  {
57  };
58 };
59 
60 
62 {
63  return m_editableAngle;
64 }
65 
66 
67 } // namespace iview
68 
69 
70 #endif // !iview_CAnnulusSegmentShape_included
71 
virtual bool IsEditableAngles() const
virtual bool OnModelAttached(imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask)
This call back function will be called, if an observable object is about to be attached.
virtual TouchState IsTouched(istd::CIndex2d position) const
Check, if any shape is touched.
virtual void Draw(QPainter &drawContext) const
Draw this shape using draw context.
Index implementation for addressing elements in 2D-space.
Definition: CIndex2d.h:20
virtual bool OnMouseMove(istd::CIndex2d position)
It is called, when mouse is moved.
double GetDegreeAndleOfPoint(const i2d::CVector2d &center, const QPointF &point) const
CInteractiveShapeBase ShapeBaseClass
Definition of position or mathematical vector on 2D plane.
Definition: CVector2d.h:28
TouchState
Enumeration for possible shape touch states.
Definition: ITouchable.h:24
virtual void DrawArea(QPainter &painter, i2d::CVector2d realCenter, i2d::CVector2d center, double realMinRadius, double realMaxRadius, int minRadius, int maxRadius, double startAngle, double stopAngle, bool fillFlag=true) const
virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag)
It is called, when mouse button is pushed down or up on this object.
Common interface for model objects, that supports Model/Observer design pattern.
Definition: IModel.h:23
Set of change flags (its IDs).
Definition: IChangeable.h:30
virtual void SetEditableAngles(bool editable=true)

© 2007-2017 Witold Gantzke and Kirill Lepskiy