CAD Exchanger SDK
cadex::ModelCheck_ProblemVisitor Class Reference

Base class for ModelCheck_BRepChecker problems. More...

Inherited by cadex::internal::CadExModelXDEBrowser_TreeItemBuilder.

Public Member Functions

virtual ~ModelCheck_ProblemVisitor ()
 Destructor.
 
virtual void Visit (const ModelCheck_ContinuityProblem &) const
 Visits a problem.
 
virtual void Visit (const ModelCheck_EdgeToleranceProblem &) const
 Visits a problem.
 
virtual void Visit (const ModelCheck_IntersectionProblem &) const
 Visits a problem.
 
virtual void Visit (const ModelCheck_OverlapProblem &) const
 Visits a problem.
 
virtual void Visit (const ModelCheck_SizeProblem &) const
 Visits a problem.
 
virtual void Visit (const ModelCheck_TopologyProblem &) const
 Visits a problem.
 
virtual void Visit (const ModelCheck_VertexToleranceProblem &) const
 Visits a problem.
 

Detailed Description

Base class for ModelCheck_BRepChecker problems.

Visitor is a very convenient way to inspect problems, received from checker. Users should subclass from this class and override Visit methods for interesting problems.

Exmaple:

class MyVisitor : public ModelCheck_ProblemVisitor
{
public:
void ModelCheck_ProblemVisitor::Visit (const ModelCheck_ContinuityProblem& theProblem) const override
{ std::cout << "I'm continuity problem\n"; }
void ModelCheck_ProblemVisitor::Visit (const ModelCheck_IntersectionProblem& theProblem) const override
{ std::cout << "I'm intersection problem\n";
// For other problems Visit will do nothing.
}
void ModelCheck_ProblemVisitor::MyFunc()
{
// Get problem from checker. Consult ModelCheck_BRepChecker documentation for this.
const std::shared_ptr <ModelCheck_BaseProblem>& aProblem;
aProblem->Accept (MyVisitor());
// If problem type is continuity or intersection, there will be an output to cout.
// No explicit static / dynamic casts are needed.
}