Skip to content

Commit f5b2358

Browse files
committed
Make Base::data() private, file::add(..., id)
1 parent f9c791d commit f5b2358

25 files changed

Lines changed: 1929 additions & 1957 deletions

‎src/ifcgeom/IfcGeomFilter.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ namespace IfcGeom {
7272
// schema.
7373
// @todo pass settings
7474
ifcopenshell::geometry::Settings s;
75-
static auto mapping = ifcopenshell::geometry::impl::mapping_implementations().construct(prod.data()->file(), s);
75+
static auto mapping = ifcopenshell::geometry::impl::mapping_implementations().construct(prod.file(), s);
7676
while ((parent = mapping->get_decomposing_entity(current, traverse_openings))) {
7777
if (pred(parent)) {
7878
return true;
@@ -180,7 +180,7 @@ namespace IfcGeom {
180180
bool match(express::Base prod) const {
181181
// @todo
182182
ifcopenshell::geometry::Settings s;
183-
static auto mapping = ifcopenshell::geometry::impl::mapping_implementations().construct(prod.data()->file(), s);
183+
static auto mapping = ifcopenshell::geometry::impl::mapping_implementations().construct(prod.file(), s);
184184
layer_map_t layers = mapping->get_layers(prod);
185185
return std::find_if(layers.begin(), layers.end(), wildcards_match(values)) != layers.end();
186186
}

‎src/ifcgeom/kernels/opencascade/loop.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loop::ptr loop, TopoDS_Wire& wir
295295
bool force_close = false;
296296
if (loop->instance && loop->instance.as<express::Entity>()) {
297297
auto inst = loop->instance.as<express::Entity>();
298-
auto file = loop->instance.as<express::Entity>().data()->file();
298+
auto file = loop->instance.as<express::Entity>().file();
299299
auto profile = file->getInverse(inst.id(), file->schema()->declaration_by_name("IfcProfileDef"), -1);
300300
force_close = profile.size() > 0;
301301
}

‎src/ifcgeom/mapping/IfcCompositeCurve.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve& inst) {
9595
}
9696

9797
if (spans.empty()) {
98-
std::vector<express::Entity> profile = inst.data()->file()->getInverse(inst.id(), &IfcSchema::IfcProfileDef::Class(), -1);
98+
std::vector<express::Entity> profile = inst.file()->getInverse(inst.id(), &IfcSchema::IfcProfileDef::Class(), -1);
9999
const bool force_close = !profile.empty();
100100
loop->closed = force_close;
101101
loop->instance = inst;

‎src/ifcgeom/mapping/IfcTrimmedCurve.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcTrimmedCurve& inst) {
115115
// or trimmed segment would be whether there are other curve segments or this
116116
// is the only one.
117117
std::optional<size_t> num_segments;
118-
auto segment = inst.data()->file()->getInverse(inst.id(), & IfcSchema::IfcCompositeCurveSegment::Class(), -1);
118+
auto segment = inst.file()->getInverse(inst.id(), & IfcSchema::IfcCompositeCurveSegment::Class(), -1);
119119
if (segment.size() == 1) {
120-
auto comp = segment.front().data()->file()->getInverse(segment.front().id(), &IfcSchema::IfcCompositeCurve::Class(), -1);
120+
auto comp = segment.front().file()->getInverse(segment.front().id(), &IfcSchema::IfcCompositeCurve::Class(), -1);
121121
if (comp.size() == 1) {
122122
num_segments = comp.front().as<IfcSchema::IfcCompositeCurve>().Segments().size();
123123
}

‎src/ifcgeom/mapping/mapping.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ std::vector<IfcSchema::IfcProduct> mapping::products_represented_by(const IfcSch
5858

5959
// IfcProductRepresentation also lacks the INVERSE relation to IfcProduct
6060
// Let's find the IfcProducts that reference the IfcProductRepresentation anyway
61-
auto invs = prodrep.data()->file()->getInverse(prodrep.id(), &IfcSchema::IfcProduct::Class(), -1);
61+
auto invs = prodrep.file()->getInverse(prodrep.id(), &IfcSchema::IfcProduct::Class(), -1);
6262
for (auto& inv : invs) {
6363
products.push_back(inv.as<IfcSchema::IfcProduct>());
6464
}
@@ -91,12 +91,12 @@ std::vector<IfcSchema::IfcProduct> mapping::products_represented_by(const IfcSch
9191
continue;
9292
}
9393

94-
auto reps = item.data()->file()->getInverse(item.id(), (&IfcSchema::IfcRepresentation::Class()), -1);
94+
auto reps = item.file()->getInverse(item.id(), (&IfcSchema::IfcRepresentation::Class()), -1);
9595
for (auto& rep : reps) {
9696
if (rep.as<IfcSchema::IfcRepresentation>().Items().size() != 1) continue;
9797
std::vector<IfcSchema::IfcProductRepresentation> prodreps_mapped = rep.as<IfcSchema::IfcRepresentation>().OfProductRepresentation();
9898
for (auto& prm : prodreps_mapped) {
99-
auto ps = prm.data()->file()->getInverse(prm.id(), (&IfcSchema::IfcProduct::Class()), -1);
99+
auto ps = prm.file()->getInverse(prm.id(), (&IfcSchema::IfcProduct::Class()), -1);
100100
for (auto& p : ps) {
101101
products.push_back(p.as<IfcSchema::IfcProduct>());
102102
}
@@ -783,8 +783,8 @@ express::Base mapping::get_decomposing_entity(const express::Base& inst, bool in
783783

784784
/* Parent decompositions to the RelatingObject */
785785
if (!parent) {
786-
std::vector<express::Entity> parents = product.data()->file()->getInverse(product.id(), (&IfcSchema::IfcRelAggregates::Class()), -1);
787-
auto nests = product.data()->file()->getInverse(product.id(), (&IfcSchema::IfcRelNests::Class()), -1);
786+
std::vector<express::Entity> parents = product.file()->getInverse(product.id(), (&IfcSchema::IfcRelAggregates::Class()), -1);
787+
auto nests = product.file()->getInverse(product.id(), (&IfcSchema::IfcRelNests::Class()), -1);
788788
parents.insert(parents.end(), nests.begin(), nests.end());
789789
for (auto it = parents.begin(); it != parents.end(); ++it) {
790790
IfcSchema::IfcRelDecomposes decompose = (*it).as<IfcSchema::IfcRelDecomposes>();

0 commit comments

Comments
 (0)