Open CASCADE Technology  7.3.0
Public Types | Public Member Functions

BRepMesh_GeomTool Class Reference

Tool class accumulating common geometrical functions as well as functionality using shape geometry to produce data necessary for tessellation. General aim is to calculate discretization points for the given curve or iso curve of surface according to the specified parameters. More...

#include <BRepMesh_GeomTool.hxx>

Public Types

enum  IntFlag {
  NoIntersection, Cross, EndPointTouch, PointOnSegment,
  Glued, Same
}
 Enumerates states of segments intersection check. More...
 

Public Member Functions

 BRepMesh_GeomTool (const BRepAdaptor_Curve &theCurve, const Standard_Real theFirstParam, const Standard_Real theLastParam, const Standard_Real theLinDeflection, const Standard_Real theAngDeflection, const Standard_Integer theMinPointsNb=2, const Standard_Real theMinSize=Precision::Confusion())
 Constructor. Initiates discretization of the given geometric curve. More...
 
 BRepMesh_GeomTool (const Handle< BRepAdaptor_HSurface > &theSurface, const GeomAbs_IsoType theIsoType, const Standard_Real theParamIso, const Standard_Real theFirstParam, const Standard_Real theLastParam, const Standard_Real theLinDeflection, const Standard_Real theAngDeflection, const Standard_Integer theMinPointsNb=2, const Standard_Real theMinSize=Precision::Confusion())
 Constructor. Initiates discretization of geometric curve corresponding to iso curve of the given surface. More...
 
Standard_Integer AddPoint (const gp_Pnt &thePoint, const Standard_Real theParam, const Standard_Boolean theIsReplace=Standard_True)
 Adds point to already calculated points (or replaces existing). More...
 
Standard_Integer NbPoints () const
 Returns number of discretization points. More...
 
Standard_Boolean Value (const Standard_Integer theIndex, const Standard_Real theIsoParam, Standard_Real &theParam, gp_Pnt &thePoint, gp_Pnt2d &theUV) const
 Gets parameters of discretization point with the given index. More...
 
Standard_Boolean Value (const Standard_Integer theIndex, Standard_Real &theParam, gp_Pnt &thePoint) const
 Gets parameters of discretization point with the given index. More...
 

static API

static Standard_Boolean Normal (const Handle< BRepAdaptor_HSurface > &theSurface, const Standard_Real theParamU, const Standard_Real theParamV, gp_Pnt &thePoint, gp_Dir &theNormal)
 Computes normal to the given surface at the specified position in parametric space. More...
 
static IntFlag IntLinLin (const gp_XY &theStartPnt1, const gp_XY &theEndPnt1, const gp_XY &theStartPnt2, const gp_XY &theEndPnt2, gp_XY &theIntPnt, Standard_Real(&theParamOnSegment)[2])
 Checks intersection between two lines defined by two points. More...
 
static IntFlag IntSegSeg (const gp_XY &theStartPnt1, const gp_XY &theEndPnt1, const gp_XY &theStartPnt2, const gp_XY &theEndPnt2, const Standard_Boolean isConsiderEndPointTouch, const Standard_Boolean isConsiderPointOnSegment, gp_Pnt2d &theIntPnt)
 Checks intersection between the two segments. Checks that intersection point lies within ranges of both segments. More...
 

Detailed Description

Tool class accumulating common geometrical functions as well as functionality using shape geometry to produce data necessary for tessellation. General aim is to calculate discretization points for the given curve or iso curve of surface according to the specified parameters.

Member Enumeration Documentation

◆ IntFlag

Enumerates states of segments intersection check.

Enumerator
NoIntersection 
Cross 
EndPointTouch 
PointOnSegment 
Glued 
Same 

Constructor & Destructor Documentation

◆ BRepMesh_GeomTool() [1/2]

BRepMesh_GeomTool::BRepMesh_GeomTool ( const BRepAdaptor_Curve theCurve,
const Standard_Real  theFirstParam,
const Standard_Real  theLastParam,
const Standard_Real  theLinDeflection,
const Standard_Real  theAngDeflection,
const Standard_Integer  theMinPointsNb = 2,
const Standard_Real  theMinSize = Precision::Confusion() 
)

Constructor. Initiates discretization of the given geometric curve.

Parameters
theCurvecurve to be discretized.
theFirstParamfirst parameter of the curve.
theLastParamlast parameter of the curve.
theLinDeflectionlinear deflection.
theAngDeflectionangular deflection.
theMinPointsNbminimum nuber of points to be produced.

◆ BRepMesh_GeomTool() [2/2]

BRepMesh_GeomTool::BRepMesh_GeomTool ( const Handle< BRepAdaptor_HSurface > &  theSurface,
const GeomAbs_IsoType  theIsoType,
const Standard_Real  theParamIso,
const Standard_Real  theFirstParam,
const Standard_Real  theLastParam,
const Standard_Real  theLinDeflection,
const Standard_Real  theAngDeflection,
const Standard_Integer  theMinPointsNb = 2,
const Standard_Real  theMinSize = Precision::Confusion() 
)

