mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 14:26:30 +00:00
map(vector<opaque_4>) prototype
This commit is contained in:
@@ -220,6 +220,7 @@ namespace IfcGeom {
|
|||||||
virtual ConversionResultShape* intersect(ConversionResultShape*) = 0;
|
virtual ConversionResultShape* intersect(ConversionResultShape*) = 0;
|
||||||
|
|
||||||
virtual void map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to) = 0;
|
virtual void map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to) = 0;
|
||||||
|
virtual void map(const std::vector<OpaqueCoordinate<4>>& from, const std::vector<OpaqueCoordinate<4>>& to) = 0;
|
||||||
virtual ConversionResultShape* moved(ifcopenshell::geometry::taxonomy::matrix4::ptr) const = 0;
|
virtual ConversionResultShape* moved(ifcopenshell::geometry::taxonomy::matrix4::ptr) const = 0;
|
||||||
|
|
||||||
virtual ~ConversionResultShape() {}
|
virtual ~ConversionResultShape() {}
|
||||||
|
|||||||
@@ -470,6 +470,10 @@ void ifcopenshell::geometry::CgalShape::map(OpaqueCoordinate<4>& from, OpaqueCoo
|
|||||||
throw std::runtime_error("Not implemented");
|
throw std::runtime_error("Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ifcopenshell::geometry::CgalShape::map(const std::vector<OpaqueCoordinate<4>>& from, const std::vector<OpaqueCoordinate<4>>& to) {
|
||||||
|
throw std::runtime_error("Not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef IFOPSH_SIMPLE_KERNEL
|
#ifndef IFOPSH_SIMPLE_KERNEL
|
||||||
|
|
||||||
void ifcopenshell::geometry::CgalShapeHalfSpaceDecomposition::Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int surface_style_id) const {
|
void ifcopenshell::geometry::CgalShapeHalfSpaceDecomposition::Triangulate(ifcopenshell::geometry::Settings settings, const ifcopenshell::geometry::taxonomy::matrix4& place, IfcGeom::Representation::Triangulation* t, int surface_style_id) const {
|
||||||
@@ -653,4 +657,33 @@ void ifcopenshell::geometry::CgalShapeHalfSpaceDecomposition::map(OpaqueCoordina
|
|||||||
shape_ = std::move(nw);
|
shape_ = std::move(nw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ifcopenshell::geometry::CgalShapeHalfSpaceDecomposition::map(const std::vector<OpaqueCoordinate<4>>& froms, const std::vector<OpaqueCoordinate<4>>& tos) {
|
||||||
|
plane_map<Kernel_> mp;
|
||||||
|
if (froms.size() != tos.size()) {
|
||||||
|
throw std::runtime_error("Expected equal size");
|
||||||
|
}
|
||||||
|
auto it = froms.begin();
|
||||||
|
auto jt = tos.begin();
|
||||||
|
for (; it < froms.end(); ++it, ++jt) {
|
||||||
|
auto& from = *it;
|
||||||
|
auto& to = *jt;
|
||||||
|
mp.insert({
|
||||||
|
CGAL::Plane_3<Kernel_>(
|
||||||
|
std::static_pointer_cast<NumberEpeck>(from.values[0])->value(),
|
||||||
|
std::static_pointer_cast<NumberEpeck>(from.values[1])->value(),
|
||||||
|
std::static_pointer_cast<NumberEpeck>(from.values[2])->value(),
|
||||||
|
std::static_pointer_cast<NumberEpeck>(from.values[3])->value()
|
||||||
|
),
|
||||||
|
CGAL::Plane_3<Kernel_>(
|
||||||
|
std::static_pointer_cast<NumberEpeck>(to.values[0])->value(),
|
||||||
|
std::static_pointer_cast<NumberEpeck>(to.values[1])->value(),
|
||||||
|
std::static_pointer_cast<NumberEpeck>(to.values[2])->value(),
|
||||||
|
std::static_pointer_cast<NumberEpeck>(to.values[3])->value()
|
||||||
|
)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
auto nw = shape_->map(mp);
|
||||||
|
shape_ = std::move(nw);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -237,6 +237,7 @@ namespace ifcopenshell { namespace geometry {
|
|||||||
virtual ConversionResultShape* intersect(ConversionResultShape*);
|
virtual ConversionResultShape* intersect(ConversionResultShape*);
|
||||||
|
|
||||||
virtual void map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to);
|
virtual void map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to);
|
||||||
|
virtual void map(const std::vector<OpaqueCoordinate<4>>& from, const std::vector<OpaqueCoordinate<4>>& to);
|
||||||
virtual ConversionResultShape* moved(ifcopenshell::geometry::taxonomy::matrix4::ptr) const;
|
virtual ConversionResultShape* moved(ifcopenshell::geometry::taxonomy::matrix4::ptr) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -293,6 +294,7 @@ namespace ifcopenshell { namespace geometry {
|
|||||||
virtual ConversionResultShape* intersect(ConversionResultShape*);
|
virtual ConversionResultShape* intersect(ConversionResultShape*);
|
||||||
|
|
||||||
virtual void map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to);
|
virtual void map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to);
|
||||||
|
virtual void map(const std::vector<OpaqueCoordinate<4>>& from, const std::vector<OpaqueCoordinate<4>>& to);
|
||||||
virtual ConversionResultShape* moved(ifcopenshell::geometry::taxonomy::matrix4::ptr) const;
|
virtual ConversionResultShape* moved(ifcopenshell::geometry::taxonomy::matrix4::ptr) const;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -422,3 +422,7 @@ ConversionResultShape* ifcopenshell::geometry::OpenCascadeShape::moved(ifcopensh
|
|||||||
void ifcopenshell::geometry::OpenCascadeShape::map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to) {
|
void ifcopenshell::geometry::OpenCascadeShape::map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to) {
|
||||||
throw std::runtime_error("Not implemented");
|
throw std::runtime_error("Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ifcopenshell::geometry::OpenCascadeShape::map(const std::vector<OpaqueCoordinate<4>>& from, const std::vector<OpaqueCoordinate<4>>& to) {
|
||||||
|
throw std::runtime_error("Not implemented");
|
||||||
|
}
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ namespace ifcopenshell {
|
|||||||
virtual ConversionResultShape* intersect(ConversionResultShape*);
|
virtual ConversionResultShape* intersect(ConversionResultShape*);
|
||||||
|
|
||||||
virtual void map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to);
|
virtual void map(OpaqueCoordinate<4>& from, OpaqueCoordinate<4>& to);
|
||||||
|
virtual void map(const std::vector<OpaqueCoordinate<4>>& from, const std::vector<OpaqueCoordinate<4>>& to);
|
||||||
virtual ConversionResultShape* moved(ifcopenshell::geometry::taxonomy::matrix4::ptr) const;
|
virtual ConversionResultShape* moved(ifcopenshell::geometry::taxonomy::matrix4::ptr) const;
|
||||||
private:
|
private:
|
||||||
TopoDS_Shape shape_;
|
TopoDS_Shape shape_;
|
||||||
|
|||||||
Reference in New Issue
Block a user