5 #ifndef GEOMODELKERNEL_GEODEFINITIONS_H 6 #define GEOMODELKERNEL_GEODEFINITIONS_H 9 #if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) 10 #pragma GCC diagnostic push 11 #pragma GCC diagnostic ignored "-Wmisleading-indentation" 12 #include <Eigen/Dense> 13 #pragma GCC diagnostic pop 15 #include <Eigen/Dense> 19 typedef Eigen::Quaternion<double> Rotation3D;
20 typedef Eigen::Translation<double, 3> Translation3D;
21 typedef Eigen::AngleAxisd AngleAxis3D;
22 typedef Eigen::Affine3d Transform3D;
23 typedef Eigen::Matrix<double, 3, 1> Vector3D;
24 typedef Eigen::Matrix<double, 2, 1> Vector2D;
25 typedef Eigen::Matrix<double, 3, 3> RotationMatrix3D;
30 double a_, b_, c_, d_;
36 : a_(0.), b_(0.), c_(1.), d_(0.)
41 Plane3D(
double a1,
double b1,
double c1,
double d1)
42 : a_(a1), b_(b1), c_(c1), d_(d1)
47 Plane3D(
const Vector3D& n,
const Vector3D& p)
48 : a_(n.x()), b_(n.y()), c_(n.z()), d_(-n.dot(p))
53 double a()
const {
return a_; }
56 double b()
const {
return b_; }
59 double c()
const {
return c_; }
62 double d()
const {
return d_; }
66 Vector3D
normal()
const {
return Vector3D(a_,b_,c_); }
72 : Transform3D(Translation3D(x,y,z))
80 : Transform3D(Translation3D(x,0,0))
88 : Transform3D(Translation3D(0,y,0))
96 : Transform3D(Translation3D(0,0,z))
103 Rotate3D(
double angle,
const Vector3D& axis)
104 : Transform3D(AngleAxis3D(angle,axis))
112 : Transform3D(AngleAxis3D(angle,Vector3D::UnitX()))
120 : Transform3D(AngleAxis3D(angle,Vector3D::UnitY()))
128 : Transform3D(AngleAxis3D(angle,Vector3D::UnitZ()))
142 : Transform3D(Translation3D(trans)*Transform3D(AngleAxis3D(rot)))
148 #endif // GEOMODELKERNEL_GEODEFINITIONS_H Plane3D(const Vector3D &n, const Vector3D &p)
Plane3D(double a1, double b1, double c1, double d1)
check if we can use Eigen Hyperplane for this