mirror of https://github.com/CGAL/cgal
Scaling a plane means scaling Plane_3::d()
This commit is contained in:
parent
a841ee4d1a
commit
01cc9ec653
|
|
@ -144,6 +144,9 @@ public:
|
||||||
Plane_3
|
Plane_3
|
||||||
transform(const Plane_3& p) const
|
transform(const Plane_3& p) const
|
||||||
{
|
{
|
||||||
|
if(is_scaling()){
|
||||||
|
return this->Ptr()->transform(p);
|
||||||
|
}
|
||||||
if (is_even())
|
if (is_even())
|
||||||
return Plane_3(transform(p.point()),
|
return Plane_3(transform(p.point()),
|
||||||
transpose().inverse().transform(p.orthogonal_direction()));
|
transpose().inverse().transform(p.orthogonal_direction()));
|
||||||
|
|
@ -162,6 +165,7 @@ public:
|
||||||
bool is_odd() const { return ! (this->Ptr()->is_even()); }
|
bool is_odd() const { return ! (this->Ptr()->is_even()); }
|
||||||
|
|
||||||
bool is_translation() const { return this->Ptr()->is_translation(); }
|
bool is_translation() const { return this->Ptr()->is_translation(); }
|
||||||
|
bool is_scaling() const { return this->Ptr()->is_scaling(); }
|
||||||
|
|
||||||
|
|
||||||
FT cartesian(int i, int j) const { return this->Ptr()->cartesian(i,j); }
|
FT cartesian(int i, int j) const { return this->Ptr()->cartesian(i,j); }
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ public:
|
||||||
typedef typename R::Point_3 Point_3;
|
typedef typename R::Point_3 Point_3;
|
||||||
typedef typename R::Vector_3 Vector_3;
|
typedef typename R::Vector_3 Vector_3;
|
||||||
typedef typename R::Direction_3 Direction_3;
|
typedef typename R::Direction_3 Direction_3;
|
||||||
|
typedef typename R::Plane_3 Plane_3;
|
||||||
typedef typename R::Aff_transformation_3 Aff_transformation_3;
|
typedef typename R::Aff_transformation_3 Aff_transformation_3;
|
||||||
|
|
||||||
virtual ~Aff_transformation_rep_baseC3(){}
|
virtual ~Aff_transformation_rep_baseC3(){}
|
||||||
|
|
@ -38,6 +39,7 @@ public:
|
||||||
virtual Point_3 transform(const Point_3 &p) const = 0;
|
virtual Point_3 transform(const Point_3 &p) const = 0;
|
||||||
virtual Vector_3 transform(const Vector_3 &v) const = 0;
|
virtual Vector_3 transform(const Vector_3 &v) const = 0;
|
||||||
virtual Direction_3 transform(const Direction_3 &d) const = 0;
|
virtual Direction_3 transform(const Direction_3 &d) const = 0;
|
||||||
|
virtual Plane_3 transform(const Plane_3& p) const = 0;
|
||||||
|
|
||||||
virtual Aff_transformation_3 operator*(
|
virtual Aff_transformation_3 operator*(
|
||||||
const Aff_transformation_rep_baseC3 &t) const = 0;
|
const Aff_transformation_rep_baseC3 &t) const = 0;
|
||||||
|
|
@ -55,6 +57,7 @@ public:
|
||||||
virtual Aff_transformation_3 transpose() const = 0;
|
virtual Aff_transformation_3 transpose() const = 0;
|
||||||
virtual bool is_even() const = 0;
|
virtual bool is_even() const = 0;
|
||||||
virtual bool is_translation() const = 0;
|
virtual bool is_translation() const = 0;
|
||||||
|
virtual bool is_scaling() const = 0;
|
||||||
virtual FT cartesian(int i, int j) const = 0;
|
virtual FT cartesian(int i, int j) const = 0;
|
||||||
virtual std::ostream &print(std::ostream &os) const = 0;
|
virtual std::ostream &print(std::ostream &os) const = 0;
|
||||||
};
|
};
|
||||||
|
|
@ -128,6 +131,12 @@ public:
|
||||||
t31 * v.x() + t32 * v.y() + t33 * v.z());
|
t31 * v.x() + t32 * v.y() + t33 * v.z());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual Plane_3 transform(const Plane_3& p) const
|
||||||
|
{
|
||||||
|
return p; // fix or never call
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Note that Aff_transformation is not defined yet,
|
// Note that Aff_transformation is not defined yet,
|
||||||
// so the following 6 functions have to be implemented
|
// so the following 6 functions have to be implemented
|
||||||
// outside class body
|
// outside class body
|
||||||
|
|
@ -151,6 +160,11 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool is_scaling() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
virtual FT cartesian(int i, int j) const
|
virtual FT cartesian(int i, int j) const
|
||||||
{
|
{
|
||||||
switch (i)
|
switch (i)
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ public:
|
||||||
typedef typename Transformation_base_3::Point_3 Point_3;
|
typedef typename Transformation_base_3::Point_3 Point_3;
|
||||||
typedef typename Transformation_base_3::Vector_3 Vector_3;
|
typedef typename Transformation_base_3::Vector_3 Vector_3;
|
||||||
typedef typename Transformation_base_3::Direction_3 Direction_3;
|
typedef typename Transformation_base_3::Direction_3 Direction_3;
|
||||||
|
typedef typename Transformation_base_3::Plane_3 Plane_3;
|
||||||
typedef typename Transformation_base_3::Aff_transformation_3
|
typedef typename Transformation_base_3::Aff_transformation_3
|
||||||
Aff_transformation_3;
|
Aff_transformation_3;
|
||||||
|
|
||||||
|
|
@ -59,6 +60,12 @@ public:
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual Plane_3 transform(const Plane_3 &p) const
|
||||||
|
{
|
||||||
|
// direction ( which is (p.a(), p.b(), p.c())) does not change
|
||||||
|
return Plane_3(p.a(),p.b(),p.c(), p.d()*scalefactor_);
|
||||||
|
}
|
||||||
|
|
||||||
virtual Aff_transformation_3 operator*(const Transformation_base_3 &t) const
|
virtual Aff_transformation_3 operator*(const Transformation_base_3 &t) const
|
||||||
{
|
{
|
||||||
return t.compose(*this);
|
return t.compose(*this);
|
||||||
|
|
@ -126,6 +133,10 @@ public:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool is_scaling() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
virtual FT cartesian(int i, int j) const
|
virtual FT cartesian(int i, int j) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,11 @@ public:
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual Plane_3 transform(const Plane_3 &d) const
|
||||||
|
{
|
||||||
|
return d; // fix or never call it
|
||||||
|
}
|
||||||
|
|
||||||
virtual Aff_transformation_3 operator*(const Transformation_base_3 &t) const
|
virtual Aff_transformation_3 operator*(const Transformation_base_3 &t) const
|
||||||
{
|
{
|
||||||
return t.compose(*this);
|
return t.compose(*this);
|
||||||
|
|
@ -130,6 +135,10 @@ public:
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual bool is_scaling() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
virtual FT cartesian(int i, int j) const
|
virtual FT cartesian(int i, int j) const
|
||||||
{
|
{
|
||||||
if (j==i) return FT(1);
|
if (j==i) return FT(1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue