mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
#3098 Move boost::type application to curve to template function
This commit is contained in:
@@ -63,14 +63,10 @@ public:
|
||||
|
||||
#ifdef SCHEMA_HAS_IfcClothoid
|
||||
// Then initialize Function(double) -> Vector3, by means of IfcCurve subtypes
|
||||
void operator()(boost::type<IfcSchema::IfcClothoid>) {
|
||||
if (!curve_->as<IfcSchema::IfcClothoid>()) {
|
||||
return;
|
||||
}
|
||||
|
||||
void operator()(IfcSchema::IfcClothoid* c) {
|
||||
// @todo verify
|
||||
auto L = start_ + length_;
|
||||
auto A = curve_->as<IfcSchema::IfcClothoid>()->ClothoidConstant();
|
||||
auto A = c->ClothoidConstant();
|
||||
auto R = A * A / L;
|
||||
auto RL = R * L;
|
||||
|
||||
@@ -93,13 +89,18 @@ public:
|
||||
#endif
|
||||
|
||||
// Another IfcCurve subtype
|
||||
void operator()(boost::type<IfcSchema::IfcLine>) {
|
||||
if (!curve_->as<IfcSchema::IfcLine>()) {
|
||||
return;
|
||||
}
|
||||
void operator()(IfcSchema::IfcLine*) {
|
||||
throw std::runtime_error("not implemented");
|
||||
}
|
||||
|
||||
// Take the boost::type value from mpl::for_each and test it against our curve instance
|
||||
template <typename T>
|
||||
void operator()(boost::type<T>) {
|
||||
if (curve_->as<T>()) {
|
||||
(*this)(curve_->as<T>());
|
||||
}
|
||||
}
|
||||
|
||||
// Then, with function populated based on IfcCurve subtype, we can evaluate to points
|
||||
Eigen::Vector3d operator()(double u) {
|
||||
if (eval_) {
|
||||
|
||||
Reference in New Issue
Block a user