mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-19 11:43:53 +00:00
Work towards v1.0 data model with encapsulated weak_ptr as basis for instances
This commit is contained in:
@@ -49,18 +49,18 @@ namespace {
|
||||
}
|
||||
*/
|
||||
|
||||
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSweptDiskSolid* inst) {
|
||||
auto loop = taxonomy::cast<taxonomy::loop>(map(inst->Directrix()));
|
||||
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSweptDiskSolid& inst) {
|
||||
auto loop = taxonomy::cast<taxonomy::loop>(map(inst.Directrix()));
|
||||
|
||||
// Start- EndParam became optional in IFC4
|
||||
#ifdef SCHEMA_IfcSweptDiskSolid_StartParam_IS_OPTIONAL
|
||||
auto sp = inst->StartParam();
|
||||
auto ep = inst->EndParam();
|
||||
auto sp = inst.StartParam();
|
||||
auto ep = inst.EndParam();
|
||||
#else
|
||||
boost::optional<double> sp, ep;
|
||||
std::optional<double> sp, ep;
|
||||
try {
|
||||
sp = inst->StartParam();
|
||||
ep = inst->EndParam();
|
||||
sp = inst.StartParam();
|
||||
ep = inst.EndParam();
|
||||
} catch (const IfcParse::IfcException& e) {
|
||||
Logger::Warning(e);
|
||||
}
|
||||
@@ -69,19 +69,19 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSweptDiskSolid* inst) {
|
||||
const double tol = settings_.get<settings::Precision>().get();
|
||||
|
||||
#ifdef SCHEMA_HAS_IfcSweptDiskSolidPolygonal
|
||||
if (inst->as<IfcSchema::IfcSweptDiskSolidPolygonal>()) {
|
||||
auto fr = inst->as<IfcSchema::IfcSweptDiskSolidPolygonal>()->FilletRadius();
|
||||
if (inst.as<IfcSchema::IfcSweptDiskSolidPolygonal>()) {
|
||||
auto fr = inst.as<IfcSchema::IfcSweptDiskSolidPolygonal>().FilletRadius();
|
||||
if (fr && *fr > tol) {
|
||||
fillet_loop(loop, *fr);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
std::vector<double> radii = { inst->Radius() * length_unit_ };
|
||||
std::vector<double> radii = { inst.Radius() * length_unit_ };
|
||||
|
||||
if (inst->InnerRadius()) {
|
||||
if (inst.InnerRadius()) {
|
||||
// Subtraction of pipes with small radii is unstable.
|
||||
radii.push_back(*inst->InnerRadius() * length_unit_);
|
||||
radii.push_back(*inst.InnerRadius() * length_unit_);
|
||||
}
|
||||
|
||||
auto f = taxonomy::make<taxonomy::face>();
|
||||
@@ -117,9 +117,9 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSweptDiskSolid* inst) {
|
||||
|
||||
TopoDS_Wire wire, section1, section2;
|
||||
|
||||
bool hasInnerRadius = !!inst->InnerRadius();
|
||||
bool hasInnerRadius = !!inst.InnerRadius();
|
||||
|
||||
if (!convert_wire(inst->Directrix(), wire)) {
|
||||
if (!convert_wire(inst.Directrix(), wire)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -151,8 +151,8 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSweptDiskSolid* inst) {
|
||||
double fillet = 0.;
|
||||
|
||||
#ifdef SCHEMA_HAS_IfcSweptDiskSolidPolygonal
|
||||
if (inst->as<IfcSchema::IfcSweptDiskSolidPolygonal>()) {
|
||||
auto fr = inst->as<IfcSchema::IfcSweptDiskSolidPolygonal>()->FilletRadius();
|
||||
if (inst.as<IfcSchema::IfcSweptDiskSolidPolygonal>()) {
|
||||
auto fr = inst.as<IfcSchema::IfcSweptDiskSolidPolygonal>()->FilletRadius();
|
||||
if (fr) {
|
||||
fillet = *fr;
|
||||
}
|
||||
@@ -274,7 +274,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSweptDiskSolid* inst) {
|
||||
// made that the parametric range over which to be swept matches the IfcCurve in
|
||||
// its entirety.
|
||||
|
||||
util::process_sweep(wire, inst->Radius() * length_unit_, shape);
|
||||
util::process_sweep(wire, inst.Radius() * length_unit_, shape);
|
||||
|
||||
if (shape.IsNull()) {
|
||||
return false;
|
||||
@@ -284,7 +284,7 @@ taxonomy::ptr mapping::map_impl(const IfcSchema::IfcSweptDiskSolid* inst) {
|
||||
|
||||
if (hasInnerRadius) {
|
||||
// Subtraction of pipes with small radii is unstable.
|
||||
r2 = *inst->InnerRadius() * length_unit_;
|
||||
r2 = *inst.InnerRadius() * length_unit_;
|
||||
}
|
||||
|
||||
if (r2 > getValue(GV_PRECISION) * 10.) {
|
||||
|
||||
Reference in New Issue
Block a user