MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / as_compound

Method as_compound

src/ifcgeom/IfcGeomRepresentation.cpp:56–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56IfcGeom::ConversionResultShape* IfcGeom::Representation::BRep::as_compound(bool force_meters) const {
57 ConversionResultShape* accum = nullptr;
58
59 for (auto it = begin(); it != end(); ++it) {
60 double unit_scale = 1.0;
61 if (!force_meters && settings().get<ifcopenshell::geometry::settings::ConvertBackUnits>().get()) {
62 unit_scale = 1.0 / settings().get<ifcopenshell::geometry::settings::LengthUnit>().get();
63 }
64 auto s = it->apply_transform(unit_scale);
65 if (accum) {
66 auto n = accum->concat(s);
67 delete s;
68 delete accum;
69 accum = n;
70 } else {
71 accum = s->wrap_in_compound();
72 }
73 }
74
75 return accum;
76}
77
78bool IfcGeom::Representation::BRep::calculate_surface_area(double& area) const {
79 std::unique_ptr<ConversionResultShape> s(as_compound());

Callers 7

writeMethod · 0.80
writeMethod · 0.80
writeMethod · 0.80
SerializationMethod · 0.80
selectMethod · 0.80
add_elementMethod · 0.80
QuantityWriter_v1Method · 0.80

Calls 6

beginFunction · 0.70
endFunction · 0.70
settingsClass · 0.50
getMethod · 0.45
concatMethod · 0.45
wrap_in_compoundMethod · 0.45

Tested by

no test coverage detected