15 #ifndef ECL_GEOMETRY_HOMOGENEOUS_POINT_HPP_
16 #define ECL_GEOMETRY_HOMOGENEOUS_POINT_HPP_
45 template <
typename T,
typename Enable =
void>
56 class HomogeneousPoint<T, typename
ecl::enable_if< ecl::is_float<T> >::type> {
58 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
63 elements.template block<3,1>(0,0) = ecl::linear_algebra::Matrix<T,3,1>::Constant(value);
75 elements.template block<3,1>(0,0) = vec;
85 HomogeneousPoint(
const ecl::linear_algebra::Matrix<T,4,1> &vec) : elements(vec) {
95 HomogeneousPoint(
const T &x_i,
const T &y_i,
const T &z_i) {
96 elements << x_i, y_i, z_i, 1.0;
99 virtual ~HomogeneousPoint() {}
117 ecl::linear_algebra::CommaInitializer< ecl::linear_algebra::Matrix<T,4,1> >
operator<<(
const T &value) {
118 return elements.operator<<(value);
128 ecl::linear_algebra::Matrix<T,4,1>& positionVector() {
return elements; }
137 const ecl::linear_algebra::Matrix<T,4,1>& positionVector()
const {
return elements; }
144 const T& x()
const {
return elements[0]; }
150 const T& y()
const {
return elements[1]; }
156 const T& z()
const {
return elements[2]; }
162 T x() {
return elements[0]; }
168 T y() {
return elements[1]; }
174 T z() {
return elements[2]; }
176 void x(
const T& value) { elements[0] = value; }
177 void y(
const T& value) { elements[1] = value; }
178 void z(
const T& value) { elements[2] = value; }
180 template <
typename OutputStream,
typename Type>
184 ecl::linear_algebra::Matrix<T,4,1> elements;
200 template <
typename OutputStream,
typename Type>
202 ostream <<
"[ " << point.x() <<
" " << point.y() <<
" " << point.z() <<
" ]";