mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
add test for geometry with eigen2_ prefixes. fix that stuff.
This commit is contained in:
@@ -23,8 +23,7 @@
|
||||
// License and a copy of the GNU General Public License along with
|
||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef EIGEN_HYPERPLANE_H
|
||||
#define EIGEN_HYPERPLANE_H
|
||||
// no include guard, we'll include this twice from All.h from Eigen2Support, and it's internal anyway
|
||||
|
||||
/** \geometry_module \ingroup Geometry_Module
|
||||
*
|
||||
@@ -71,7 +70,7 @@ public:
|
||||
: m_coeffs(n.size()+1)
|
||||
{
|
||||
normal() = n;
|
||||
offset() = -e.dot(n);
|
||||
offset() = -e.eigen2_dot(n);
|
||||
}
|
||||
|
||||
/** Constructs a plane from its normal \a n and distance to the origin \a d
|
||||
@@ -92,7 +91,7 @@ public:
|
||||
{
|
||||
Hyperplane result(p0.size());
|
||||
result.normal() = (p1 - p0).unitOrthogonal();
|
||||
result.offset() = -result.normal().dot(p0);
|
||||
result.offset() = -result.normal().eigen2_dot(p0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -104,7 +103,7 @@ public:
|
||||
EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(VectorType, 3)
|
||||
Hyperplane result(p0.size());
|
||||
result.normal() = (p2 - p0).cross(p1 - p0).normalized();
|
||||
result.offset() = -result.normal().dot(p0);
|
||||
result.offset() = -result.normal().eigen2_dot(p0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -116,7 +115,7 @@ public:
|
||||
explicit Hyperplane(const ParametrizedLine<Scalar, AmbientDimAtCompileTime>& parametrized)
|
||||
{
|
||||
normal() = parametrized.direction().unitOrthogonal();
|
||||
offset() = -normal().dot(parametrized.origin());
|
||||
offset() = -normal().eigen2_dot(parametrized.origin());
|
||||
}
|
||||
|
||||
~Hyperplane() {}
|
||||
@@ -133,7 +132,7 @@ public:
|
||||
/** \returns the signed distance between the plane \c *this and a point \a p.
|
||||
* \sa absDistance()
|
||||
*/
|
||||
inline Scalar signedDistance(const VectorType& p) const { return p.dot(normal()) + offset(); }
|
||||
inline Scalar signedDistance(const VectorType& p) const { return p.eigen2_dot(normal()) + offset(); }
|
||||
|
||||
/** \returns the absolute distance between the plane \c *this and a point \a p.
|
||||
* \sa signedDistance()
|
||||
@@ -231,7 +230,7 @@ public:
|
||||
TransformTraits traits = Affine)
|
||||
{
|
||||
transform(t.linear(), traits);
|
||||
offset() -= t.translation().dot(normal());
|
||||
offset() -= t.translation().eigen2_dot(normal());
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -264,5 +263,3 @@ protected:
|
||||
|
||||
Coefficients m_coeffs;
|
||||
};
|
||||
|
||||
#endif // EIGEN_HYPERPLANE_H
|
||||
|
||||
Reference in New Issue
Block a user