CPolylineShape.h
Go to the documentation of this file.
1 #ifndef iview_CPolylineShape_included
2 #define iview_CPolylineShape_included
3 
4 
5 // Qt includes
6 #include <QtGui/QPainter>
7 
8 // ACF includes
9 #include <iview/CPolygonShape.h>
10 
11 
12 namespace iview
13 {
14 
15 
17 {
18 public:
21 
23 
24  bool IsOrientationVisible() const;
25  void SetOrientationVisible(bool state = true);
26 
27  // reimplemented (iview::IMouseActionObserver)
28  virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag);
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  virtual QString GetShapeDescriptionAt(istd::CIndex2d position) const;
36 
37  // static methods
42  static void DrawOrientationMarker(
43  QPainter& drawContext,
44  const QPen& rightPen,
45  const QBrush& rightBrush,
46  const QPen& leftPen,
47  const QBrush& leftBrush,
48  const i2d::CLine2d& segmentLine,
49  double scale);
50 
51 protected:
52  // reimplemented (iview::CPolygonShape)
53  virtual void DrawCurve(QPainter& drawContext) const;
54  virtual void DrawArea(QPainter& drawContext) const;
55  virtual void DrawSelectionElements(QPainter& drawContext) const;
56 
57  // reimplemented (iview::CRectControlledShapeBase)
58  virtual bool IsCurveTouched(istd::CIndex2d position) const;
59 
60  // reimplemented (iview::CShapeBase)
61  virtual i2d::CRect CalcBoundingBox() const;
62 
63 private:
64  bool m_isOrientationVisible;
65 };
66 
67 
69 {
70  return m_isOrientationVisible;
71 }
72 
73 
75 {
76  m_isOrientationVisible = state;
77 }
78 
79 
80 } // namespace iview
81 
82 
83 #endif // !iview_CPolylineShape_included
84 
85 
virtual QString GetShapeDescriptionAt(istd::CIndex2d position) const
Get description to shape at specified position.
virtual void DrawSelectionElements(QPainter &drawContext) const
Definition of a line in 2D-space.
Definition: CLine2d.h:24
Simple rectangle with integer bounds.
Definition: CRect.h:21
Index implementation for addressing elements in 2D-space.
Definition: CIndex2d.h:20
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.
virtual void DrawCurve(QPainter &drawContext) const
virtual TouchState IsTouched(istd::CIndex2d position) const
Check, if any shape is touched.
virtual i2d::CRect CalcBoundingBox() const
Calculate bounding box.
virtual void DrawArea(QPainter &drawContext) const
static void DrawOrientationMarker(QPainter &drawContext, const QPen &rightPen, const QBrush &rightBrush, const QPen &leftPen, const QBrush &leftBrush, const i2d::CLine2d &segmentLine, double scale)
Draw an orientation marker consisting of two triangles (black for outside and white for inside) ...
TouchState
Enumeration for possible shape touch states.
Definition: ITouchable.h:24
bool IsOrientationVisible() const
CPolygonShape BaseClass
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.
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
CInteractiveShapeBase ShapeBaseClass
void SetOrientationVisible(bool state=true)
virtual bool IsCurveTouched(istd::CIndex2d position) const

© 2007-2017 Witold Gantzke and Kirill Lepskiy