diff --git a/src/ifcgeom/IfcGeom.cpp b/src/ifcgeom/IfcGeom.cpp index ae73bcbe3a..f235d9b07a 100644 --- a/src/ifcgeom/IfcGeom.cpp +++ b/src/ifcgeom/IfcGeom.cpp @@ -985,12 +985,12 @@ std::pair IfcGeom::Kernel::initializeUnits(IfcSchema::IfcUn bool length_unit_encountered = false, angle_unit_encountered = false; try { - aggregate_of_instance::ptr units = unit_assignment->Units(); + auto units = unit_assignment->Units(); if (!units || !units->size()) { Logger::Warning("No unit information found"); } else { - for (aggregate_of_instance::it it = units->begin(); it != units->end(); ++it) { - IfcUtil::IfcBaseClass* base = *it; + for (auto it = units->begin(); it != units->end(); ++it) { + IfcSchema::IfcUnit* base = *it; if (base->declaration().is(IfcSchema::IfcNamedUnit::Class())) { IfcSchema::IfcNamedUnit* named_unit = base->as(); if (named_unit->UnitType() == IfcSchema::IfcUnitEnum::IfcUnit_LENGTHUNIT || diff --git a/src/ifcgeom/IfcGeom.h b/src/ifcgeom/IfcGeom.h index 86b7ec2a8d..41cbce4802 100644 --- a/src/ifcgeom/IfcGeom.h +++ b/src/ifcgeom/IfcGeom.h @@ -299,8 +299,8 @@ public: std::vector prs_styles; #ifdef SCHEMA_HAS_IfcStyleAssignmentSelect - aggregate_of_instance::ptr style_assignments = si->Styles(); - for (aggregate_of_instance::it kt = style_assignments->begin(); kt != style_assignments->end(); ++kt) { + auto style_assignments = si->Styles(); + for (auto kt = style_assignments->begin(); kt != style_assignments->end(); ++kt) { // Using IfcPresentationStyleAssignment is deprecated, use the direct assignment of a subtype of IfcPresentationStyle instead. auto style_k = (*kt)->as(); @@ -345,8 +345,8 @@ public: if (style->declaration().is(IfcSchema::IfcSurfaceStyle::Class())) { IfcSchema::IfcSurfaceStyle* surface_style = (IfcSchema::IfcSurfaceStyle*) style; if (surface_style->Side() != IfcSchema::IfcSurfaceSide::IfcSurfaceSide_NEGATIVE) { - aggregate_of_instance::ptr styles_elements = surface_style->Styles(); - for (aggregate_of_instance::it mt = styles_elements->begin(); mt != styles_elements->end(); ++mt) { + auto styles_elements = surface_style->Styles(); + for (auto mt = styles_elements->begin(); mt != styles_elements->end(); ++mt) { if ((*mt)->declaration().is(T::Class())) { return std::make_pair(surface_style, (T*) *mt); } diff --git a/src/ifcgeom/IfcGeometricSet.cpp b/src/ifcgeom/IfcGeometricSet.cpp index 010fe6acb7..7b4556d439 100644 --- a/src/ifcgeom/IfcGeometricSet.cpp +++ b/src/ifcgeom/IfcGeometricSet.cpp @@ -30,11 +30,11 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcGeometricSet* l, IfcRepresenta const bool include_curves = getValue(GV_DIMENSIONALITY) != +1; const bool include_solids_and_surfaces = getValue(GV_DIMENSIONALITY) != -1; - aggregate_of_instance::ptr elements = l->Elements(); - if ( !elements->size() ) return false; + auto elements = l->Elements(); + if (!elements->size()) return false; bool part_succes = false; auto parent_style = get_style(l); - for (aggregate_of_instance::it it = elements->begin(); it != elements->end(); ++it) { + for (auto it = elements->begin(); it != elements->end(); ++it) { auto element = *it; TopoDS_Shape s; if (shape_type(element) == ST_SHAPELIST) { diff --git a/src/ifcgeom/IfcIndexedPolyCurve.cpp b/src/ifcgeom/IfcIndexedPolyCurve.cpp index 77820e6327..29ac4372ad 100644 --- a/src/ifcgeom/IfcIndexedPolyCurve.cpp +++ b/src/ifcgeom/IfcIndexedPolyCurve.cpp @@ -58,9 +58,9 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcIndexedPolyCurve* l, TopoDS_Wi double u, v; if(l->Segments()) { - aggregate_of_instance::ptr segments = *l->Segments(); - for (aggregate_of_instance::it it = segments->begin(); it != segments->end(); ++it) { - IfcUtil::IfcBaseClass* segment = *it; + auto segments = *l->Segments(); + for (auto it = segments->begin(); it != segments->end(); ++it) { + auto segment = *it; if (segment->declaration().is(IfcSchema::IfcLineIndex::Class())) { IfcSchema::IfcLineIndex* line = (IfcSchema::IfcLineIndex*) segment; std::vector indices = *line; diff --git a/src/ifcgeom/IfcShellBasedSurfaceModel.cpp b/src/ifcgeom/IfcShellBasedSurfaceModel.cpp index 8430601d6d..ed2bb79007 100644 --- a/src/ifcgeom/IfcShellBasedSurfaceModel.cpp +++ b/src/ifcgeom/IfcShellBasedSurfaceModel.cpp @@ -23,9 +23,9 @@ #define Kernel MAKE_TYPE_NAME(Kernel) bool IfcGeom::Kernel::convert(const IfcSchema::IfcShellBasedSurfaceModel* l, IfcRepresentationShapeItems& shapes) { - aggregate_of_instance::ptr shells = l->SbsmBoundary(); + auto shells = l->SbsmBoundary(); auto collective_style = get_style(l); - for( aggregate_of_instance::it it = shells->begin(); it != shells->end(); ++ it ) { + for(auto it = shells->begin(); it != shells->end(); ++ it) { TopoDS_Shape s; decltype(collective_style) shell_style; if ((*it)->declaration().is(IfcSchema::IfcRepresentationItem::Class())) { diff --git a/src/ifcgeom/IfcTrimmedCurve.cpp b/src/ifcgeom/IfcTrimmedCurve.cpp index a9f65ae539..5b2081ad3c 100644 --- a/src/ifcgeom/IfcTrimmedCurve.cpp +++ b/src/ifcgeom/IfcTrimmedCurve.cpp @@ -72,8 +72,8 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcTrimmedCurve* l, TopoDS_Wire& } bool trim_cartesian = l->MasterRepresentation() != IfcSchema::IfcTrimmingPreference::IfcTrimmingPreference_PARAMETER; - aggregate_of_instance::ptr trims1 = l->Trim1(); - aggregate_of_instance::ptr trims2 = l->Trim2(); + auto trims1 = l->Trim1(); + auto trims2 = l->Trim2(); unsigned sense_agreement = l->SenseAgreement() ? 0 : 1; double flts[2]; @@ -83,8 +83,8 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcTrimmedCurve* l, TopoDS_Wire& TopoDS_Edge e; - for ( aggregate_of_instance::it it = trims1->begin(); it != trims1->end(); it ++ ) { - IfcUtil::IfcBaseClass* i = *it; + for (auto it = trims1->begin(); it != trims1->end(); it ++ ) { + auto i = *it; if ( i->declaration().is(IfcSchema::IfcCartesianPoint::Class()) ) { IfcGeom::Kernel::convert((IfcSchema::IfcCartesianPoint*)i, pnts[sense_agreement] ); has_pnts[sense_agreement] = true; @@ -95,8 +95,8 @@ bool IfcGeom::Kernel::convert(const IfcSchema::IfcTrimmedCurve* l, TopoDS_Wire& } } - for ( aggregate_of_instance::it it = trims2->begin(); it != trims2->end(); it ++ ) { - IfcUtil::IfcBaseClass* i = *it; + for (auto it = trims2->begin(); it != trims2->end(); it ++ ) { + auto i = *it; if ( i->declaration().is(IfcSchema::IfcCartesianPoint::Class()) ) { IfcGeom::Kernel::convert((IfcSchema::IfcCartesianPoint*)i, pnts[1-sense_agreement] ); has_pnts[1-sense_agreement] = true; diff --git a/src/ifcgeom/Serialization.cpp b/src/ifcgeom/Serialization.cpp index 8eabd1732b..fe257dde93 100644 --- a/src/ifcgeom/Serialization.cpp +++ b/src/ifcgeom/Serialization.cpp @@ -395,8 +395,8 @@ int convert_to_ifc(const TopoDS_Edge& e, IfcSchema::IfcCurve*& c, bool advanced) return 0; } - aggregate_of_instance::ptr trim1(new aggregate_of_instance); - aggregate_of_instance::ptr trim2(new aggregate_of_instance); + IfcSchema::IfcTrimmingSelect::list::ptr trim1(new IfcSchema::IfcTrimmingSelect::list); + IfcSchema::IfcTrimmingSelect::list::ptr trim2(new IfcSchema::IfcTrimmingSelect::list); trim1->push(new IfcSchema::IfcParameterValue(a)); trim2->push(new IfcSchema::IfcParameterValue(b)); @@ -631,7 +631,7 @@ IfcUtil::IfcBaseClass* IfcGeom::MAKE_TYPE_NAME(serialise_)(const TopoDS_Shape& s } else { // If not, see if there is a shell - IfcSchema::IfcOpenShell::list::ptr shells(new IfcSchema::IfcOpenShell::list); + IfcSchema::IfcShell::list::ptr shells(new IfcSchema::IfcShell::list); for (TopExp_Explorer exp(shape, TopAbs_SHELL); exp.More(); exp.Next()) { IfcSchema::IfcOpenShell* shell; if (!convert_to_ifc(exp.Current(), shell, advanced)) { @@ -641,7 +641,7 @@ IfcUtil::IfcBaseClass* IfcGeom::MAKE_TYPE_NAME(serialise_)(const TopoDS_Shape& s } if (shells->size() > 0) { - items->push(new IfcSchema::IfcShellBasedSurfaceModel(shells->generalize())); + items->push(new IfcSchema::IfcShellBasedSurfaceModel(shells)); rep = new IfcSchema::IfcShapeRepresentation(0, std::string("Body"), advanced ? std::string("AdvancedBrep") : std::string("Brep"), items); } else { @@ -674,7 +674,7 @@ IfcUtil::IfcBaseClass* IfcGeom::MAKE_TYPE_NAME(serialise_)(const TopoDS_Shape& s rep = new IfcSchema::IfcShapeRepresentation(0, std::string("Axis"), std::string("Curve2D"), edges->as()); } else { // A geometric set is created as that probably (?) makes more sense in IFC - IfcSchema::IfcGeometricCurveSet* curves = new IfcSchema::IfcGeometricCurveSet(edges); + IfcSchema::IfcGeometricCurveSet* curves = new IfcSchema::IfcGeometricCurveSet(edges->as()); items->push(curves); rep = new IfcSchema::IfcShapeRepresentation(0, std::string("Axis"), std::string("GeometricCurveSet"), items->as()); } diff --git a/src/serializers/schema_dependent/XmlSerializer.cpp b/src/serializers/schema_dependent/XmlSerializer.cpp index 0d1265937c..fff4132df6 100644 --- a/src/serializers/schema_dependent/XmlSerializer.cpp +++ b/src/serializers/schema_dependent/XmlSerializer.cpp @@ -747,8 +747,8 @@ void MAKE_TYPE_NAME(XmlSerializer)::finalize() { } // Write all assigned units as XML nodes. - aggregate_of_instance::ptr unit_assignments = project->UnitsInContext()->Units(); - for (aggregate_of_instance::it it = unit_assignments->begin(); it != unit_assignments->end(); ++it) { + auto unit_assignments = project->UnitsInContext()->Units(); + for (auto it = unit_assignments->begin(); it != unit_assignments->end(); ++it) { if ((*it)->declaration().is(IfcSchema::IfcNamedUnit::Class())) { IfcSchema::IfcNamedUnit* named_unit = (*it)->as(); ptree* node = format_entity_instance(named_unit, units);