mirror of https://github.com/CGAL/cgal
Implement transposed_inverse for homogeneous plane transformations
This commit is contained in:
parent
4f62135274
commit
fc10fdb7db
|
|
@ -70,6 +70,9 @@ public:
|
||||||
virtual Plane_3
|
virtual Plane_3
|
||||||
transform(const Plane_3&) const = 0;
|
transform(const Plane_3&) const = 0;
|
||||||
|
|
||||||
|
virtual Plane_3
|
||||||
|
transform(const Plane_3&, bool, const Aff_transformation_3&) const = 0;
|
||||||
|
|
||||||
virtual Aff_transformation_3
|
virtual Aff_transformation_3
|
||||||
inverse() const = 0;
|
inverse() const = 0;
|
||||||
|
|
||||||
|
|
@ -134,6 +137,9 @@ public:
|
||||||
virtual Plane_3
|
virtual Plane_3
|
||||||
transform(const Plane_3& pl) const;
|
transform(const Plane_3& pl) const;
|
||||||
|
|
||||||
|
virtual Plane_3
|
||||||
|
transform(const Plane_3& pl, bool is_even, const Aff_transformation_3& transposed_inverse) const;
|
||||||
|
|
||||||
virtual Aff_transformation_3
|
virtual Aff_transformation_3
|
||||||
inverse() const;
|
inverse() const;
|
||||||
|
|
||||||
|
|
@ -207,6 +213,10 @@ public:
|
||||||
transform(const Plane_3& pl) const
|
transform(const Plane_3& pl) const
|
||||||
{ return pl; }
|
{ return pl; }
|
||||||
|
|
||||||
|
virtual Plane_3
|
||||||
|
transform(const Plane_3& pl, bool, const Aff_transformation_3&) const
|
||||||
|
{ return pl; }
|
||||||
|
|
||||||
virtual Aff_transformation_3
|
virtual Aff_transformation_3
|
||||||
inverse() const
|
inverse() const
|
||||||
{ return Aff_transformation_3( IDENTITY); }
|
{ return Aff_transformation_3( IDENTITY); }
|
||||||
|
|
@ -289,6 +299,12 @@ class Scaling_repH3 : public Aff_transformation_rep_baseH3<R>
|
||||||
return Plane_3(p.a()*_sf_den, p.b()*_sf_den, p.c()*_sf_den, p.d()*_sf_num);
|
return Plane_3(p.a()*_sf_den, p.b()*_sf_den, p.c()*_sf_den, p.d()*_sf_num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual Plane_3
|
||||||
|
transform(const Plane_3& p, bool, const Aff_transformation_3&) const
|
||||||
|
{
|
||||||
|
return transform(p);
|
||||||
|
}
|
||||||
|
|
||||||
virtual Aff_transformation_3
|
virtual Aff_transformation_3
|
||||||
inverse() const
|
inverse() const
|
||||||
{ return Aff_transformation_3(SCALING, _sf_den, _sf_num); }
|
{ return Aff_transformation_3(SCALING, _sf_den, _sf_num); }
|
||||||
|
|
@ -386,6 +402,9 @@ public:
|
||||||
virtual Plane_3
|
virtual Plane_3
|
||||||
transform(const Plane_3& pl) const;
|
transform(const Plane_3& pl) const;
|
||||||
|
|
||||||
|
virtual Plane_3
|
||||||
|
transform(const Plane_3& pl, bool is_even, const Aff_transformation_3& transposed_inverse) const;
|
||||||
|
|
||||||
virtual Aff_transformation_3
|
virtual Aff_transformation_3
|
||||||
inverse() const;
|
inverse() const;
|
||||||
|
|
||||||
|
|
@ -471,6 +490,9 @@ public:
|
||||||
Plane_3
|
Plane_3
|
||||||
transform(const Plane_3& pl) const;
|
transform(const Plane_3& pl) const;
|
||||||
|
|
||||||
|
Plane_3
|
||||||
|
transform(const Plane_3& pl, bool is_even, const Aff_transformation_3& transposed_inverse) const;
|
||||||
|
|
||||||
Aff_transformation_3
|
Aff_transformation_3
|
||||||
inverse() const;
|
inverse() const;
|
||||||
|
|
||||||
|
|
@ -577,22 +599,31 @@ template < class R >
|
||||||
CGAL_KERNEL_INLINE
|
CGAL_KERNEL_INLINE
|
||||||
typename Aff_transformation_repH3<R>::Plane_3
|
typename Aff_transformation_repH3<R>::Plane_3
|
||||||
Aff_transformation_repH3<R>::
|
Aff_transformation_repH3<R>::
|
||||||
transform(const typename Aff_transformation_repH3<R>::Plane_3& pl) const
|
transform(const typename Aff_transformation_repH3<R>::Plane_3& pl, bool is_even, const typename Aff_transformation_repH3<R>::Aff_transformation_3& transposed_inverse) const
|
||||||
{
|
{
|
||||||
if ( is_even() )
|
if ( is_even )
|
||||||
{
|
{
|
||||||
return Plane_3(
|
return Plane_3(
|
||||||
transform(pl.point() ),
|
transform(pl.point() ),
|
||||||
transpose().inverse().transform(pl.orthogonal_direction() ));
|
transposed_inverse.transform(pl.orthogonal_direction() ));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return Plane_3(
|
return Plane_3(
|
||||||
transform(pl.point() ),
|
transform(pl.point() ),
|
||||||
-(transpose().inverse().transform(pl.orthogonal_direction() )));
|
-(transposed_inverse.transform(pl.orthogonal_direction() )));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template < class R >
|
||||||
|
CGAL_KERNEL_INLINE
|
||||||
|
typename Aff_transformation_repH3<R>::Plane_3
|
||||||
|
Aff_transformation_repH3<R>::
|
||||||
|
transform(const typename Aff_transformation_repH3<R>::Plane_3& pl) const
|
||||||
|
{
|
||||||
|
return transform(pl, is_even(), transpose().inverse());
|
||||||
|
}
|
||||||
|
|
||||||
template < class R >
|
template < class R >
|
||||||
CGAL_KERNEL_INLINE
|
CGAL_KERNEL_INLINE
|
||||||
typename Aff_transformation_repH3<R>::Aff_transformation_3
|
typename Aff_transformation_repH3<R>::Aff_transformation_3
|
||||||
|
|
@ -805,6 +836,15 @@ transform(const typename Translation_repH3<R>::Plane_3& pl) const
|
||||||
return Plane_3( transform( pl.point() ), pl.orthogonal_vector() );
|
return Plane_3( transform( pl.point() ), pl.orthogonal_vector() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template < class R >
|
||||||
|
inline
|
||||||
|
typename Translation_repH3<R>::Plane_3
|
||||||
|
Translation_repH3<R>::
|
||||||
|
transform(const typename Translation_repH3<R>::Plane_3& pl, bool, const typename Translation_repH3<R>::Aff_transformation_3&) const
|
||||||
|
{
|
||||||
|
return transform(pl);
|
||||||
|
}
|
||||||
|
|
||||||
template < class R >
|
template < class R >
|
||||||
inline
|
inline
|
||||||
typename Translation_repH3<R>::Aff_transformation_3
|
typename Translation_repH3<R>::Aff_transformation_3
|
||||||
|
|
@ -1018,6 +1058,13 @@ Aff_transformationH3<R>::
|
||||||
transform(const typename Aff_transformationH3<R>::Plane_3& pl) const
|
transform(const typename Aff_transformationH3<R>::Plane_3& pl) const
|
||||||
{ return this->Ptr()->transform(pl); }
|
{ return this->Ptr()->transform(pl); }
|
||||||
|
|
||||||
|
template < class R >
|
||||||
|
inline
|
||||||
|
typename Aff_transformationH3<R>::Plane_3
|
||||||
|
Aff_transformationH3<R>::
|
||||||
|
transform(const typename Aff_transformationH3<R>::Plane_3& pl, bool is_even, const typename Aff_transformationH3<R>::Aff_transformation_3& transposed_inverse) const
|
||||||
|
{ return this->Ptr()->transform(pl, is_even, transposed_inverse); }
|
||||||
|
|
||||||
template < class R >
|
template < class R >
|
||||||
inline
|
inline
|
||||||
typename Aff_transformationH3<R>::Aff_transformation_3
|
typename Aff_transformationH3<R>::Aff_transformation_3
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue