PrimitiveShape Class Referenceabstract

PrimtiveShape is a shape primitive in conjunction with a parametrization. More...

#include <VisionX/components/pointcloud_processor/EfficientRANSACPrimitiveExtractor/EfficientRANSAC/PrimitiveShape.h>

+ Inheritance diagram for PrimitiveShape:

Public Types

typedef MiscLib::Vector< GfxTL::VectorXD< 2, size_t > > BitmapPolygon
 
typedef MiscLib::Vector< BitmapPolygonComponentPolygons
 

Public Member Functions

virtual PrimitiveShapeClone () const =0
 
virtual unsigned int ConfidenceTests (unsigned int numTests, float epsilon, float normalThresh, float rms, const PointCloud &pc, const MiscLib::Vector< size_t > &indices) const =0
 
virtual size_t ConnectedComponent (const PointCloud &pc, float epsilon, MiscLib::Vector< size_t > *indices, bool doFiltering=true, float *borderRatio=0)=0
 
virtual void Description (std::string *s) const =0
 
virtual float Distance (const Vec3f &p) const =0
 
virtual void DistanceAndNormalDeviation (const Vec3f &p, const Vec3f &n, std::pair< float, float > *dn) const =0
 
virtual bool Fit (const PointCloud &pc, float epsilon, float normalThresh, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end)=0
 
virtual void GenerateBitmapPoints (const PointCloud &pc, float epsilon, size_t begin, size_t end, PointCloud *bmpPc) const =0
 
virtual size_t Identifier () const =0
 
virtual bool InSpace (float u, float v, Vec3f *p, Vec3f *n) const =0
 
