From b76dad682aea01b27ecbf0ba96bd238257594fff Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Sun, 18 Feb 2024 12:02:18 +0100 Subject: [PATCH] item_id() --- src/ifcgeom/IfcGeomRepresentation.cpp | 8 ++++++++ src/ifcgeom/IfcGeomRepresentation.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/ifcgeom/IfcGeomRepresentation.cpp b/src/ifcgeom/IfcGeomRepresentation.cpp index 1c6e31813a..54ec30ea7f 100644 --- a/src/ifcgeom/IfcGeomRepresentation.cpp +++ b/src/ifcgeom/IfcGeomRepresentation.cpp @@ -423,3 +423,11 @@ const IfcGeom::ConversionResultShape* IfcGeom::Representation::BRep::item(int i) return nullptr; } } + +int IfcGeom::Representation::BRep::item_id(int i) const { + if (i >= 0 && i < shapes_.size()) { + return shapes_[i].ItemId(); + } else { + return 0; + } +} diff --git a/src/ifcgeom/IfcGeomRepresentation.h b/src/ifcgeom/IfcGeomRepresentation.h index d071cfcce7..5cfd3d0bc2 100644 --- a/src/ifcgeom/IfcGeomRepresentation.h +++ b/src/ifcgeom/IfcGeomRepresentation.h @@ -72,6 +72,7 @@ namespace IfcGeom { int size() const { return shapes_.size(); } const IfcGeom::ConversionResultShape* item(int i) const; + int item_id(int i) const; }; class IFC_GEOM_API Serialization : public Representation {