18 m_hcs.FromNormal(m_plane.getNormal());
23 m_hcs.FromNormal(m_plane.getNormal());
41 return m_plane.getDistance(p);
47 return m_plane.SignedDistance(p);
53 return m_plane.getNormal().dot(n);
59 std::pair<float, float>* dn)
const
61 dn->first = m_plane.getDistance(p);
62 dn->second = m_plane.getNormal().dot(n);
68 *pp = p - ((m_plane.getNormal().
dot(p - m_plane.getPosition())) * m_plane.getNormal());
74 *n = m_plane.getNormal();
86 numTests, epsilon, normalThresh, rms, pc, indices);
107 m_hcs.FromNormal(m_plane.getNormal());
119 std::pair<size_t, float>* score)
const
144 m_plane.Serialize(binary, o);
154 return m_plane.SerializedSize() + 1;
160 m_plane.Transform(scale, translate);
170 m_hcs[0] = rot * m_hcs[0];
171 m_hcs[1] = rot * m_hcs[1];
177 visitor->
Visit(*
this);
195 Vec3f pp = p - m_plane.getPosition();
196 param->first = pp.
dot(m_hcs[0].Data());
197 param->second = pp.
dot(m_hcs[1].Data());
206 ParametersImpl(begin, end, bmpParams);
215 ParametersImpl(begin, end, bmpParams);
225 *uextent = size_t(std::ceil((bbox->
Max()[0] - bbox->
Min()[0]) / epsilon)) + 1;
226 *vextent = size_t(std::ceil((bbox->
Max()[1] - bbox->
Min()[1]) / epsilon)) + 1;
235 std::pair<int, int>* inBmp)
const
237 inBmp->first = std::floor((param.first - bbox.
Min()[0]) / epsilon);
238 inBmp->second = std::floor((param.second - bbox.
Min()[1]) / epsilon);
264 *p = m_plane.getPosition() +
Vec3f((u * m_hcs[0] + v * m_hcs[1]).Data());
265 *n = m_plane.getNormal();
279 *p =
Vec3f(((bbox.
Min()[0] + epsilon * (
float(u) + .5f)) * m_hcs[0] +
280 (bbox.
Min()[1] + epsilon * (
float(v) + .5f)) * m_hcs[1])
282 m_plane.getPosition();
283 *n = m_plane.getNormal();
MiscLib::performance_t totalTime_planeConnected
class DLL_LINKAGE PlanePrimitiveShape
unsigned int ConfidenceTests(unsigned int numTests, float epsilon, float normalThresh, float rms, const PointCloud &pc, const MiscLib::Vector< size_t > &indices) const
const Point * const_iterator
void DistanceAndNormalDeviation(const Vec3f &p, const Vec3f &n, std::pair< float, float > *dn) const
unsigned int ConfidenceTests(unsigned int numTests, float epsilon, float normalThresh, float rms, const PointCloud &pc, const MiscLib::Vector< size_t > &indices) const
size_t SerializedSize() const
float SignedDistance(const Vec3f &p) const
float NormalDeviation(const Vec3f &p, const Vec3f &n) const
bool Similar(float tolerance, const PlanePrimitiveShape &) const
PrimitiveShape * Clone() const
void Normal(const Vec3f &p, Vec3f *n) const
void InBitmap(const std::pair< float, float > ¶m, float epsilon, const GfxTL::AABox< GfxTL::Vector2Df > &bbox, size_t uextent, size_t vextent, std::pair< int, int > *inBmp) const
void Transform(float scale, const Vec3f &translate)
PrimitiveShape * LSFit(const PointCloud &pc, float epsilon, float normalThresh, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end, std::pair< size_t, float > *score) const
size_t Identifier() const
void Visit(PrimitiveShapeVisitor *visitor) const
void Project(const Vec3f &p, Vec3f *pp) const
LevMarFunc< float > * SignedDistanceFunc() const
bool Fit(const PointCloud &pc, float epsilon, float normalThresh, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end)
void SetExtent(const GfxTL::AABox< GfxTL::Vector2Df > &bbox, const MiscLib::Vector< int > &componentsImg, size_t uextent, size_t vextent, float epsilon, int label)
void WrapBitmap(const GfxTL::AABox< GfxTL::Vector2Df > &bbox, float epsilon, bool *uwrap, bool *vwrap) const
float Distance(const Vec3f &p) const
void Serialize(std::ostream *o, bool binary=true) const
This is the one and only serialization function It stores all the parameters of the shape as well as ...
PlanePrimitiveShape(const Vec3f &a, const Vec3f &b, const Vec3f &c)
void BitmapExtent(float epsilon, GfxTL::AABox< GfxTL::Vector2Df > *bbox, MiscLib::Vector< std::pair< float, float > > *params, size_t *uextent, size_t *vextent)
void Description(std::string *s) const
void Parameters(const Vec3f &p, std::pair< float, float > *param) const
bool InSpace(float u, float v, Vec3f *p, Vec3f *n) const
bool LeastSquaresFit(const PointCloud &pc, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end)
virtual void Visit(const PlanePrimitiveShape &plane)=0
PrimtiveShape is a shape primitive in conjunction with a parametrization.
float dot(const Vec3f &v) const
VectorXD< 3, float > Vector3Df
double dot(const Point &x, const Point &y)