Merge branch 'v0.6.0' into v0.7.0

This commit is contained in:
Thomas Krijnen
2021-07-10 16:55:57 +02:00
728 changed files with 376298 additions and 19422 deletions
+46 -2
View File
@@ -357,6 +357,9 @@ int main(int argc, char** argv) {
double section_height;
std::string svg_scale, svg_center;
std::string section_ref, elevation_ref;
// "none", "full" or "left"
std::string storey_height_display;
SvgSerializer::storey_height_display_types svg_storey_height_display = SvgSerializer::SH_NONE;
po::options_description serializer_options("Serialization options");
serializer_options.add_options()
@@ -382,12 +385,20 @@ int main(int argc, char** argv) {
"Creates SVG cross section drawings automatically based on model extents")
("auto-elevation",
"Creates SVG elevation drawings automatically based on model extents")
("draw-storey-heights",
po::value<std::string>(&storey_height_display)->default_value("none")->implicit_value("full"),
"Draws a horizontal line at the height of building storeys in vertical drawings")
("storey-height-line-length", po::value<double>(),
"Length of the line when --draw-storey-heights=left")
("svg-xmlns",
"Stores name and guid in a separate namespace as opposed to data-name, data-guid")
("svg-poly",
"Uses the polygonal algorithm for hidden line rendering")
("svg-write-poly",
"Approximate every curve as polygonal in SVG output")
("svg-project",
"Always enable hidden line rendering instead of only on elevations")
("svg-without-storeys", "Don't emit drawings for building storeys")
("door-arcs", "Draw door openings arcs for IfcDoor elements")
("section-height", po::value<double>(&section_height),
"Specifies the cut section height for SVG 2D geometry.")
@@ -412,7 +423,7 @@ int main(int argc, char** argv) {
("site-local-placement",
"Place elements locally in the IfcSite coordinate system, instead of placing "
"them in the IFC global coords. Applicable for OBJ and DAE output.")
("y-up", "Change the 'up' axis to positive Y, default is Z UPApplicable for OBJ output.")
("y-up", "Change the 'up' axis to positive Y, default is Z UP, Applicable for OBJ output.")
("building-local-placement",
"Similar to --site-local-placement, but placing elements in locally in the parent IfcBuilding coord system")
("precision", po::value<short>(&precision)->default_value(SerializerSettings::DEFAULT_PRECISION),
@@ -422,6 +433,8 @@ int main(int argc, char** argv) {
" and any other value means that 6 or 7 decimals are used.")
("print-space-names", "Prints IfcSpace LongName and Name in the geometry output. Applicable for SVG output")
("print-space-areas", "Prints calculated IfcSpace areas in square meters. Applicable for SVG output")
("space-name-transform", po::value<std::string>(),
"Additional transform to the space labels in SVG")
("edge-arrows", "Adds arrow heads to edge segments to signify edge direction")
;
@@ -508,6 +521,22 @@ int main(int argc, char** argv) {
print_usage();
return EXIT_FAILURE;
}
if (vmap.count("draw-storey-heights")) {
boost::to_lower(storey_height_display);
if (storey_height_display == "none") {
svg_storey_height_display = SvgSerializer::SH_NONE;
} else if (storey_height_display == "full") {
svg_storey_height_display = SvgSerializer::SH_FULL;
} else if (storey_height_display == "left") {
svg_storey_height_display = SvgSerializer::SH_LEFT;
} else {
cerr_ << "[Error] --draw-storey-heights should be none|full|left" << std::endl;
print_usage();
return EXIT_FAILURE;
}
}
if (vmap.count("log-format") == 1) {
boost::to_lower(log_format);
@@ -931,7 +960,7 @@ int main(int argc, char** argv) {
}
std::stringstream msg;
msg << std::setprecision (17) << "Using model offset (" << offset[0] << "," << offset[1] << "," << offset[2] << ")";
msg << std::setprecision (std::numeric_limits< double >::max_digits10) << "Using model offset (" << offset[0] << "," << offset[1] << "," << offset[2] << ")";
Logger::Notice(msg.str());
}
@@ -965,6 +994,9 @@ int main(int argc, char** argv) {
if (vmap.count("print-space-areas") != 0) {
static_cast<SvgSerializer*>(serializer.get())->setPrintSpaceAreas(true);
}
if (vmap.count("draw-storey-heights") != 0) {
static_cast<SvgSerializer*>(serializer.get())->setDrawStoreyHeights(svg_storey_height_display);
}
if (bounding_width.is_initialized() && bounding_height.is_initialized()) {
static_cast<SvgSerializer*>(serializer.get())->setBoundingRectangle(bounding_width.get(), bounding_height.get());
}
@@ -995,10 +1027,22 @@ int main(int argc, char** argv) {
}
static_cast<SvgSerializer*>(serializer.get())->setUseNamespace(vmap.count("svg-xmlns") > 0);
static_cast<SvgSerializer*>(serializer.get())->setUseHlrPoly(vmap.count("svg-poly") > 0);
static_cast<SvgSerializer*>(serializer.get())->setPolygonal(vmap.count("svg-write-poly") > 0);
static_cast<SvgSerializer*>(serializer.get())->setAlwaysProject(vmap.count("svg-project") > 0);
static_cast<SvgSerializer*>(serializer.get())->setWithoutStoreys(vmap.count("svg-without-storeys") > 0);
if (relative_center_x && relative_center_y) {
static_cast<SvgSerializer*>(serializer.get())->setDrawingCenter(*relative_center_x, *relative_center_y);
}
if (vmap.count("storey-height-line-length")) {
static_cast<SvgSerializer*>(serializer.get())->setStoreyHeightLineLength(
vmap["storey-height-line-length"].as<double>()
);
}
if (vmap.count("space-name-transform")) {
static_cast<SvgSerializer*>(serializer.get())->setSpaceNameTransform(
vmap["space-name-transform"].as<std::string>()
);
}
}
if (convert_back_units) {