Use new style with make_array(), more compact and efficient

This commit is contained in:
Sylvain Pion 2008-04-09 14:25:17 +00:00
parent c10c7ebead
commit ccff0db36d
4 changed files with 8 additions and 24 deletions

View File

@ -60,12 +60,8 @@ public:
: base(CGALi::make_array(x, y)) {}
PointC2(const FT &hx, const FT &hy, const FT &hw)
{
if (hw != FT(1))
base = CGALi::make_array(hx/hw, hy/hw);
else
base = CGALi::make_array(hx, hy);
}
: base( hw != FT(1) ? CGALi::make_array(hx/hw, hy/hw)
: CGALi::make_array(hx, hy) ) {}
const FT& x() const
{

View File

@ -57,12 +57,8 @@ public:
: base(CGALi::make_array(x, y, z)) {}
PointC3(const FT &x, const FT &y, const FT &z, const FT &w)
{
if (w != FT(1))
base = CGALi::make_array(x/w, y/w, z/w);
else
base = CGALi::make_array(x, y, z);
}
: base( w != FT(1) ? CGALi::make_array(x/w, y/w, z/w)
: CGALi::make_array(x, y, z) ) {}
/*
bool operator==(const PointC3 &p) const

View File

@ -56,12 +56,8 @@ public:
: base(CGALi::make_array(x, y)) {}
VectorC2(const FT &hx, const FT &hy, const FT &hw)
{
if (hw != FT(1))
base = CGALi::make_array(hx/hw, hy/hw);
else
base = CGALi::make_array(hx, hy);
}
: base( hw != FT(1) ? CGALi::make_array(hx/hw, hy/hw)
: CGALi::make_array(hx, hy) ) {}
const FT & x() const
{

View File

@ -70,12 +70,8 @@ public:
: base(CGALi::make_array(x, y, z)) {}
VectorC3(const FT &x, const FT &y, const FT &z, const FT &w)
{
if (w != FT(1))
base = CGALi::make_array(x/w, y/w, z/w);
else
base = CGALi::make_array(x, y, z);
}
: base( w != FT(1) ? CGALi::make_array(x/w, y/w, z/w)
: CGALi::make_array(x, y, z) ) {}
const FT & x() const
{