11#ifndef EIGEN_PARAMETRIZEDLINE_H
12#define EIGEN_PARAMETRIZEDLINE_H
29template <
typename _Scalar,
int _AmbientDim,
int _Options>
33 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,
_AmbientDim)
38 typedef _Scalar Scalar;
46 template<
int OtherOptions>
48 : m_origin(other.origin()), m_direction(other.direction())
59 : m_origin(origin), m_direction(direction) {}
61 template <
int OtherOptions>
71 EIGEN_DEVICE_FUNC
inline Index dim()
const {
return m_direction.size(); }
73 EIGEN_DEVICE_FUNC
const VectorType& origin()
const {
return m_origin; }
74 EIGEN_DEVICE_FUNC VectorType& origin() {
return m_origin; }
76 EIGEN_DEVICE_FUNC
const VectorType& direction()
const {
return m_direction; }
77 EIGEN_DEVICE_FUNC VectorType& direction() {
return m_direction; }
85 return (diff - direction().dot(diff) * direction()).squaredNorm();
94 {
return origin() + direction().
dot(p-origin()) * direction(); }
96 EIGEN_DEVICE_FUNC VectorType
pointAt(
const Scalar& t)
const;
98 template <
int OtherOptions>
101 template <
int OtherOptions>
104 template <
int OtherOptions>
113 template<
typename XprType>
117 direction() = (
mat * direction()).normalized();
119 direction() =
mat * direction();
122 eigen_assert(0 &&
"invalid traits value in ParametrizedLine::transform()");
124 origin() =
mat * origin();
135 template<
int TrOptions>
140 origin() += t.translation();
149 template<
typename NewScalarType>
158 template<
typename OtherScalarType,
int OtherOptions>
162 m_direction = other.direction().template
cast<Scalar>();
170 {
return m_origin.isApprox(other.m_origin,
prec) && m_direction.isApprox(other.m_direction,
prec); }
174 VectorType m_origin, m_direction;
181template <
typename _Scalar,
int _AmbientDim,
int _Options>
182template <
int OtherOptions>
185 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(
VectorType, 2)
192template <
typename _Scalar,
int _AmbientDim,
int _Options>
196 return origin() + (direction()*t);
201template <
typename _Scalar,
int _AmbientDim,
int _Options>
202template <
int OtherOptions>
213template <
typename _Scalar,
int _AmbientDim,
int _Options>
214template <
int OtherOptions>
222template <
typename _Scalar,
int _AmbientDim,
int _Options>
223template <
int OtherOptions>
227 return pointAt(intersectionParameter(
hyperplane));
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
EIGEN_DEVICE_FUNC ScalarBinaryOpTraits< typenameinternal::traits< Derived >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
\geometry_module
Definition ParametrizedLine.h:31
EIGEN_DEVICE_FUNC ParametrizedLine(const VectorType &origin, const VectorType &direction)
Initializes a parametrized line of direction direction and origin origin.
Definition ParametrizedLine.h:58
EIGEN_DEVICE_FUNC RealScalar distance(const VectorType &p) const
Definition ParametrizedLine.h:90
EIGEN_DEVICE_FUNC bool isApprox(const ParametrizedLine &other, const typename NumTraits< Scalar >::Real &prec=NumTraits< Scalar >::dummy_precision()) const
Definition ParametrizedLine.h:169
EIGEN_DEVICE_FUNC Index dim() const
Definition ParametrizedLine.h:71
EIGEN_DEVICE_FUNC VectorType projection(const VectorType &p) const
Definition ParametrizedLine.h:93
Eigen::Index Index
Definition ParametrizedLine.h:40
EIGEN_DEVICE_FUNC ParametrizedLine & transform(const Transform< Scalar, AmbientDimAtCompileTime, Affine, TrOptions > &t, TransformTraits traits=Affine)
Applies the transformation t to *this and returns a reference to *this.
Definition ParametrizedLine.h:136
EIGEN_DEVICE_FUNC ParametrizedLine(const ParametrizedLine< OtherScalarType, AmbientDimAtCompileTime, OtherOptions > &other)
Copy constructor with scalar type conversion.
Definition ParametrizedLine.h:159
static EIGEN_DEVICE_FUNC ParametrizedLine Through(const VectorType &p0, const VectorType &p1)
Constructs a parametrized line going from p0 to p1.
Definition ParametrizedLine.h:65
EIGEN_DEVICE_FUNC ParametrizedLine()
Default constructor without initialization.
Definition ParametrizedLine.h:44
EIGEN_DEVICE_FUNC RealScalar squaredDistance(const VectorType &p) const
Definition ParametrizedLine.h:82
EIGEN_DEVICE_FUNC VectorType intersectionPoint(const Hyperplane< _Scalar, _AmbientDim, OtherOptions > &hyperplane) const
Definition ParametrizedLine.h:225
EIGEN_DEVICE_FUNC ParametrizedLine & transform(const MatrixBase< XprType > &mat, TransformTraits traits=Affine)
Applies the transformation matrix mat to *this and returns a reference to *this.
Definition ParametrizedLine.h:114
EIGEN_DEVICE_FUNC internal::cast_return_type< ParametrizedLine, ParametrizedLine< NewScalarType, AmbientDimAtCompileTime, Options > >::type cast() const
Definition ParametrizedLine.h:151
EIGEN_DEVICE_FUNC ParametrizedLine(Index _dim)
Constructs a dynamic-size line with _dim the dimension of the ambient space.
Definition ParametrizedLine.h:53
EIGEN_DEVICE_FUNC VectorType pointAt(const Scalar &t) const
Definition ParametrizedLine.h:194
EIGEN_DEVICE_FUNC PlainObject unitOrthogonal(void) const
\geometry_module
Definition OrthoMethods.h:227
TransformTraits
Enum used to specify how a particular transformation is stored in a matrix.
Definition Constants.h:455
@ Affine
Transformation is an affine transformation stored as a (Dim+1)^2 matrix whose last row is assumed to ...
Definition Constants.h:460
@ Isometry
Transformation is an isometry.
Definition Constants.h:457
Namespace containing all symbols from the Eigen library.
Definition LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Holds information about the various numeric (i.e.
Definition NumTraits.h:236
Definition XprHelper.h:510