Open CASCADE Technology 7.8.0
Public Member Functions
BRepCheck_Analyzer Class Reference

A framework to check the overall validity of a shape. For a shape to be valid in Open CASCADE, it - or its component subshapes - must respect certain criteria. These criteria are checked by the function IsValid. Once you have determined whether a shape is valid or not, you can diagnose its specific anomalies and correct them using the services of the ShapeAnalysis, ShapeUpgrade, and ShapeFix packages. More...

#include <BRepCheck_Analyzer.hxx>

Public Member Functions

 BRepCheck_Analyzer (const TopoDS_Shape &S, const Standard_Boolean GeomControls=Standard_True, const Standard_Boolean theIsParallel=Standard_False, const Standard_Boolean theIsExact=Standard_False)
 Constructs a shape validation object defined by the shape S. is the shape to control. <GeomControls> If False only topological informaions are checked. The geometricals controls are For a Vertex : BRepCheck_InvalidToleranceValue NYI For an Edge : BRepCheck_InvalidCurveOnClosedSurface, BRepCheck_InvalidCurveOnSurface, BRepCheck_InvalidSameParameterFlag, BRepCheck_InvalidToleranceValue NYI For a face : BRepCheck_UnorientableShape, BRepCheck_IntersectingWires, BRepCheck_InvalidToleranceValue NYI For a wire : BRepCheck_SelfIntersectingWire.
 
void Init (const TopoDS_Shape &S, const Standard_Boolean GeomControls=Standard_True)
  is the shape to control. <GeomControls> If False only topological informaions are checked. The geometricals controls are For a Vertex : BRepCheck_InvalidTolerance NYI For an Edge : BRepCheck_InvalidCurveOnClosedSurface, BRepCheck_InvalidCurveOnSurface, BRepCheck_InvalidSameParameterFlag, BRepCheck_InvalidTolerance NYI For a face : BRepCheck_UnorientableShape, BRepCheck_IntersectingWires, BRepCheck_InvalidTolerance NYI For a wire : BRepCheck_SelfIntersectingWire
 
void SetExactMethod (const Standard_Boolean theIsExact)
 Sets method to calculate distance: Calculating in finite number of points (if theIsExact is false, faster, but possible not correct result) or exact calculating by using BRepLib_CheckCurveOnSurface class (if theIsExact is true, slowly, but more correctly). Exact method is used only when edge is SameParameter. Default method is calculating in finite number of points.
 
Standard_Boolean IsExactMethod ()
 Returns true if exact method selected.
 
void SetParallel (const Standard_Boolean theIsParallel)
 Sets parallel flag.
 
Standard_Boolean IsParallel ()
 Returns true if parallel flag is set.
 
Standard_Boolean IsValid (const TopoDS_Shape &S) const
  is a subshape of the original shape. Returns <STandard_True> if no default has been detected on and any of its subshape.
 
Standard_Boolean IsValid () const
 Returns true if no defect is detected on the shape S or any of its subshapes. Returns true if the shape S is valid. This function checks whether a given shape is valid by checking that:
 
const Handle< BRepCheck_Result > & Result (const TopoDS_Shape &theSubS) const
 

Detailed Description

A framework to check the overall validity of a shape. For a shape to be valid in Open CASCADE, it - or its component subshapes - must respect certain criteria. These criteria are checked by the function IsValid. Once you have determined whether a shape is valid or not, you can diagnose its specific anomalies and correct them using the services of the ShapeAnalysis, ShapeUpgrade, and ShapeFix packages.

Constructor & Destructor Documentation

◆ BRepCheck_Analyzer()

BRepCheck_Analyzer::BRepCheck_Analyzer ( const TopoDS_Shape S,
const Standard_Boolean  GeomControls = Standard_True,
const Standard_Boolean  theIsParallel = Standard_False,
const Standard_Boolean  theIsExact = Standard_False 
)
inline

Constructs a shape validation object defined by the shape S. is the shape to control. <GeomControls> If False only topological informaions are checked. The geometricals controls are For a Vertex : BRepCheck_InvalidToleranceValue NYI For an Edge : BRepCheck_InvalidCurveOnClosedSurface, BRepCheck_InvalidCurveOnSurface, BRepCheck_InvalidSameParameterFlag, BRepCheck_InvalidToleranceValue NYI For a face : BRepCheck_UnorientableShape, BRepCheck_IntersectingWires, BRepCheck_InvalidToleranceValue NYI For a wire : BRepCheck_SelfIntersectingWire.

