Hide menu
Loading...
Searching...
No Matches
cadex::ModelCheck_BRepChecker Class Reference

Provides an interface to perform various checks to BRep shape. More...

#include <cadex/ModelCheck_BRepChecker.hxx>

Classes

class  Options
 Holds options for checker tools. More...
 
class  ProblemIterator
 
class  ProblemWithShape
 
class  ProblemWithShapeIterator
 
struct  Tool
 Tools flags. More...
 

Public Types

typedef Options OptionsType
 
typedef std::shared_ptr< internal::ModelCheck_BRepCheckerImpl > ImplType
 

Public Member Functions

 ModelCheck_BRepChecker ()
 Constructor.
 
 ModelCheck_BRepChecker (const OptionsType &theOptions)
 Constructor.
 
OptionsTypeSetOptions ()
 Returns an internal Options object.
 
void SetOptions (const OptionsType &theOptions)
 Sets an Options object.
 
const OptionsTypeOptions () const
 Returns an internal Options object.
 
bool Check (const ModelData_Shape &theShape)
 Performs check on the given shape.
 
bool HasProblems () const
 Returns true if last checked shape has problems and false otherwise.
 
ModelData_ShapeList ProblematicShapes () const
 Returns all subshapes which has problems.
 
ProblemIterator Problems (const ModelData_Shape &theShape) const
 Returns iterator over problems of the given subshape.
 
ProblemWithShapeIterator Problems (ModelCheck_ErrorLevel theLevel) const
 Returns iterator over problem with shapes of the given level.
 
size_t NumberOfProblems (const ModelData_Shape &theShape) const
 Returns number of problems for the given subshape.
 
size_t NumberOfProblems (ModelCheck_ErrorLevel theLevel) const
 Returns number of problems for the given level.
 
const ModelData_ShapeShape () const
 Returns the last checked shape.
 
size_t FindID (const ModelData_Shape &theShape) const
 Returns the ID of subshape.
 
ModelData_Shape FindShape (size_t theID) const
 Returns the shape with given ID.
 
const Base_ProgressStatusProgressStatus () const
 Returns progress status.
 
Base_ProgressStatusProgressStatus ()
 Returns progress status.
 
const ImplType & Impl () const
 

Protected Attributes

ImplType myImpl
 

Detailed Description

Provides an interface to perform various checks to BRep shape.

Usage example:

aChecker.SetOptions()
.ToleranceControlPoints (11) // tune
.UseSameParam (true); // options
ModelData_Shape aShape; // some real shape
aChecker.Check (aShape);
// Go through all shapes with problems.
ModelData_ShapeList aProblematicShapes = aChecker.ProblematicShapes();
for (ModelData_ShapeList::SizeType i = 0; i < aProblematicShapes.Size(); ++i) {
const ModelData_Shape& aShape = aProblematicShapes[i];
ModelCheck_BRepChecker::ProblemIterator aProblemsIt = aChecker.Problems (aShape);
while (aProblemsIt.HasNext()) {
const std::shared_ptr <ModelCheck_BaseProblem>& aProblem = aProblemsIt.Next();
// Inspect problem. Consider using ModelCheck_ProblemVisitor.
}
}
// Generate an .xml report.
ModelCheck_XmlReportGenerator aGen ("D:/report.xml");
aGen.Generate (aChecker);
aGen.Dump();
Options & ToleranceControlPoints(size_t ToleranceControlPoints)
Sets number of control points for Tool::Tolerance.
Definition: ModelCheck_BRepChecker.cxx:397
Options & Tools(Tool::FlagType theTools)
Sets which tools will be used by checker.
Definition: ModelCheck_BRepChecker.cxx:390
Options & UseSameParam(bool UseSameParam)
Sets "use same parameter" flag for Tool::Tolerance.
Definition: ModelCheck_BRepChecker.cxx:399
Definition: ModelCheck_BRepChecker.hxx:153
bool HasNext() const
Definition: ModelCheck_BRepChecker.cxx:530
const std::shared_ptr< ModelCheck_BaseProblem > & Next()
Definition: ModelCheck_BRepChecker.cxx:537
Provides an interface to perform various checks to BRep shape.
Definition: ModelCheck_BRepChecker.hxx:45
ProblemIterator Problems(const ModelData_Shape &theShape) const
Returns iterator over problems of the given subshape.
Definition: ModelCheck_BRepChecker.cxx:1054
bool Check(const ModelData_Shape &theShape)
Performs check on the given shape.
Definition: ModelCheck_BRepChecker.cxx:1037
OptionsType & SetOptions()
Returns an internal Options object.
Definition: ModelCheck_BRepChecker.cxx:1018
ModelData_ShapeList ProblematicShapes() const
Returns all subshapes which has problems.
Definition: ModelCheck_BRepChecker.cxx:1048
Base class of topological shapes.
Definition: ModelData_Shape.hxx:37
Defines a list of shapes.
Definition: ModelData_ShapeList.hxx:32
Tools flags.
Definition: ModelCheck_BRepChecker.hxx:50
@ Intersection
Definition: ModelCheck_BRepChecker.hxx:54
@ Tolerance
Definition: ModelCheck_BRepChecker.hxx:57
Examples
modeling/assembly/main.cxx.

Member Function Documentation

◆ Check()

bool cadex::ModelCheck_BRepChecker::Check ( const ModelData_Shape theShape)

Performs check on the given shape.

One checker can be safely applied to a set of shapes (e.g. in loop). The options will remain same and all internal data will be reinitialized to work with new shape.

Examples
modeling/assembly/main.cxx.

◆ Problems()

ModelCheck_BRepChecker::ProblemWithShapeIterator cadex::ModelCheck_BRepChecker::Problems ( ModelCheck_ErrorLevel  theLevel) const

Returns iterator over problem with shapes of the given level.

This is an another approach to get all collected problems from checker. A simple example on how to use this method:

aChecker.Problems (ModelCheck_EL_Warning2); // all problems of Warning2 level
while (aProblemsByLevelIt.HasNext()) {
// Get current problem with shape and advance iterator
const ModelCheck_BRepChecker::ProblemWithShape& aProblemWithShape = aProblemsByLevelIt.Next();
const std::shared_ptr <ModelCheck_BaseProblem>& aProblem = aProblemWithShape.Problem();
const ModelData_Shape& aShape = aProblemWithShape.Shape();
// Inspect the shape and problem. Consider using ModelCheck_ProblemVisitor.
}
Definition: ModelCheck_BRepChecker.hxx:141
const std::shared_ptr< ModelCheck_BaseProblem > & Problem() const
Definition: ModelCheck_BRepChecker.cxx:500
Definition: ModelCheck_BRepChecker.hxx:165
bool HasNext() const
Definition: ModelCheck_BRepChecker.cxx:554
const ProblemWithShape & Next()
Definition: ModelCheck_BRepChecker.cxx:561