NOTE: From now on Boost is required in order to compile IfcOpenShell

====================================================================

- Use boost::optional for optional IFC arguments
- Use boost::uuid for the creation of GlobalIds
- New IfcGeomObjects setting to force alignment of TopoDS_Face normal to CCW orientation
- Removed static Ifc class, renamed to non-static IfcFile. IfcFile renamed to IfcSpfStream
- Introduced Logger class
- Introduced EntityBuffer class that keeps track of all writable entities created to add them all in once to the IfcFile class
This commit is contained in:
Thomas Krijnen
2012-08-11 13:24:08 +00:00
parent 31daf8dd20
commit 6f1e1c3bad
29 changed files with 2933 additions and 2684 deletions
+6 -10
View File
@@ -29,10 +29,11 @@ int main(int argc, char** argv) {
}
// Redirect the output (both progress and log) to stdout
Ifc::SetOutput(&std::cout,&std::cout);
Logger::SetOutput(&std::cout,&std::cout);
// Parse the IFC file provided in argv[1]
if ( ! Ifc::Init(argv[1]) ) {
IfcParse::IfcFile file;
if ( ! file.Init(argv[1]) ) {
std::cout << "Unable to parse .ifc file" << std::endl;
return 1;
}
@@ -53,12 +54,7 @@ int main(int argc, char** argv) {
// we need to cast them to IfcWindows. Since these properties
// are optional we need to make sure the properties are
// defined for the window in question before accessing them.
//
// Since we are accessing properties that represent a length
// measure we can multiply the value by Ifc::LengthUnit, which
// contains the ratio of the unit defined in the IfcUnitAssignment
// to the standard SI Unit, the meter.
IfcBuildingElement::list elements = Ifc::EntitiesByType<IfcBuildingElement>();
IfcBuildingElement::list elements = file.EntitiesByType<IfcBuildingElement>();
std::cout << "Found " << elements->Size() << " elements in " << argv[1] << ":" << std::endl;
@@ -71,8 +67,8 @@ int main(int argc, char** argv) {
const IfcWindow::ptr window = reinterpret_pointer_cast<IfcBuildingElement,IfcWindow>(element);
if ( window->hasOverallWidth() && window->hasOverallHeight() ) {
const float area = window->OverallWidth()*window->OverallHeight() * (Ifc::LengthUnit*Ifc::LengthUnit);
std::cout << "This window has an area of " << area << "m2" << std::endl;
const double area = window->OverallWidth()*window->OverallHeight();
std::cout << "The area of this window is " << area << std::endl;
}
}