29 #include "../../common/WAssert.h"
30 #include "../../common/WLimits.h"
31 #include "../../common/math/WLinearAlgebraFunctions.h"
32 #include "../../common/math/linearAlgebra/WVectorFixed.h"
68 std::shared_ptr< std::set< WPosition > >
WPlane::samplePoints(
double stepWidth,
size_t numX,
size_t numY )
const
71 std::shared_ptr< std::set< WPosition > > result(
new std::set< WPosition >() );
76 result->insert(
m_pos );
77 for(
size_t i = 0; i < numY; ++i )
79 for(
size_t j = 0; j < numX; ++j )
85 result->insert(
m_pos -
id * ycrement - jd * xcrement );
86 result->insert(
m_pos +
id * ycrement - jd * xcrement );
87 result->insert(
m_pos -
id * ycrement + jd * xcrement );
88 result->insert(
m_pos +
id * ycrement + jd * xcrement );
105 std::stringstream msg;
106 msg <<
"The give two vectors are not perpendicular to plane. First: " << first <<
" second: " << second <<
" for plane normal: " <<
m_normal;
109 std::stringstream msg2;
110 msg2 <<
"The given two vectors are not linear independent!: " << first <<
" and " << second;
111 WAssert( linearIndependent( first, second ), msg2.str() );
std::shared_ptr< std::set< WPosition > > samplePoints(const WGridRegular3D &grid, double stepWidth)
Computes sample points on that plane.
WPosition m_pos
Position of the plane specifying the center.
void setNormal(const WVector3d &normal)
Resets the normal of this plane.
WPosition getPointInPlane(double x, double y) const
Computes with relative coordinates a point in this plane.
WVector3d m_first
First vector in the plane.
WPlane(const WVector3d &normal, const WPosition &pos)
Constructs a plane with its normal and containing the point.
void setPlaneVectors(const WVector3d &first, const WVector3d &second)
Resets the vector spanning the plane.
bool isInPlane(WPosition point) const
Determines whether a given point is in this plane or not.
WVector3d m_normal
Direction of the plane.
void resetPosition(WPosition newPos)
Reset the position of the plane, normal remains the same.
WVector3d m_second
Second vector in the plane.
virtual ~WPlane()
Destructor.
This only is a 3d double vector.
const float FLT_EPS
Smallest float such: 1.0 + FLT_EPS == 1.0 is still true.