Member Function Documentation

◆ Init()

void BRepCheck_Analyzer::Init ( const TopoDS_Shape S,
const Standard_Boolean  GeomControls = Standard_True 
)

is the shape to control. <GeomControls> If False only topological informaions are checked. The geometricals controls are For a Vertex : BRepCheck_InvalidTolerance NYI For an Edge : BRepCheck_InvalidCurveOnClosedSurface, BRepCheck_InvalidCurveOnSurface, BRepCheck_InvalidSameParameterFlag, BRepCheck_InvalidTolerance NYI For a face : BRepCheck_UnorientableShape, BRepCheck_IntersectingWires, BRepCheck_InvalidTolerance NYI For a wire : BRepCheck_SelfIntersectingWire

◆ IsExactMethod()

Standard_Boolean BRepCheck_Analyzer::IsExactMethod ( )
inline

Returns true if exact method selected.

◆ IsParallel()

Standard_Boolean BRepCheck_Analyzer::IsParallel ( )
inline

Returns true if parallel flag is set.

◆ IsValid() [1/2]

Standard_Boolean BRepCheck_Analyzer::IsValid ( ) const
inline

Returns true if no defect is detected on the shape S or any of its subshapes. Returns true if the shape S is valid. This function checks whether a given shape is valid by checking that:

  • the topology is correct
  • parameterization of edges in particular is correct. For the topology to be correct, the following conditions must be satisfied:
  • edges should have at least two vertices if they are not degenerate edges. The vertices should be within the range of the bounding edges at the tolerance specified in the vertex,
  • edges should share at least one face. The representation of the edges should be within the tolerance criterion assigned to them.
  • wires defining a face should not self-intersect and should be closed,
  • there should be one wire which contains all other wires inside a face,
  • wires should be correctly oriented with respect to each of the edges,
  • faces should be correctly oriented, in particular with respect to adjacent faces if these faces define a solid,
  • shells defining a solid should be closed. There should be one enclosing shell if the shape is a solid; To check parameterization of edge, there are 2 approaches depending on the edge?s contextual situation.
  • if the edge is either single, or it is in the context of a wire or a compound, its parameterization is defined by the parameterization of its 3D curve and is considered as valid.
  • If the edge is in the context of a face, it should have SameParameter and SameRange flags set to Standard_True. To check these flags, you should call the function BRep_Tool::SameParameter and BRep_Tool::SameRange for an edge. If at least one of these flags is set to Standard_False, the edge is considered as invalid without any additional check. If the edge is contained by a face, and it has SameParameter and SameRange flags set to Standard_True, IsValid checks whether representation of the edge on face, in context of which the edge is considered, has the same parameterization up to the tolerance value coded on the edge. For a given parameter t on the edge having C as a 3D curve and one PCurve P on a surface S (base surface of the reference face), this checks that |C(t) - S(P(t))| is less than or equal to tolerance, where tolerance is the tolerance value coded on the edge.

◆ IsValid() [2/2]

Standard_Boolean BRepCheck_Analyzer::IsValid ( const TopoDS_Shape S) const

is a subshape of the original shape. Returns <STandard_True> if no default has been detected on and any of its subshape.

◆ Result()

const Handle< BRepCheck_Result > & BRepCheck_Analyzer::Result ( const TopoDS_Shape theSubS) const
inline

◆ SetExactMethod()

void BRepCheck_Analyzer::SetExactMethod ( const Standard_Boolean  theIsExact)
inline

Sets method to calculate distance: Calculating in finite number of points (if theIsExact is false, faster, but possible not correct result) or exact calculating by using BRepLib_CheckCurveOnSurface class (if theIsExact is true, slowly, but more correctly). Exact method is used only when edge is SameParameter. Default method is calculating in finite number of points.

◆ SetParallel()

void BRepCheck_Analyzer::SetParallel ( const Standard_Boolean  theIsParallel)
inline

Sets parallel flag.


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