10 #ifndef EIGEN_TRANSLATION_H
11 #define EIGEN_TRANSLATION_H
29 template<
typename _Scalar,
int _Dim>
33 EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_Dim)
74 inline Scalar x()
const {
return m_coeffs.x(); }
76 inline Scalar y()
const {
return m_coeffs.y(); }
78 inline Scalar z()
const {
return m_coeffs.z(); }
81 inline Scalar&
x() {
return m_coeffs.x(); }
83 inline Scalar&
y() {
return m_coeffs.y(); }
85 inline Scalar&
z() {
return m_coeffs.z(); }
87 const VectorType& vector()
const {
return m_coeffs; }
90 const VectorType& translation()
const {
return m_coeffs; }
101 template<
typename OtherDerived>
105 template<
typename Derived>
111 template<
typename OtherDerived>
friend
124 template<
int Mode,
int Options>
128 res.pretranslate(m_coeffs);
134 {
return m_coeffs + other; }
141 m_coeffs = other.m_coeffs;
152 template<
typename NewScalarType>
153 inline typename internal::cast_return_type<Translation,Translation<NewScalarType,Dim> >::type
cast()
const
154 {
return typename internal::cast_return_type<Translation,Translation<NewScalarType,Dim> >::type(*
this); }
157 template<
typename OtherScalarType>
159 { m_coeffs = other.vector().template cast<Scalar>(); }
166 {
return m_coeffs.isApprox(other.m_coeffs, prec); }
172 typedef Translation<float, 2> Translation2f;
173 typedef Translation<double,2> Translation2d;
174 typedef Translation<float, 3> Translation3f;
175 typedef Translation<double,3> Translation3d;
178 template<
typename Scalar,
int Dim>
179 inline typename Translation<Scalar,Dim>::AffineTransformType
184 res.
linear().diagonal().fill(other.factor());
190 template<
typename Scalar,
int Dim>
191 template<
typename OtherDerived>
195 AffineTransformType res;
196 res.matrix().setZero();
197 res.linear() = linear.
derived();
198 res.translation() = m_coeffs;
199 res.matrix().row(Dim).setZero();
200 res(Dim,Dim) = Scalar(1);
206 #endif // EIGEN_TRANSLATION_H