33 #include <visp3/ustk_core/usOrientedPlane3D.h>
35 #include <visp3/core/vpException.h>
36 #include <visp3/core/vpRotationMatrix.h>
37 #include <visp3/core/vpThetaUVector.h>
42 : m_direction(plane.m_direction), m_pose(plane.m_pose)
67 m_direction = ((vpMatrix)vpRotationMatrix(pose)).getCol(2, 0, 3).normalize();
75 for (
int i = 0; i < 3; i++)
84 for (
int i = 0; i < 3; i++)
95 if (D.frobeniusNorm() > std::numeric_limits<double>::epsilon()) {
99 vpColVector u = vpColVector::crossProd(
m_direction, D);
100 double sin = u.frobeniusNorm();
101 double theta = atan2(sin, cos);
102 u = theta * u.normalize();
104 vpThetaUVector tu(vpRotationMatrix(u[0], u[1], u[2]) * vpRotationMatrix(
m_pose));
105 for (
int i = 0; i < 3; i++)
111 for (
int i = 3; i < 6; i++)
120 this->
setPose(vpPoseVector(vpHomogeneousMatrix(
m_pose) * H));
130 this->
setPose(vpPoseVector(H * vpHomogeneousMatrix(
m_pose)));
140 s <<
"usOrientedPlane3D\n";
142 for (
int i = 1; i < 6; i++)
143 s <<
" " << plane.
m_pose[i];
153 if (c !=
"usOrientedPlane3D") {
154 vpException e(vpException::ioError,
155 "operator>>=(std::istream&, usOrientedPlane3D&): Stream does not contain usOrientedPlane3D data");
159 for (
int i = 0; i < 6; i++)
168 s.write(
"usOrientedPlane3D", 18);
169 for (
int i = 0; i < 6; i++)
170 s.write((
char *)&(plane.
m_pose[i]),
sizeof(
double));
179 if (strcmp(c,
"usOrientedPlane3D")) {
180 vpException e(vpException::ioError,
181 "operator>>=(std::istream&, usOrientedPlane3D&): Stream does not contain usOrientedPlane3D data");
185 for (
int i = 0; i < 3; i++)
186 s.read((
char *)&(pose[i]),
sizeof(
double));
vpColVector getDirection() const
void setDirection(const vpColVector &D)
void moveInLocalFrame(const vpHomogeneousMatrix &H)
vpColVector getPosition() const
void moveInWorldFrame(const vpHomogeneousMatrix &H)
void setPose(const vpPoseVector &pose)
Parameters setters and getters.
vpPoseVector getPose() const
const usOrientedPlane3D & operator=(const usOrientedPlane3D &plane)
void setPosition(const vpColVector &P)
virtual ~usOrientedPlane3D()
usOrientedPlane3D()
Constructors, destructor.