Constructor. Initiates discretization of geometric curve corresponding to iso curve of the given surface.

Parameters
theSurfacesurface the iso curve to be taken from.
theIsoTypetype of iso curve to be used, U or V.
theParamIsoparameter on the surface specifying the iso curve.
theFirstParamfirst parameter of the curve.
theLastParamlast parameter of the curve.
theLinDeflectionlinear deflection.
theAngDeflectionangular deflection.
theMinPointsNbminimum nuber of points to be produced.

Member Function Documentation

◆ AddPoint()

Standard_Integer BRepMesh_GeomTool::AddPoint ( const gp_Pnt thePoint,
const Standard_Real  theParam,
const Standard_Boolean  theIsReplace = Standard_True 
)
inline

Adds point to already calculated points (or replaces existing).

Parameters
thePointpoint to be added.
theParamparameter on the curve corresponding to the given point.
theIsReplaceif TRUE replaces existing point lying within parameteric tolerance of the given point.
Returns
index of new added point or found with parametric tolerance

◆ IntLinLin()

static IntFlag BRepMesh_GeomTool::IntLinLin ( const gp_XY theStartPnt1,
const gp_XY theEndPnt1,
const gp_XY theStartPnt2,
const gp_XY theEndPnt2,
gp_XY theIntPnt,
Standard_Real(&)  theParamOnSegment[2] 
)
static

Checks intersection between two lines defined by two points.

Parameters
theStartPnt1start point of first line.
theEndPnt1end point of first line.
theStartPnt2start point of second line.
theEndPnt2end point of second line.
[out]theIntPntpoint of intersection.
[out]theParamOnSegmentparameters of intersection point corresponding to first and second segment.
Returns
status of intersection check.

◆ IntSegSeg()

static IntFlag BRepMesh_GeomTool::IntSegSeg ( const gp_XY theStartPnt1,
const gp_XY theEndPnt1,
const gp_XY theStartPnt2,
const gp_XY theEndPnt2,
const Standard_Boolean  isConsiderEndPointTouch,
const Standard_Boolean  isConsiderPointOnSegment,
gp_Pnt2d theIntPnt 
)
static

Checks intersection between the two segments. Checks that intersection point lies within ranges of both segments.

Parameters
theStartPnt1start point of first segment.
theEndPnt1end point of first segment.
theStartPnt2start point of second segment.
theEndPnt2end point of second segment.
isConsiderEndPointTouchif TRUE EndPointTouch status will be returned in case if segments are touching by end points, if FALSE returns NoIntersection flag.
isConsiderPointOnSegmentif TRUE PointOnSegment status will be returned in case if end point of one segment lies onto another one, if FALSE returns NoIntersection flag.
[out]theIntPntpoint of intersection.
Returns
status of intersection check.

◆ NbPoints()

Standard_Integer BRepMesh_GeomTool::NbPoints ( ) const
inline

Returns number of discretization points.

◆ Normal()

static Standard_Boolean BRepMesh_GeomTool::Normal ( const Handle< BRepAdaptor_HSurface > &  theSurface,
const Standard_Real  theParamU,
const Standard_Real  theParamV,
gp_Pnt thePoint,
gp_Dir theNormal 
)
static

Computes normal to the given surface at the specified position in parametric space.

Parameters
theSurfacesurface the normal should be found for.
theParamUU parameter in parametric space of the surface.
theParamVV parameter in parametric space of the surface.
[out]thePoint3d point corresponding to the given parameters.
[out]theNormalnormal vector at the point specified by the parameters.
Returns
FALSE if the normal can not be computed, TRUE elsewhere.

◆ Value() [1/2]

Standard_Boolean BRepMesh_GeomTool::Value ( const Standard_Integer  theIndex,
const Standard_Real  theIsoParam,
Standard_Real theParam,
gp_Pnt thePoint,
gp_Pnt2d theUV 
) const

Gets parameters of discretization point with the given index.

Parameters
theIndexindex of discretization point.
theIsoParamparameter on surface to be used as second coordinate of resulting 2d point.
theParam[out]parameter of the point on the iso curve.
thePoint[out]discretization point.
theUV[out]discretization point in parametric space of the surface.
Returns
TRUE on success, FALSE elsewhere.

◆ Value() [2/2]

Standard_Boolean BRepMesh_GeomTool::Value ( const Standard_Integer  theIndex,
Standard_Real theParam,
gp_Pnt thePoint 
) const

Gets parameters of discretization point with the given index.

Parameters
theIndexindex of discretization point.
theParam[out]parameter of the point on the curve.
thePoint[out]discretization point.
Returns
TRUE on success, FALSE elsewhere.

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