Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. pugi::xpath_query queryShape("/shapes/layer/shape[@category='Shapes']");
  2. pugi::xpath_node_set qShape = queryShape.evaluate_node_set(doc);
  3.  
  4. //pugi::xpath_query queryShapePoints("/shapes/layer/shape[@category='Shapes']/point");
  5. //pugi::xpath_node_set qShapePoint = queryShapePoints.evaluate_node_set(doc);
  6.  
  7. std::cout << "setting *** SHAPE *** objects" << std::endl;
  8. std::list<Shape> listaShape;
  9. for (int i = 0; i < nsShapes; i++)
  10. {
  11. Shape shapeTemp;
  12. std::cout << "SHAPE " << i + 1 << std::endl;
  13. shapeTemp.setShapeCategory(qShape[i].node().attribute("category").value());
  14. shapeTemp.setShapeColor(qShape[i].node().attribute("color").value());
  15. shapeTemp.setShapeName(qShape[i].node().attribute("name").value());
  16. shapeTemp.setShapeTemplate(qShape[i].node().attribute("template").value());
  17. shapeTemp.setShapeType(qShape[i].node().attribute("type").value());
  18. shapeTemp.setShapeCoord(qShape[i].node().child("point").attribute("latitude").value(), qShape[i].node().child("point").attribute("longitude").value());
  19. listaShape.push_back(shapeTemp);
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement