22template<
class NodeData>
53 typedef std::vector<NodeData> NodesData;
54 NodesData m_nodesData;
58template<
class NodeData>
61 Q_ASSERT(nodeIndex >= 0);
62 Q_ASSERT(nodeIndex <
int(m_nodesData.size()));
64 return m_nodesData[nodeIndex];
68template<
class NodeData>
71 Q_ASSERT(nodeIndex >= 0);
72 Q_ASSERT(nodeIndex <
int(m_nodesData.size()));
74 return m_nodesData[nodeIndex];
80template<
class NodeData>
83 Q_ASSERT(nodeIndex >= 0);
84 Q_ASSERT(nodeIndex <
int(m_nodesData.size()));
86 return m_nodesData[nodeIndex];
90template<
class NodeData>
93 Q_ASSERT(nodeIndex >= 0);
94 Q_ASSERT(nodeIndex <
int(m_nodesData.size()));
96 return m_nodesData[nodeIndex];
102template<
class NodeData>
105 if (!m_nodesData.empty()){
107 Q_UNUSED(changeNotifier);
116template<
class NodeData>
120 Q_UNUSED(changeNotifier);
122 m_nodesData.resize(nodesCount);
124 BaseClass::SetNodesCount(nodesCount);
128template<
class NodeData>
132 Q_UNUSED(changeNotifier);
134 m_nodesData.insert(m_nodesData.end(), NodeData());
136 return BaseClass::InsertNode(position);
140template<
class NodeData>
144 Q_UNUSED(changeNotifier);
146 typename NodesData::iterator iter = m_nodesData.begin();
148 m_nodesData.insert(iter, NodeData());
150 return BaseClass::InsertNode(index, position);
154template<
class NodeData>
158 Q_UNUSED(changeNotifier);
160 typename NodesData::iterator iter = m_nodesData.begin();
162 m_nodesData.erase(iter);
164 return BaseClass::RemoveNode(index);
170template<
class NodeData>
179 if (polygonPtr !=
NULL){
183 for (
int nodesIndex = 0; nodesIndex < sourceNodesCount; nodesIndex++){
184 InsertNode(polygonPtr->
GetNodePos(nodesIndex));
186 m_nodesData[nodesIndex] = polygonPtr->m_nodesData[nodesIndex];
Base class for polylines with additional data stored in each node.
virtual bool CopyFrom(const istd::IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
Copy this object from another one.
virtual const i2d::CVector2d & GetNodePos(int index) const
Return position of node at specified index.
virtual int GetNodesCount() const
Return size of node table.
Definition of position or mathematical vector on 2D plane.
Generic polyline implementation with additional information stored for each node.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
NodeData & GetTNodeDataRef(int nodeIndex)
Get reference of user data in the given node.
virtual bool RemoveNode(int index) override
Remove a node at specified index.
CDataNodePolylineBase BaseClass
virtual void SetNodesCount(int nodesCount) override
Set new nodes count.
virtual const iser::ISerializable & GetNodeData(int nodeIndex) const override
Get user data from the given node.
virtual void Clear() override
Removes all nodes.
const NodeData & GetTNodeData(int nodeIndex) const
Get user data from the given node.
virtual iser::ISerializable & GetNodeDataRef(int nodeIndex) override
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool InsertNode(const i2d::CVector2d &position) override
Insert a node at the end of node table.
virtual bool InsertNode(int index, const i2d::CVector2d &position) override
Insert a node at specified index.
Common class for all classes which objects can be archived or restored from archive.
Help class which provides the group of changes for update mechanism of the model.
Help class which provides the automatic update mechanism of the model.
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.