/ifcplusplus

IfcPlusPlus is an open source C++ class model, as well as a reader and writer for IFC files in STEP format. Features: Easy and efficient memory management using smart pointers. Parallel reader for very fast parsing on multi-core CPU's. Additionally, there's a simple IFC viewer application, using Qt and OpenSceneGraph. It can be used as starting point for all kinds of applications around the open building model standard IFC.

Primary LanguageC++MIT LicenseMIT

ABOUT IFC++

IFC++ is an open source IFC implementation for C++. It is very fast, but it has not the lowest possible memory footprint, because it has a complete class model.

Benefits of the complete class model are (among others):

  • you can easily instantiate objects and access member variables, for example:
  shared_ptr<IfcCartesianPoint> ifcPoint = make_shared<IfcCartesianPoint>();
  shared_ptr<IfcPolyLoop> polyLoop = make_shared<IfcPolyLoop>()
  polyLoop->m_Polygon.push_back(ifcPoint);
  • you can navigate the model easily by accessing member variables directly, including inverse attributes:
shared_ptr<IfcBuildingStorey> currentBuildingStorey = ...;
for (auto it : currentBuildingStorey->m_IsDecomposedBy_inverse)
{
   shared_ptr<IfcRelAggregates> relAggregates(it);

   for (auto it2 : relAggregates->m_RelatedObjects)
   {
      shared_ptr<IfcObjectDefinition> child_obj = (it2);
      shared_ptr<IfcWallStandardCase> wall = dynamic_pointer_cast<IfcWallStandardCase>(child_obj);
      if(wall)
      {
         // do something with wall
      }
    }
 }

Inverse attribute pointers are automatically generated by IFC++ for all object references in the model.

  • casting is possible for all types:
 shared_ptr<IfcPropertySet> pset = dynamic_pointer_cast<IfcPropertySet>(relatingPropertyDefinition);
  • Professional support is available for bug fixing or custom implementations on www.ifcquery.com.

License

The project is published under the MIT license, which means that you can use it for any purpose, personal or commercial. There is no obligation to publish your source code.

Details and download of executable

Open source example application for Qt here available: https://github.com/ifcquery/ifcplusplus/releases

How to build the library and example application on Windows and Linux

https://github.com/ifcquery/ifcplusplus/wiki/Build-instructions

Screenshot of steel frame model in the example viewer

980 000 entities loaded, 8000 with geometric representation. Loaded in < 4 sec. on a standard PC, including geometry. Steel frame model