2014-04-28 21:09:25 +04:00
|
|
|
#pragma once
|
2011-10-01 03:36:30 +04:00
|
|
|
|
|
|
|
#include <Eigen/Core>
|
|
|
|
#include <Eigen/Geometry>
|
2011-10-30 05:16:27 +04:00
|
|
|
#include <Eigen/Dense>
|
2014-08-15 01:16:24 +04:00
|
|
|
#include <Eigen/StdVector>
|
2011-10-01 03:36:30 +04:00
|
|
|
|
2013-11-01 20:10:03 +04:00
|
|
|
EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector2d)
|
2011-10-30 05:16:27 +04:00
|
|
|
using Eigen::Vector2d;
|
2013-11-01 20:10:03 +04:00
|
|
|
EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector3d)
|
2011-10-01 03:36:30 +04:00
|
|
|
using Eigen::Vector3d;
|
2015-01-15 22:47:05 +03:00
|
|
|
EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector3f)
|
|
|
|
using Eigen::Vector3f;
|
|
|
|
EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Eigen::Vector3i)
|
|
|
|
using Eigen::Vector3i;
|
2013-11-01 20:10:03 +04:00
|
|
|
|
2011-10-01 03:36:30 +04:00
|
|
|
typedef Eigen::AlignedBox<double, 3> BoundingBox;
|
2011-10-04 05:41:43 +04:00
|
|
|
using Eigen::Matrix3f;
|
|
|
|
using Eigen::Matrix3d;
|
2011-12-19 22:49:52 +04:00
|
|
|
using Eigen::Matrix4d;
|
2012-08-19 00:28:36 +04:00
|
|
|
#define Transform3d Eigen::Affine3d
|
2013-10-31 08:45:00 +04:00
|
|
|
#define Transform2d Eigen::Affine2d
|
2011-10-01 03:36:30 +04:00
|
|
|
|
2012-08-22 05:07:17 +04:00
|
|
|
bool matrix_contains_infinity( const Transform3d &m );
|
|
|
|
bool matrix_contains_nan( const Transform3d &m );
|
2012-08-21 03:33:13 +04:00
|
|
|
|
2015-02-24 05:21:31 +03:00
|
|
|
template<typename Derived> bool is_finite(const Eigen::MatrixBase<Derived>& x) {
|
|
|
|
return ( (x - x).array() == (x - x).array()).all();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename Derived> bool is_nan(const Eigen::MatrixBase<Derived>& x) {
|
2015-04-21 08:33:25 +03:00
|
|
|
return !((x.array() == x.array())).all();
|
2015-02-24 05:21:31 +03:00
|
|
|
}
|
|
|
|
|
2011-12-23 17:33:40 +04:00
|
|
|
BoundingBox operator*(const Transform3d &m, const BoundingBox &box);
|
2013-01-24 07:49:16 +04:00
|
|
|
|
2011-12-26 03:38:03 +04:00
|
|
|
class Color4f : public Eigen::Vector4f
|
|
|
|
{
|
|
|
|
public:
|
2012-01-26 00:13:03 +04:00
|
|
|
Color4f() { }
|
|
|
|
Color4f(int r, int g, int b, int a = 255) { setRgb(r,g,b,a); }
|
|
|
|
Color4f(float r, float g, float b, float a = 1.0f) : Eigen::Vector4f(r, g, b, a) { }
|
|
|
|
|
|
|
|
void setRgb(int r, int g, int b, int a = 255) {
|
|
|
|
*this << r/255.0f, g/255.0f, b/255.0f, a/255.0f;
|
|
|
|
}
|
|
|
|
|
2011-12-26 03:38:03 +04:00
|
|
|
bool isValid() const { return this->minCoeff() >= 0.0f; }
|
|
|
|
};
|