24 m_VectorData(), m_CurrentNodeType(
FEATURE_POLYGON), m_CurrentRootNode(),
25 m_CurrentGeometry(), m_Origin(), m_Spacing()
64 otbMsgDevMacro(<<
"VectorDataModel::AddPointToGeometry: Creating and adding new point");
77 itkExceptionMacro(<<
"No partially created geometry should be up when adding FEATURE_POINT");
84 otbMsgDevMacro(<<
"VectorDataModel::AddPointToGeometry: Creating new polygon");
92 otbMsgDevMacro(<<
"VectorDataModel::AddPoint: Adding point " << newPoint);
99 otbMsgDevMacro(<<
"VectorDataModel::AddPointToGeometry: Creating new line");
107 otbMsgDevMacro(<<
"VectorDataModel::AddPoint: Adding point " << newPoint);
115 if(callUpdate ==
true)
131 otbMsgDevMacro(<<
"VectorDataModel::EndGeometry: Point don't need the geometry to be ended");
139 itkExceptionMacro(<<
"Polygon must have at least 3 points");
141 otbMsgDevMacro(<<
"VectorDataModel::EndGeometry: Ending polygon and adding to vector data");
152 itkExceptionMacro(<<
"Line must have at least 2 points");
154 otbMsgDevMacro(<<
"VectorDataModel::EndGeometry: Ending line and adding to vector data");
163 if(callUpdate ==
true)
177 while ( !it.IsAtEnd()
184 itkExceptionMacro(<<
"The selected geometry is not in the tree (and it should)");
192 otbMsgDevMacro(<<
"VectorDataModel::DeleteGeometry: Removing last geometry");
200 if (currentRootNode->GetChildrenList().size() > 0)
202 otbMsgDevMacro(<<
"Current number of elements (before deletion)" << currentRootNode->GetChildrenList().size());
204 currentRootNode->GetChildrenList().pop_back();
220 while (!it.IsAtEnd() &&
222 ((it.GetNode())->Get()->IsPointFeature())
223 || (it.GetNode())->Get()->IsLineFeature()
224 || (it.GetNode())->Get()->IsPolygonFeature()
229 while (i < n && !it.IsAtEnd())
231 if ((it.GetNode())->Get()->IsPointFeature() || (it.GetNode())->Get()->IsLineFeature() ||
232 (it.GetNode())->Get()->IsPolygonFeature())
241 otbMsgDevMacro(<<
"VectorDataModel::GetNthDataNode: requesting for inaccessible node: " << n);
244 return (it.GetNode())->Get();
269 switch (node->
Get()->GetNodeType())
276 vertex[0] = point[0];
277 vertex[1] = point[1];
295 vertex[0] = point[0];
296 vertex[1] = point[1];
309 const PolygonType * extRing = node->
Get()->GetPolygonExteriorRing();
316 vertex[0] = point[0];
317 vertex[1] = point[1];
339 ChildrenListType::iterator it = children.begin();
340 while ( it != children.end() )
350 std::vector< std::string > fieldList = node->
Get()->GetFieldList();
352 for (i=0; i < fieldList.size(); ++i)
354 m_CurrentGeometry->SetFieldAsString(fieldList.at(i), node->
Get()->GetFieldAsString(fieldList.at(i)));