virtual PrimitiveShapeLSFit (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 =0
 
virtual void Normal (const Vec3f &p, Vec3f *n) const =0
 
virtual float NormalDeviation (const Vec3f &p, const Vec3f &n) const =0
 
virtual void OptimizeParametrization (const PointCloud &pc, size_t begin, size_t end, float epsilon)
 
virtual void Parameters (const Vec3f &p, std::pair< float, float > *param) const =0
 
virtual void Project (const Vec3f &p, Vec3f *pp) const =0
 
virtual unsigned int RequiredSamples () const =0
 
virtual void Serialize (float *array) const =0
 
virtual void Serialize (std::ostream *o, bool binary=true) const =0
 This is the one and only serialization function It stores all the parameters of the shape as well as the parametrization. More...
 
virtual size_t SerializedFloatSize () const =0
 
virtual size_t SerializedSize () const =0
 
virtual float SignedDistance (const Vec3f &p) const =0
 
virtual LevMarFunc< float > * SignedDistanceFunc () const =0
 
virtual void SuggestSimplifications (const PointCloud &pc, MiscLib::Vector< size_t >::const_iterator begin, MiscLib::Vector< size_t >::const_iterator end, float distThresh, MiscLib::Vector< MiscLib::RefCountPtr< PrimitiveShape > > *suggestions) const
 
virtual void Transform (float scale, const Vec3f &translate)=0
 
virtual void TrimmingPolygons (const PointCloud &pc, float epsilon, size_t begin, size_t end, std::deque< ComponentPolygons > *polys) const =0
 
virtual void Visit (PrimitiveShapeVisitor *visitor) const =0
 
- Public Member Functions inherited from RefCount
unsigned int AddRef () const
 
RefCountoperator= (const RefCount &)
 
 RefCount ()
 
 RefCount (const RefCount &)
 
unsigned int Release () const
 

Additional Inherited Members

- Protected Member Functions inherited from RefCount
virtual ~RefCount ()
 

Detailed Description

PrimtiveShape is a shape primitive in conjunction with a parametrization.

The parametrization is used for connected component computations. There are some deprecated serialization functions that do not always store the parametrization (at least for some shape types). These functions should no longer be used anywhere! Note: Computing connected components may change the parametrization! (Some shapes align the parametrization so that the memory for the bitmap is reduced)

Definition at line 32 of file PrimitiveShape.h.

Member Typedef Documentation

◆ BitmapPolygon

Definition at line 75 of file PrimitiveShape.h.

◆ ComponentPolygons

Definition at line 76 of file PrimitiveShape.h.

Member Function Documentation

◆ Clone()

virtual PrimitiveShape* Clone ( ) const
pure virtual

Implemented in SpherePrimitiveShape, PlanePrimitiveShape, TorusPrimitiveShape, CylinderPrimitiveShape, and ConePrimitiveShape.

+ Here is the caller graph for this function:

◆ ConfidenceTests()

virtual unsigned int ConfidenceTests ( unsigned int  numTests,
float  epsilon,
float  normalThresh,
float  rms,
const PointCloud pc,
const MiscLib::Vector< size_t > &  indices 
) const
pure virtual

◆ ConnectedComponent()

virtual size_t ConnectedComponent ( const PointCloud pc,
float  epsilon,
MiscLib::Vector< size_t > *  indices,
bool  doFiltering = true,
float borderRatio = 0 
)
pure virtual

Implemented in BitmapPrimitiveShape.

+ Here is the caller graph for this function:

◆ Description()

virtual void Description ( std::string *  s) const
pure virtual

◆ Distance()

virtual float Distance ( const Vec3f p) const
pure virtual

Implemented in SpherePrimitiveShape, CylinderPrimitiveShape, PlanePrimitiveShape, TorusPrimitiveShape, and ConePrimitiveShape.

+ Here is the caller graph for this function:

◆ DistanceAndNormalDeviation()

virtual void DistanceAndNormalDeviation ( const Vec3f p,
const Vec3f n,
std::pair< float, float > *  dn 
) const
pure virtual

Implemented in SpherePrimitiveShape, CylinderPrimitiveShape, PlanePrimitiveShape, TorusPrimitiveShape, and ConePrimitiveShape.

+ Here is the caller graph for this function:

◆ Fit()

virtual bool Fit ( const PointCloud pc,
float  epsilon,
float  normalThresh,
MiscLib::Vector< size_t >::const_iterator  begin,
MiscLib::Vector< size_t >::const_iterator  end 
)
pure virtual

◆ GenerateBitmapPoints()

virtual void GenerateBitmapPoints ( const PointCloud pc,
float  epsilon,
size_t  begin,
size_t  end,
PointCloud bmpPc 
) const
pure virtual

Implemented in BitmapPrimitiveShape.

◆ Identifier()

virtual size_t Identifier ( ) const
pure virtual

Implemented in SpherePrimitiveShape, PlanePrimitiveShape, TorusPrimitiveShape, CylinderPrimitiveShape, and ConePrimitiveShape.

+ Here is the caller graph for this function:

◆ InSpace()

virtual bool InSpace ( float  u,
float  v,
Vec3f p,
Vec3f n 
) const
pure virtual

◆ LSFit()

virtual 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
pure virtual

◆ Normal()

virtual void Normal ( const Vec3f p,
Vec3f n 
) const
pure virtual

◆ NormalDeviation()

virtual float NormalDeviation ( const Vec3f p,
const Vec3f n 
) const
pure virtual

◆ OptimizeParametrization()

virtual void OptimizeParametrization ( const PointCloud pc,
size_t  begin,
size_t  end,
float  epsilon 
)
inlinevirtual

Reimplemented in SpherePrimitiveShape, and TorusPrimitiveShape.

Definition at line 97 of file PrimitiveShape.h.

◆ Parameters()

virtual void Parameters ( const Vec3f p,
std::pair< float, float > *  param 
) const
pure virtual

◆ Project()

virtual void Project ( const Vec3f p,
Vec3f pp 
) const
pure virtual

◆ RequiredSamples()

virtual unsigned int RequiredSamples ( ) const
pure virtual

◆ Serialize() [1/2]

virtual void Serialize ( float array) const
pure virtual

◆ Serialize() [2/2]

virtual void Serialize ( std::ostream *  o,
bool  binary = true 
) const
pure virtual

This is the one and only serialization function It stores all the parameters of the shape as well as the parametrization.

The first byte written (in both, binary and ascii mode) is the shape identifier

Implemented in SpherePrimitiveShape, CylinderPrimitiveShape, PlanePrimitiveShape, TorusPrimitiveShape, and ConePrimitiveShape.

◆ SerializedFloatSize()

virtual size_t SerializedFloatSize ( ) const
pure virtual

◆ SerializedSize()

virtual size_t SerializedSize ( ) const
pure virtual

◆ SignedDistance()

virtual float SignedDistance ( const Vec3f p) const
pure virtual

◆ SignedDistanceFunc()

virtual LevMarFunc< float >* SignedDistanceFunc ( ) const
pure virtual

◆ SuggestSimplifications()

virtual void SuggestSimplifications ( const PointCloud pc,
MiscLib::Vector< size_t >::const_iterator  begin,
MiscLib::Vector< size_t >::const_iterator  end,
float  distThresh,
MiscLib::Vector< MiscLib::RefCountPtr< PrimitiveShape > > *  suggestions 
) const
inlinevirtual

◆ Transform()

virtual void Transform ( float  scale,
const Vec3f translate 
)
pure virtual

◆ TrimmingPolygons()

virtual void TrimmingPolygons ( const PointCloud pc,
float  epsilon,
size_t  begin,
size_t  end,
std::deque< ComponentPolygons > *  polys 
) const
pure virtual

Implemented in BitmapPrimitiveShape.

◆ Visit()

virtual void Visit ( PrimitiveShapeVisitor visitor) const
pure virtual

Implemented in SpherePrimitiveShape, CylinderPrimitiveShape, PlanePrimitiveShape, TorusPrimitiveShape, and ConePrimitiveShape.

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: