Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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 double theTol=Precision::Confusion())
 Constructor initialized by shape.
 
virtual ~BRepLib_PointCloudShape ()
 Virtual destructor.
 
const TopoDS_ShapeShape () const
 Return loaded shape.
 
void SetShape (const TopoDS_Shape &theShape)
 Set shape.
 
double Tolerance () const
 Return tolerance.
 
void SetTolerance (double theTol)
 Set tolerance.
 
double GetDistance () const
 Returns value of the distance to define deflection of points from shape along normal to shape; 0.0 by default.
 
void SetDistance (const double theDist)
 Sets value of the distance to define deflection of points from shape along normal to shape. Negative values of theDist parameter are ignored.
 
int NbPointsByDensity (const double theDensity=0.0)
 Returns size of the point cloud for specified density.
 
int NbPointsByTriangulation () const
 Returns size of the point cloud for using triangulation.
 
bool GeneratePointsByDensity (const double 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:
 
bool GeneratePointsByTriangulation ()
 Get points from triangulation existing in the shape.
 

Protected Member Functions

double faceArea (const TopoDS_Shape &theShape)
 Compute area of the specified face.
 
double computeDensity ()
 Computes default density points per face.
 
bool addDensityPoints (const TopoDS_Shape &theFace)
 Adds points to face in accordance with the specified density randomly in the specified range [0, Dist].
 
bool addTriangulationPoints (const TopoDS_Shape &theFace)
 Adds points to face by nodes of the existing triangulation randomly in the specified range [0, Dist].
 
virtual void clear ()
 Method to clear maps.
 
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.
 

Protected Attributes

TopoDS_Shape myShape
 
double myDist
 
double myTol
 
NCollection_DataMap< TopoDS_Shape, double, TopTools_ShapeMapHashermyFaceArea
 
NCollection_DataMap< TopoDS_Shape, int, TopTools_ShapeMapHashermyFacePoints
 
int 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 double theTol = Precision::Confusion() )

Constructor initialized by shape.

◆ ~BRepLib_PointCloudShape()

virtual BRepLib_PointCloudShape::~BRepLib_PointCloudShape ( )
virtual

Virtual destructor.

Member Function Documentation

◆ addDensityPoints()

bool 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()

bool 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()

double BRepLib_PointCloudShape::computeDensity ( )
protected

Computes default density points per face.

◆ faceArea()

double BRepLib_PointCloudShape::faceArea ( const TopoDS_Shape & theShape)
protected

Compute area of the specified face.

◆ GeneratePointsByDensity()

bool BRepLib_PointCloudShape::GeneratePointsByDensity ( const double 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()

bool BRepLib_PointCloudShape::GeneratePointsByTriangulation ( )

Get points from triangulation existing in the shape.

◆ GetDistance()

double 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()

int BRepLib_PointCloudShape::NbPointsByDensity ( const double theDensity = 0.0)

Returns size of the point cloud for specified density.

◆ NbPointsByTriangulation()

int BRepLib_PointCloudShape::NbPointsByTriangulation ( ) const

Returns size of the point cloud for using triangulation.

◆ SetDistance()

void BRepLib_PointCloudShape::SetDistance ( const double 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 ( double theTol)
inline

Set tolerance.

◆ Shape()

const TopoDS_Shape & BRepLib_PointCloudShape::Shape ( ) const
inline

Return loaded shape.

◆ Tolerance()

double BRepLib_PointCloudShape::Tolerance ( ) const
inline

Return tolerance.

Field Documentation

◆ myDist

double BRepLib_PointCloudShape::myDist
protected

◆ myFaceArea

NCollection_DataMap<TopoDS_Shape, double, TopTools_ShapeMapHasher> BRepLib_PointCloudShape::myFaceArea
protected

◆ myFacePoints

NCollection_DataMap<TopoDS_Shape, int, TopTools_ShapeMapHasher> BRepLib_PointCloudShape::myFacePoints
protected

◆ myNbPoints

int BRepLib_PointCloudShape::myNbPoints
protected

◆ myShape

TopoDS_Shape BRepLib_PointCloudShape::myShape
protected

◆ myTol

double BRepLib_PointCloudShape::myTol
protected

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