ICF 3.1.1.10
Technical documentation of ICF Libraries
CPolylineShape.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#ifndef iview_CPolylineShape_included
7#define iview_CPolylineShape_included
8
9
10// Qt includes
11#include <QtGui/QPainter>
12
13// ICF includes
14#include <iview/CPolygonShape.h>
15
16
17namespace iview
18{
19
20
22{
23public:
26
28
29 bool IsOrientationVisible() const;
30 void SetOrientationVisible(bool state = true);
31
32 // reimplemented (iview::IMouseActionObserver)
33 virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag);
34
35 // reimplemented (imod::IObserver)
36 virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
37
38 // reimplemented (iview::ITouchable)
39 virtual TouchState IsTouched(istd::CIndex2d position) const;
40 virtual QString GetShapeDescriptionAt(istd::CIndex2d position) const;
41
42 // static methods
48 QPainter& drawContext,
49 const QPen& rightPen,
50 const QBrush& rightBrush,
51 const QPen& leftPen,
52 const QBrush& leftBrush,
53 const i2d::CLine2d& segmentLine,
54 double scale);
55
57 QPainter& drawContext,
58 const i2d::CVector2d& point,
59 const i2d::CVector2d& direction,
60 double maxWidth,
61 const iview::IColorSchema& colorSchema);
62protected:
63 // reimplemented (iview::CPolygonShape)
64 virtual void DrawCurve(QPainter& drawContext) const;
65 virtual void DrawArea(QPainter& drawContext) const;
66 virtual void DrawSelectionElements(QPainter& drawContext) const;
67
68 // reimplemented (iview::CRectControlledShapeBase)
69 virtual bool IsCurveTouched(istd::CIndex2d position) const;
70
71 // reimplemented (iview::CShapeBase)
72 virtual i2d::CRect CalcBoundingBox() const;
73
74private:
75 bool m_isOrientationVisible;
76};
77
78
80{
81 return m_isOrientationVisible;
82}
83
84
86{
87 m_isOrientationVisible = state;
88}
89
90
91} // namespace iview
92
93
94#endif // !iview_CPolylineShape_included
95
96
Definition of a line in 2D-space.
Definition CLine2d.h:26
Simple rectangle with integer bounds.
Definition CRect.h:26
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:25
Set of change flags (its IDs).
Definition IChangeable.h:38
Base class of shape implementation with user interaction.
virtual void DrawCurve(QPainter &drawContext) const
CInteractiveShapeBase ShapeBaseClass
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)
virtual TouchState IsTouched(istd::CIndex2d position) const
Check, if any shape is touched.
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 void DrawSelectionElements(QPainter &drawContext) const
CPolygonShape BaseClass
void SetOrientationVisible(bool state=true)
static void DrawOrientationMarker(QPainter &drawContext, const i2d::CVector2d &point, const i2d::CVector2d &direction, double maxWidth, const iview::IColorSchema &colorSchema)
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 bool IsCurveTouched(istd::CIndex2d position) const
virtual void DrawArea(QPainter &drawContext) const
bool IsOrientationVisible() const
virtual i2d::CRect CalcBoundingBox() const
Calculate bounding box.
virtual QString GetShapeDescriptionAt(istd::CIndex2d position) const
Get description to shape at specified position.
Defines set of standard pens, brushes and simple management of unions.
TouchState
Enumeration for possible shape touch states.
Definition ITouchable.h:30
In this library is defined 2D view concept and standard visualisation objects.

© Witold Gantzke and Kirill Lepskiy