mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
Make Base::data() private, file::add(..., id)
This commit is contained in:
@@ -72,7 +72,7 @@ namespace IfcGeom {
|
||||
// schema.
|
||||
// @todo pass settings
|
||||
ifcopenshell::geometry::Settings s;
|
||||
static auto mapping = ifcopenshell::geometry::impl::mapping_implementations().construct(prod.data()->file(), s);
|
||||
static auto mapping = ifcopenshell::geometry::impl::mapping_implementations().construct(prod.file(), s);
|
||||
while ((parent = mapping->get_decomposing_entity(current, traverse_openings))) {
|
||||
if (pred(parent)) {
|
||||
return true;
|
||||
@@ -180,7 +180,7 @@ namespace IfcGeom {
|
||||
bool match(express::Base prod) const {
|
||||
// @todo
|
||||
ifcopenshell::geometry::Settings s;
|
||||
static auto mapping = ifcopenshell::geometry::impl::mapping_implementations().construct(prod.data()->file(), s);
|
||||
static auto mapping = ifcopenshell::geometry::impl::mapping_implementations().construct(prod.file(), s);
|
||||
layer_map_t layers = mapping->get_layers(prod);
|
||||
return std::find_if(layers.begin(), layers.end(), wildcards_match(values)) != layers.end();
|
||||
}
|
||||
|
||||
@@ -295,7 +295,7 @@ bool OpenCascadeKernel::convert(const taxonomy::loop::ptr loop, TopoDS_Wire& wir
|
||||
bool force_close = false;
|
||||
if (loop->instance && loop->instance.as<express::Entity>()) {
|
||||
auto inst = loop->instance.as<express::Entity>();
|
||||
auto file = loop->instance.as<express::Entity>().data()->file();
|
||||
auto file = loop->instance.as<express::Entity>().file();
|
||||
auto profile = file->getInverse(inst.id(), file->schema()->declaration_by_name("IfcProfileDef"), -1);
|
||||
force_close = profile.size() > 0;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcCompositeCurve& inst) {
|
||||
}
|
||||
|
||||
if (spans.empty()) {
|
||||
std::vector<express::Entity> profile = inst.data()->file()->getInverse(inst.id(), &IfcSchema::IfcProfileDef::Class(), -1);
|
||||
std::vector<express::Entity> profile = inst.file()->getInverse(inst.id(), &IfcSchema::IfcProfileDef::Class(), -1);
|
||||
const bool force_close = !profile.empty();
|
||||
loop->closed = force_close;
|
||||
loop->instance = inst;
|
||||
|
||||
@@ -115,9 +115,9 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcTrimmedCurve& inst) {
|
||||
// or trimmed segment would be whether there are other curve segments or this
|
||||
// is the only one.
|
||||
std::optional<size_t> num_segments;
|
||||
auto segment = inst.data()->file()->getInverse(inst.id(), & IfcSchema::IfcCompositeCurveSegment::Class(), -1);
|
||||
auto segment = inst.file()->getInverse(inst.id(), & IfcSchema::IfcCompositeCurveSegment::Class(), -1);
|
||||
if (segment.size() == 1) {
|
||||
auto comp = segment.front().data()->file()->getInverse(segment.front().id(), &IfcSchema::IfcCompositeCurve::Class(), -1);
|
||||
auto comp = segment.front().file()->getInverse(segment.front().id(), &IfcSchema::IfcCompositeCurve::Class(), -1);
|
||||
if (comp.size() == 1) {
|
||||
num_segments = comp.front().as<IfcSchema::IfcCompositeCurve>().Segments().size();
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ std::vector<IfcSchema::IfcProduct> mapping::products_represented_by(const IfcSch
|
||||
|
||||
// IfcProductRepresentation also lacks the INVERSE relation to IfcProduct
|
||||
// Let's find the IfcProducts that reference the IfcProductRepresentation anyway
|
||||
auto invs = prodrep.data()->file()->getInverse(prodrep.id(), &IfcSchema::IfcProduct::Class(), -1);
|
||||
auto invs = prodrep.file()->getInverse(prodrep.id(), &IfcSchema::IfcProduct::Class(), -1);
|
||||
for (auto& inv : invs) {
|
||||
products.push_back(inv.as<IfcSchema::IfcProduct>());
|
||||
}
|
||||
@@ -91,12 +91,12 @@ std::vector<IfcSchema::IfcProduct> mapping::products_represented_by(const IfcSch
|
||||
continue;
|
||||
}
|
||||
|
||||
auto reps = item.data()->file()->getInverse(item.id(), (&IfcSchema::IfcRepresentation::Class()), -1);
|
||||
auto reps = item.file()->getInverse(item.id(), (&IfcSchema::IfcRepresentation::Class()), -1);
|
||||
for (auto& rep : reps) {
|
||||
if (rep.as<IfcSchema::IfcRepresentation>().Items().size() != 1) continue;
|
||||
std::vector<IfcSchema::IfcProductRepresentation> prodreps_mapped = rep.as<IfcSchema::IfcRepresentation>().OfProductRepresentation();
|
||||
for (auto& prm : prodreps_mapped) {
|
||||
auto ps = prm.data()->file()->getInverse(prm.id(), (&IfcSchema::IfcProduct::Class()), -1);
|
||||
auto ps = prm.file()->getInverse(prm.id(), (&IfcSchema::IfcProduct::Class()), -1);
|
||||
for (auto& p : ps) {
|
||||
products.push_back(p.as<IfcSchema::IfcProduct>());
|
||||
}
|
||||
@@ -783,8 +783,8 @@ express::Base mapping::get_decomposing_entity(const express::Base& inst, bool in
|
||||
|
||||
/* Parent decompositions to the RelatingObject */
|
||||
if (!parent) {
|
||||
std::vector<express::Entity> parents = product.data()->file()->getInverse(product.id(), (&IfcSchema::IfcRelAggregates::Class()), -1);
|
||||
auto nests = product.data()->file()->getInverse(product.id(), (&IfcSchema::IfcRelNests::Class()), -1);
|
||||
std::vector<express::Entity> parents = product.file()->getInverse(product.id(), (&IfcSchema::IfcRelAggregates::Class()), -1);
|
||||
auto nests = product.file()->getInverse(product.id(), (&IfcSchema::IfcRelNests::Class()), -1);
|
||||
parents.insert(parents.end(), nests.begin(), nests.end());
|
||||
for (auto it = parents.begin(); it != parents.end(); ++it) {
|
||||
IfcSchema::IfcRelDecomposes decompose = (*it).as<IfcSchema::IfcRelDecomposes>();
|
||||
|
||||
Reference in New Issue
Block a user