mirror of https://github.com/CGAL/cgal
Add code for translation of Plane_3 and move generic code down to the rep
This commit is contained in:
parent
91ea4909c2
commit
153413e8d5
|
|
@ -143,17 +143,7 @@ public:
|
|||
|
||||
Plane_3
|
||||
transform(const Plane_3& p) const
|
||||
{
|
||||
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()));
|
||||
}
|
||||
{ return this->Ptr()->transform(p); }
|
||||
|
||||
Plane_3
|
||||
operator()(const Plane_3& p) const
|
||||
|
|
|
|||
|
|
@ -134,7 +134,12 @@ public:
|
|||
|
||||
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()));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -57,9 +57,13 @@ public:
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue