Open CASCADE Technology  7.7.0
Public Member Functions | Protected Member Functions | Protected Attributes

BRepLib_PointCloudShape Class Referenceabstract

This tool is intended to get points from shape with specified distance from shape along normal. Can be used to simulation of points obtained in result of laser scan of shape. There are 2 ways for generation points by shape: More...

#include <BRepLib_PointCloudShape.hxx>

Public Member Functions

 BRepLib_PointCloudShape (const TopoDS_Shape &theShape=TopoDS_Shape(), const Standard_Real theTol=Precision::Confusion())
 Constructor initialized by shape. More...
 
virtual ~BRepLib_PointCloudShape ()
 Virtual destructor. More...
 
const TopoDS_ShapeShape () const
 Return loaded shape. More...
 
void SetShape (const TopoDS_Shape &theShape)
 Set shape. More...
 
Standard_Real Tolerance () const
 Return tolerance. More...
 
void SetTolerance (Standard_Real theTol)
 Set tolerance. More...
 
Standard_Real GetDistance () const
 Returns value of the distance to define deflection of points from shape along normal to shape; 0.0 by default. More...
 
void SetDistance (const Standard_Real theDist)
 Sets value of the distance to define deflection of points from shape along normal to shape. Negative values of theDist parameter are ignored. More...
 
Standard_Integer NbPointsByDensity (const Standard_Real theDensity=0.0)
 Returns size of the point cloud for specified density. More...
 
Standard_Integer NbPointsByTriangulation () const
 Returns size of the point cloud for using triangulation. More...
 
Standard_Boolean GeneratePointsByDensity (const Standard_Real theDensity=0.0)
 Computes points with specified density for initial shape. If parameter Density is equal to 0 then density will be computed automatically by criterion: More...
 
Standard_Boolean GeneratePointsByTriangulation ()
 Get points from triangulation existing in the shape. More...
 

Protected Member Functions

Standard_Real faceArea (const TopoDS_Shape &theShape)
 Compute area of the specified face. More...
 
Standard_Real computeDensity ()
 Computes default density points per face. More...
 
Standard_Boolean addDensityPoints (const TopoDS_Shape &theFace)
 Adds points to face in accordance with the specified density randomly in the specified range [0, Dist]. More...
 
Standard_Boolean addTriangulationPoints (const TopoDS_Shape &theFace)
 Adds points to face by nodes of the existing triangulation randomly in the specified range [0, Dist]. More...
 
virtual void clear ()
 Method to clear maps. More...
 
virtual void addPoint (const gp_Pnt &thePoint, const gp_Vec &theNorm, const gp_Pnt2d &theUV, const TopoDS_Shape &theFace)=0
 Method to add point, normal to surface in this point and face for which point computed. More...
 

Protected Attributes

TopoDS_Shape myShape
 
Standard_Real myDist
 
Standard_Real myTol
 
TopTools_DataMapOfShapeReal myFaceArea
 
TopTools_DataMapOfShapeInteger myFacePoints
 
Standard_Integer myNbPoints
 

Detailed Description

This tool is intended to get points from shape with specified distance from shape along normal. Can be used to simulation of points obtained in result of laser scan of shape. There are 2 ways for generation points by shape:

  1. Generation points with specified density
  2. Generation points using triangulation Nodes Generation of points by density using the GeneratePointsByDensity() function is not thread safe.

Constructor & Destructor Documentation

◆ BRepLib_PointCloudShape()

BRepLib_PointCloudShape::BRepLib_PointCloudShape ( const TopoDS_Shape theShape = TopoDS_Shape(),
const Standard_Real  theTol = Precision::Confusion() 
)

Constructor initialized by shape.

◆ ~BRepLib_PointCloudShape()

virtual BRepLib_PointCloudShape::~BRepLib_PointCloudShape ( )
virtual

Virtual destructor.

Member Function Documentation

◆ addDensityPoints()

Standard_Boolean BRepLib_PointCloudShape::addDensityPoints ( const TopoDS_Shape theFace)
protected

Adds points to face in accordance with the specified density randomly in the specified range [0, Dist].

◆ addPoint()

virtual void BRepLib_PointCloudShape::addPoint ( const gp_Pnt thePoint,
const gp_Vec theNorm,
const gp_Pnt2d theUV,
const TopoDS_Shape theFace 
)
protectedpure virtual

Method to add point, normal to surface in this point and face for which point computed.

Parameters
[in]thePoint3D point on the surface
[in]theNormsurface normal at this point
[in]theUVsurface UV parameters
[in]theFacesurface (face) definition

◆ addTriangulationPoints()

Standard_Boolean BRepLib_PointCloudShape::addTriangulationPoints ( const TopoDS_Shape theFace)
protected

Adds points to face by nodes of the existing triangulation randomly in the specified range [0, Dist].

◆ clear()

virtual void BRepLib_PointCloudShape::clear ( )
protectedvirtual

Method to clear maps.

◆ computeDensity()

Standard_Real BRepLib_PointCloudShape::computeDensity ( )
protected

Computes default density points per face.

◆ faceArea()

Standard_Real BRepLib_PointCloudShape::faceArea ( const TopoDS_Shape theShape)
protected

Compute area of the specified face.

◆ GeneratePointsByDensity()

Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByDensity ( const Standard_Real  theDensity = 0.0)

Computes points with specified density for initial shape. If parameter Density is equal to 0 then density will be computed automatically by criterion:

  • 10 points per minimal unreduced face area.

Note: this function should not be called from concurrent threads without external lock.

◆ GeneratePointsByTriangulation()

Standard_Boolean BRepLib_PointCloudShape::GeneratePointsByTriangulation ( )

Get points from triangulation existing in the shape.

◆ GetDistance()

Standard_Real BRepLib_PointCloudShape::GetDistance ( ) const
inline

Returns value of the distance to define deflection of points from shape along normal to shape; 0.0 by default.

◆ NbPointsByDensity()

Standard_Integer BRepLib_PointCloudShape::NbPointsByDensity ( const Standard_Real  theDensity = 0.0)

Returns size of the point cloud for specified density.

◆ NbPointsByTriangulation()

Standard_Integer BRepLib_PointCloudShape::NbPointsByTriangulation ( ) const

Returns size of the point cloud for using triangulation.

◆ SetDistance()

void BRepLib_PointCloudShape::SetDistance ( const Standard_Real  theDist)
inline

Sets value of the distance to define deflection of points from shape along normal to shape. Negative values of theDist parameter are ignored.

◆ SetShape()

void BRepLib_PointCloudShape::SetShape ( const TopoDS_Shape theShape)
inline

Set shape.

◆ SetTolerance()

void BRepLib_PointCloudShape::SetTolerance ( Standard_Real  theTol)
inline

Set tolerance.

◆ Shape()

const TopoDS_Shape& BRepLib_PointCloudShape::Shape ( ) const
inline

Return loaded shape.

◆ Tolerance()

Standard_Real BRepLib_PointCloudShape::Tolerance ( ) const
inline

Return tolerance.

Field Documentation

◆ myDist

Standard_Real BRepLib_PointCloudShape::myDist
protected

◆ myFaceArea

TopTools_DataMapOfShapeReal BRepLib_PointCloudShape::myFaceArea
protected

◆ myFacePoints

TopTools_DataMapOfShapeInteger BRepLib_PointCloudShape::myFacePoints
protected

◆ myNbPoints

Standard_Integer BRepLib_PointCloudShape::myNbPoints
protected

◆ myShape

TopoDS_Shape BRepLib_PointCloudShape::myShape
protected

◆ myTol

Standard_Real BRepLib_PointCloudShape::myTol
protected

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