CPolyline.h
Go to the documentation of this file.
1 #ifndef i2d_CPolyline_included
2 #define i2d_CPolyline_included
3 
4 
5 // ACF includes
6 #include <i2d/CLine2d.h>
7 #include <i2d/CPolygon.h>
8 
9 
10 namespace i2d
11 {
12 
13 
18 class CPolyline: public CPolygon
19 {
20 public:
22 
23  static QByteArray GetTypeName();
24 
25  CPolyline();
26 
27  virtual bool IsClosed() const;
28 
32  virtual void SetClosed(bool state = true);
33 
37  virtual int GetSegmentsCount() const;
38 
42  virtual i2d::CLine2d GetSegmentLine(int segmentIndex) const;
43 
47  virtual double GetLength() const;
48 
52  virtual i2d::CVector2d GetKneeVector(int nodeIndex) const;
53 
54 
55  // reimplemented (iser::ISerializable)
56  virtual bool Serialize(iser::IArchive& archive);
57 
58  // reimplemented (iser::IObject)
59  virtual QByteArray GetFactoryId() const;
60 
61  // reimplemented istd::IChangeable
62  virtual bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS);
64  virtual bool IsEqual(const IChangeable& object) const;
65 
66 private:
67  bool m_isClosed;
68 };
69 
70 
71 // public inline methods
72 
74 {
75  m_isClosed = false;
76 }
77 
78 
79 inline bool CPolyline::IsClosed() const
80 {
81  return m_isClosed;
82 }
83 
84 
85 } // namespace i2d
86 
87 
88 #endif // !i2d_CPolyline_included
89 
90 
Definition of the data model for a polygon.
Definition: CPolygon.h:16
External references are simple ignored.
Definition: IChangeable.h:197
CompatibilityMode
Control how relationship betweeen objects are interpreted.
Definition: IChangeable.h:186
virtual double GetLength() const
Get length of this polyline.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS)
virtual bool IsClosed() const
Definition: CPolyline.h:79
Definition of a line in 2D-space.
Definition: CLine2d.h:24
virtual istd::IChangeable * CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const
Make a copy of this object.
Represent input/output persistence archive.
Definition: IArchive.h:30
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
virtual void SetClosed(bool state=true)
Set polyline to be opened or closed.
virtual i2d::CVector2d GetKneeVector(int nodeIndex) const
Return vector for knee, that has the same angle to both neighbor segments.
virtual bool Serialize(iser::IArchive &archive)
Load or store state of this object as a archive stream.
Definition of position or mathematical vector on 2D plane.
Definition: CVector2d.h:28
virtual bool IsEqual(const IChangeable &object) const
static QByteArray GetTypeName()
virtual i2d::CLine2d GetSegmentLine(int segmentIndex) const
Return number of line segments.
CPolygon BaseClass
Definition: CPolyline.h:21
virtual int GetSegmentsCount() const
Return number of line segments.
2D-object representing a polyline.
Definition: CPolyline.h:18
virtual QByteArray GetFactoryId() const

© 2007-2017 Witold Gantzke and Kirill Lepskiy