Add code for translation of Plane_3 and move generic code down to the rep

This commit is contained in:
Andreas Fabri 2021-04-15 13:58:33 +01:00
parent 91ea4909c2
commit 153413e8d5
3 changed files with 13 additions and 14 deletions

View File

@ -143,17 +143,7 @@ public:
Plane_3 Plane_3
transform(const Plane_3& p) const transform(const Plane_3& p) const
{ { return this->Ptr()->transform(p); }
if(is_scaling()){
return this->Ptr()->transform(p);
}
if (is_even())
return Plane_3(transform(p.point()),
transpose().inverse().transform(p.orthogonal_direction()));
else
return Plane_3(transform(p.point()),
- transpose().inverse().transform(p.orthogonal_direction()));
}
Plane_3 Plane_3
operator()(const Plane_3& p) const operator()(const Plane_3& p) const

View File

@ -134,7 +134,12 @@ public:
virtual Plane_3 transform(const Plane_3& p) const virtual Plane_3 transform(const Plane_3& p) const
{ {
return p; // fix or never call if (is_even())
return Plane_3(transform(p.point()),
transpose().inverse().transform(p.orthogonal_direction()));
else
return Plane_3(transform(p.point()),
- transpose().inverse().transform(p.orthogonal_direction()));
} }

View File

@ -57,9 +57,13 @@ public:
return d; return d;
} }
virtual Plane_3 transform(const Plane_3 &d) const virtual Plane_3 transform(const Plane_3 &p) const
{ {
return d; // fix or never call it // direction ( which is (p.a(), p.b(), p.c())) does not change
return Plane_3(p.a(),
p.b(),
p.c(),
p.d() - ( p.a()*translationvector_.x() + p.b()*translationvector_.y() + p.c()*translationvector_.z()));
} }
virtual Aff_transformation_3 operator*(const Transformation_base_3 &t) const virtual Aff_transformation_3 operator*(const Transformation_base_3 &t) const