Major update: taxonomy shared pointers, collection type safety, work towards hashing

This commit is contained in:
Thomas Krijnen
2023-07-27 16:42:06 +08:00
parent 98a73f1646
commit 65a5646bf0
122 changed files with 1669 additions and 1203 deletions
+9 -9
View File
@@ -21,7 +21,7 @@
#define mapping POSTFIX_SCHEMA(mapping)
using namespace ifcopenshell::geometry;
taxonomy::item* mapping::map_impl(const IfcSchema::IfcEllipseProfileDef* inst) {
taxonomy::ptr mapping::map_impl(const IfcSchema::IfcEllipseProfileDef* inst) {
double rx = inst->SemiAxis1() * length_unit_;
double ry = inst->SemiAxis2() * length_unit_;
const double tol = conv_settings_.getValue(ConversionSettings::GV_PRECISION);
@@ -32,19 +32,19 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcEllipseProfileDef* inst) {
const bool rotated = ry > rx;
taxonomy::matrix4 m4;
taxonomy::matrix4::ptr m4;
bool has_position = true;
#ifdef SCHEMA_IfcParameterizedProfileDef_Position_IS_OPTIONAL
has_position = !!inst->Position();
#endif
if (has_position) {
m4 = as<taxonomy::matrix4>(map(inst->Position()));
m4 = taxonomy::cast<taxonomy::matrix4>(map(inst->Position()));
}
if (ry > rx) {
// @todo is a copy necesary here or can this be done in place?
auto m4_copy = m4;
m4.components() <<
auto m4_copy = *m4;
m4->components() <<
-m4_copy.components().col(1),
m4_copy.components().col(0),
m4_copy.components().col(2),
@@ -52,10 +52,10 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcEllipseProfileDef* inst) {
std::swap(rx, ry);
}
auto fc = new taxonomy::face;
auto lp = new taxonomy::loop;
auto ed = new taxonomy::edge;
auto el = new taxonomy::ellipse;
auto fc = taxonomy::make<taxonomy::face>();
auto lp = taxonomy::make<taxonomy::loop>();
auto ed = taxonomy::make<taxonomy::edge>();
auto el = taxonomy::make<taxonomy::ellipse>();
el->radius = rx;
el->radius2 = ry;
ed->basis = el;