Esempio n. 1
0
std::string Building::get_citygml() {
  std::stringstream ss;
  ss << "<cityObjectMember>";
  ss << "<bldg:Building>";
  ss << "<bldg:measuredHeight uom=\"#m\">";
  ss << this->get_height_top();
  ss << "</bldg:measuredHeight>";
  ss << "<bldg:lod1Solid>";
  ss << "<gml:Solid>";
  ss << "<gml:exterior>";
  ss << "<gml:CompositeSurface>";
  //-- get floor
  ss << get_polygon_lifted_gml(this->_p2, this->get_height_base(), false);
  //-- get roof
  ss << get_polygon_lifted_gml(this->_p2, this->get_height_top(), true);
  //-- get the walls
  auto r = bg::exterior_ring(*(this->_p2));
  for (int i = 0; i < (r.size() - 1); i++) 
    ss << get_extruded_line_gml(&r[i], &r[i + 1], this->get_height_top(), 0, false);
  ss << "</gml:CompositeSurface>";
  ss << "</gml:exterior>";
  ss << "</gml:Solid>";
  ss << "</bldg:lod1Solid>";
  ss << "</bldg:Building>";
  ss << "</cityObjectMember>";
  return ss.str(); 
}
Esempio n. 2
0
std::string Building::get_citygml() {
  float h = z_to_float(this->get_height());
  float hbase = z_to_float(this->get_height_base());
  std::stringstream ss;
  ss << "<cityObjectMember>" << std::endl;
  ss << "<bldg:Building gml:id=\"";
  ss << this->get_id();
  ss << "\">" << std::endl;
  ss << "<bldg:measuredHeight uom=\"#m\">";
  ss << h;
  ss << "</bldg:measuredHeight>" << std::endl;
  //-- LOD0 footprint
  ss << "<bldg:lod0FootPrint>" << std::endl;
  ss << "<gml:MultiSurface>" << std::endl;
  ss << get_polygon_lifted_gml(this->_p2, hbase, true);
  ss << "</gml:MultiSurface>" << std::endl;
  ss << "</bldg:lod0FootPrint>" << std::endl;
  //-- LOD0 roofedge
  ss << "<bldg:lod0RoofEdge>" << std::endl;
  ss << "<gml:MultiSurface>" << std::endl;
  ss << get_polygon_lifted_gml(this->_p2, h, true);
  ss << "</gml:MultiSurface>" << std::endl;
  ss << "</bldg:lod0RoofEdge>" << std::endl;
  //-- LOD1 Solid
  ss << "<bldg:lod1Solid>" << std::endl;
  ss << "<gml:Solid>" << std::endl;
  ss << "<gml:exterior>" << std::endl;
  ss << "<gml:CompositeSurface>" << std::endl;
  //-- get floor
  ss << get_polygon_lifted_gml(this->_p2, hbase, false);
  //-- get roof
  ss << get_polygon_lifted_gml(this->_p2, h, true);
  //-- get the walls
  auto r = bg::exterior_ring(*(this->_p2));
  int i;
  for (i = 0; i < (r.size() - 1); i++)
    ss << get_extruded_line_gml(&r[i], &r[i + 1], h, hbase, false);
  ss << get_extruded_line_gml(&r[i], &r[0], h, hbase, false);
  //-- irings
  auto irings = bg::interior_rings(*(this->_p2));
  for (Ring2& r : irings) {
    for (i = 0; i < (r.size() - 1); i++)
      ss << get_extruded_line_gml(&r[i], &r[i + 1], h, hbase, false);
    ss << get_extruded_line_gml(&r[i], &r[0], h, hbase, false);
  }
  ss << "</gml:CompositeSurface>" << std::endl;
  ss << "</gml:exterior>" << std::endl;
  ss << "</gml:Solid>" << std::endl;
  ss << "</bldg:lod1Solid>" << std::endl;
  ss << "</bldg:Building>" << std::endl;
  ss << "</cityObjectMember>" << std::endl;
  return ss.str();
}
Esempio n. 3
0
File: io.cpp Progetto: Ezio47/3dfier
std::string get_extruded_lod1_block_gml(Polygon2* p2, double high, double low) {
  std::stringstream ss;
  //-- get floor
  ss << get_polygon_lifted_gml(p2, low, false);
  //-- get roof
  ss << get_polygon_lifted_gml(p2, high, true);
  //-- get the walls
  auto r = bg::exterior_ring(*p2);
  for (int i = 0; i < (r.size() - 1); i++) 
    ss << get_extruded_line_gml(&r[i], &r[i + 1], high, low, false);
  return ss.str();
}
Esempio n. 4
0
std::string Building::get_citygml_imgeo() {
  float h = z_to_float(this->get_height());
  float hbase = z_to_float(this->get_height_base());
  std::stringstream ss;
  ss << "<cityObjectMember>" << std::endl;
  ss << "<bui:BuildingPart gml:id=\"" << this->get_id() << "\">" << std::endl;
  ss << get_imgeo_object_info(this->get_id());
  //-- LOD1 Solid
  ss << "<bui:lod1Solid>" << std::endl;
  ss << "<gml:Solid>" << std::endl;
  ss << "<gml:exterior>" << std::endl;
  ss << "<gml:CompositeSurface>" << std::endl;
  //-- get floor
  ss << get_polygon_lifted_gml(this->_p2, hbase, false);
  //-- get roof
  ss << get_polygon_lifted_gml(this->_p2, h, true);
  //-- get the walls
  auto r = bg::exterior_ring(*(this->_p2));
  int i;
  for (i = 0; i < (r.size() - 1); i++)
    ss << get_extruded_line_gml(&r[i], &r[i + 1], h, hbase, false);
  ss << get_extruded_line_gml(&r[i], &r[0], h, hbase, false);
  //-- irings
  auto irings = bg::interior_rings(*(this->_p2));
  for (Ring2& r : irings) {
    for (i = 0; i < (r.size() - 1); i++)
      ss << get_extruded_line_gml(&r[i], &r[i + 1], h, hbase, false);
    ss << get_extruded_line_gml(&r[i], &r[0], h, hbase, false);
  }
  ss << "</gml:CompositeSurface>" << std::endl;
  ss << "</gml:exterior>" << std::endl;
  ss << "</gml:Solid>" << std::endl;
  ss << "</bui:lod1Solid>" << std::endl;
  std::string attribute;
  if (get_attribute("identificatiebagpnd", attribute)) {
    ss << "<imgeo:identificatieBAGPND>" << attribute << "</imgeo:identificatieBAGPND>" << std::endl;
  }

  ss << get_citygml_imgeo_number();


  ss << "</bui:BuildingPart>" << std::endl;
  ss << "</cityObjectMember>" << std::endl;
  return ss.str();
}