OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    BRepAlgoAPI_BuilderAlgo Class Reference

    The class contains API level of the General Fuse algorithm. More...

    #include <BRepAlgoAPI_BuilderAlgo.hxx>

    Inheritance diagram for BRepAlgoAPI_BuilderAlgo:

    Public Member Functions

    Constructors

    Empty constructor

     BRepAlgoAPI_BuilderAlgo ()
     Constructor with prepared Filler object.
     ~BRepAlgoAPI_BuilderAlgo () override
     Constructor with prepared Filler object.
     BRepAlgoAPI_BuilderAlgo (const BOPAlgo_PaveFiller &thePF)
     Constructor with prepared Filler object.
     BRepAlgoAPI_BuilderAlgo (const BRepAlgoAPI_BuilderAlgo &)=delete
     Copy constructor is not allowed.
     BRepAlgoAPI_BuilderAlgo (BRepAlgoAPI_BuilderAlgo &&)=delete
     Move constructor is not allowed.
    BRepAlgoAPI_BuilderAlgooperator= (const BRepAlgoAPI_BuilderAlgo &)=delete
     Copy assignment is not allowed.
    BRepAlgoAPI_BuilderAlgooperator= (BRepAlgoAPI_BuilderAlgo &&)=delete
     Move assignment is not allowed.
    Setting/Getting data for the algorithm

    Sets the arguments

    void SetArguments (const NCollection_List< TopoDS_Shape > &theLS)
     Gets the arguments.
    const NCollection_List< TopoDS_Shape > & Arguments () const
     Gets the arguments.
    Setting options

    Sets the flag that defines the mode of treatment. In non-destructive mode the argument shapes are not modified. Instead a copy of a sub-shape is created in the result if it is needed to be updated.

    void SetNonDestructive (const bool theFlag)
     Returns the flag that defines the mode of treatment. In non-destructive mode the argument shapes are not modified. Instead a copy of a sub-shape is created in the result if it is needed to be updated.
    bool NonDestructive () const
     Returns the flag that defines the mode of treatment. In non-destructive mode the argument shapes are not modified. Instead a copy of a sub-shape is created in the result if it is needed to be updated.
    void SetGlue (const BOPAlgo_GlueEnum theGlue)
     Sets the glue option for the algorithm, which allows increasing performance of the intersection of the input shapes.
    BOPAlgo_GlueEnum Glue () const
     Returns the glue option of the algorithm.
    void SetCheckInverted (const bool theCheck)
     Enables/Disables the check of the input solids for inverted status.
    bool CheckInverted () const
     Returns the flag defining whether the check for input solids on inverted status should be performed or not.
    Performing the operation

    Performs the algorithm

    void Build (const Message_ProgressRange &theRange=Message_ProgressRange()) override
     This is called by Shape(). It does nothing but may be redefined.
    Result simplification

    Simplification of the result shape is performed by the means of ShapeUpgrade_UnifySameDomain algorithm. The result of the operation will be overwritten with the simplified result.

    The simplification is performed without creation of the Internal shapes, i.e. shapes connections will never be broken.

    Simplification is performed on the whole result shape. Thus, if the input shapes contained connected tangent edges or faces unmodified during the operation they will also be unified.

    After simplification, the History of result simplification is merged into the main history of operation. So, it is taken into account when asking for Modified, Generated and Deleted shapes.

    Some options of the main operation are passed into the Unifier:

    • Fuzzy tolerance of the operation is given to the Unifier as the linear tolerance.
    • Non destructive mode here controls the safe input mode in Unifier.
    Parameters
    theUnifyEdgesControls the edges unification. TRUE by default.
    theUnifyFacesControls the faces unification. TRUE by default.
    theAngularTolAngular criteria for tangency of edges and faces. Precision::Angular() by default.
    void SimplifyResult (const bool theUnifyEdges=true, const bool theUnifyFaces=true, const double theAngularTol=Precision::Angular())
    History support

    Returns the shapes modified from the shape <theS>. If any, the list will contain only those splits of the given shape, contained in the result.

    const NCollection_List< TopoDS_Shape > & Modified (const TopoDS_Shape &theS) override
     Returns the list of shapes generated from the shape <theS>. In frames of Boolean Operations algorithms only Edges and Faces could have Generated elements, as only they produce new elements during intersection:
    const NCollection_List< TopoDS_Shape > & Generated (const TopoDS_Shape &theS) override
     Returns the list of shapes generated from the shape <theS>. In frames of Boolean Operations algorithms only Edges and Faces could have Generated elements, as only they produce new elements during intersection:
    bool IsDeleted (const TopoDS_Shape &aS) override
     Checks if the shape <theS> has been completely removed from the result, i.e. the result does not contain the shape itself and any of its splits. Returns TRUE if the shape has been deleted.
    virtual bool HasModified () const
     Returns true if any of the input shapes has been modified during operation.
    virtual bool HasGenerated () const
     Returns true if any of the input shapes has generated shapes during operation.
    virtual bool HasDeleted () const
     Returns true if any of the input shapes has been deleted during operation. Normally, General Fuse operation should not have Deleted elements, but all derived operation can have.
    Enabling/Disabling the history collection.

    Allows disabling the history collection

    void SetToFillHistory (const bool theHistFlag)
     Returns flag of history availability.
    bool HasHistory () const
     Returns flag of history availability.
    Getting the section edges

    Returns a list of section edges. The edges represent the result of intersection between arguments of operation.

    const NCollection_List< TopoDS_Shape > & SectionEdges ()
    Getting tools performing the job

    Returns the Intersection tool

    const BOPAlgo_PPaveFillerDSFiller () const
     Returns the Building tool.
    const BOPAlgo_PBuilderBuilder () const
     Returns the Building tool.
    occ::handle< BRepTools_HistoryHistory () const
     History tool.
    Public Member Functions inherited from BRepAlgoAPI_Algo
    const TopoDS_ShapeShape () override
     Returns a shape built by the shape construction algorithm. Does not check if the shape is built.
    void ClearWarnings ()
     Clears the warnings of the algorithm.
    void DumpErrors (Standard_OStream &theOS) const
     Dumps the error status into the given stream.
    void DumpWarnings (Standard_OStream &theOS) const
     Dumps the warning statuses into the given stream.
    double FuzzyValue () const
     Returns the additional tolerance.
    const occ::handle< Message_Report > & GetReport () const
     Returns report collecting all errors and warnings.
    bool HasError (const occ::handle< Standard_Type > &theType) const
     Returns true if algorithm has generated error of specified type.
    bool HasErrors () const
     Returns true if algorithm has failed.
    bool HasWarning (const occ::handle< Standard_Type > &theType) const
     Returns true if algorithm has generated warning of specified type.
    bool HasWarnings () const
     Returns true if algorithm has generated some warning alerts.
    bool RunParallel () const
     Returns the flag of parallel processing.
    void SetFuzzyValue (const double theFuzz)
     Sets the additional tolerance.
    void SetRunParallel (const bool theFlag)
     Set the flag of parallel processing if <theFlag> is true the parallel processing is switched on if <theFlag> is false the parallel processing is switched off.
    void SetUseOBB (const bool theUseOBB)
     Enables/Disables the usage of OBB.
    Public Member Functions inherited from BRepBuilderAPI_MakeShape
     operator TopoDS_Shape ()
    Public Member Functions inherited from BRepBuilderAPI_Command
    virtual ~BRepBuilderAPI_Command ()
    virtual bool IsDone () const
    void Check () const
     Raises NotDone if done is false.

    Protected Member Functions

    Setting options to the Intersection tool

    Sets options (available in child classes) for the intersection tool. Here it does nothing.

    virtual void SetAttributes ()
    Protected methods for shapes intersection and building result

    Intersects the given shapes with the intersection tool

    void IntersectShapes (const NCollection_List< TopoDS_Shape > &theArgs, const Message_ProgressRange &theRange)
     Builds the resulting shape.
    void BuildResult (const Message_ProgressRange &theRange=Message_ProgressRange())
     Builds the resulting shape.
    Clearing the contents of the algorithm

    Clears the algorithm from previous runs

    void Clear () override
     Clears all warnings and errors, and any data cached by the algorithm. User defined options are not cleared.
    Protected Member Functions inherited from BRepAlgoAPI_Algo
     BRepAlgoAPI_Algo ()
     Empty constructor.
     ~BRepAlgoAPI_Algo () override
     Destructor.
     BRepAlgoAPI_Algo (const occ::handle< NCollection_BaseAllocator > &theAllocator)
     Empty constructor.
    Protected Member Functions inherited from BRepBuilderAPI_MakeShape
     BRepBuilderAPI_MakeShape ()
    Protected Member Functions inherited from BRepBuilderAPI_Command
     BRepBuilderAPI_Command ()
     Set done to False.
    void Done ()
     Set done to true.
    void NotDone ()
     Set done to false.
    bool UserBreak (const Message_ProgressScope &thePS)
     Adds error to the report if the break signal was caught. Returns true in this case, false otherwise.
     BOPAlgo_Options ()
     Empty constructor.
     BOPAlgo_Options (const occ::handle< NCollection_BaseAllocator > &theAllocator)
     Constructor with allocator.
    virtual ~BOPAlgo_Options ()
     Destructor.
    const occ::handle< NCollection_BaseAllocator > & Allocator () const
     Returns allocator.
    void AddError (const occ::handle< Message_Alert > &theAlert)
     Adds the alert as error (fail).
    void AddWarning (const occ::handle< Message_Alert > &theAlert)
     Adds the alert as warning.
    bool HasErrors () const
     Returns true if algorithm has failed.
    bool HasError (const occ::handle< Standard_Type > &theType) const
     Returns true if algorithm has generated error of specified type.
    bool HasWarnings () const
     Returns true if algorithm has generated some warning alerts.
    bool HasWarning (const occ::handle< Standard_Type > &theType) const
     Returns true if algorithm has generated warning of specified type.
    const occ::handle< Message_Report > & GetReport () const
     Returns report collecting all errors and warnings.
    void DumpErrors (Standard_OStream &theOS) const
     Dumps the error status into the given stream.
    void DumpWarnings (Standard_OStream &theOS) const
     Dumps the warning statuses into the given stream.
    void ClearWarnings ()
     Clears the warnings of the algorithm.
    void SetFuzzyValue (const double theFuzz)
     Sets the additional tolerance.
    double FuzzyValue () const
     Returns the additional tolerance.
    void SetUseOBB (const bool theUseOBB)
     Enables/Disables the usage of OBB.
    bool UseOBB () const
     Returns the flag defining usage of OBB.
    void SetRunParallel (const bool theFlag)
     Set the flag of parallel processing if <theFlag> is true the parallel processing is switched on if <theFlag> is false the parallel processing is switched off.
    bool RunParallel () const
     Returns the flag of parallel processing.

    Protected Attributes

    Fields
    NCollection_List< TopoDS_ShapemyArguments
     Arguments of the operation.
    bool myNonDestructive
     Non-destructive mode management.
    BOPAlgo_GlueEnum myGlue
     Gluing mode management.
    bool myCheckInverted
     Check for inverted solids management.
    bool myFillHistory
     Controls the history collection.
    bool myIsIntersectionNeeded
     Flag to control whether the intersection of arguments should be performed or not.
    BOPAlgo_PPaveFiller myDSFiller
     Intersection tool performs intersection of the argument shapes.
    BOPAlgo_PBuilder myBuilder
     Building tool performs construction of the result basing on the results of intersection.
    occ::handle< BRepTools_HistorymyHistory
     General History tool, containing all History of shapes modifications during the operation (including result simplification).
    occ::handle< BRepTools_HistorymySimplifierHistory
     History of result shape simplification.
    Protected Attributes inherited from BRepBuilderAPI_MakeShape
    TopoDS_Shape myShape
    NCollection_List< TopoDS_ShapemyGenerated
    occ::handle< NCollection_BaseAllocatormyAllocator
     Enables/Disables the usage of OBB.
    occ::handle< Message_ReportmyReport
     Enables/Disables the usage of OBB.
    bool myRunParallel
     Enables/Disables the usage of OBB.
    double myFuzzyValue
     Enables/Disables the usage of OBB.
    bool myUseOBB
     Enables/Disables the usage of OBB.

    Additional Inherited Members

    static bool GetParallelMode ()
     Gets the global parallel mode.
    static void SetParallelMode (const bool theNewMode)
     Sets the global parallel mode.

    Detailed Description

    The class contains API level of the General Fuse algorithm.

    Additionally to the options defined in the base class, the algorithm has the following options:

    • Safe processing mode - allows to avoid modification of the input shapes during the operation (by default it is off);
    • Gluing options - allows to speed up the calculation of the intersections on the special cases, in which some sub-shapes are coinciding.
    • Disabling the check for inverted solids - Disables/Enables the check of the input solids for inverted status (holes in the space). The default value is TRUE, i.e. the check is performed. Setting this flag to FALSE for inverted solids, most likely will lead to incorrect results.
    • Disabling history collection - allows disabling the collection of the history of shapes modifications during the operation.

    It returns the following Error statuses:

    • 0 - in case of success;
    • BOPAlgo_AlertTooFewArguments - in case there are no enough arguments to perform the operation;
    • BOPAlgo_AlertIntersectionFailed - in case the intersection of the arguments has failed;
    • BOPAlgo_AlertBuilderFailed - in case building of the result shape has failed.

    Warnings statuses from underlying DS Filler and Builder algorithms are collected in the report.

    The class provides possibility to simplify the resulting shape by unification of the tangential edges and faces. It is performed by the method SimplifyResult. See description of this method for more details.

    Constructor & Destructor Documentation

    ◆ BRepAlgoAPI_BuilderAlgo() [1/4]

    BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo ( )

    Constructor with prepared Filler object.

    ◆ ~BRepAlgoAPI_BuilderAlgo()

    BRepAlgoAPI_BuilderAlgo::~BRepAlgoAPI_BuilderAlgo ( )
    override

    Constructor with prepared Filler object.

    ◆ BRepAlgoAPI_BuilderAlgo() [2/4]

    BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo ( const BOPAlgo_PaveFiller & thePF)

    Constructor with prepared Filler object.

    ◆ BRepAlgoAPI_BuilderAlgo() [3/4]

    BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo ( const BRepAlgoAPI_BuilderAlgo & )
    delete

    Copy constructor is not allowed.

    ◆ BRepAlgoAPI_BuilderAlgo() [4/4]

    BRepAlgoAPI_BuilderAlgo::BRepAlgoAPI_BuilderAlgo ( BRepAlgoAPI_BuilderAlgo && )
    delete

    Move constructor is not allowed.

    Member Function Documentation

    ◆ Arguments()

    const NCollection_List< TopoDS_Shape > & BRepAlgoAPI_BuilderAlgo::Arguments ( ) const
    inline

    Gets the arguments.

    ◆ Build()

    void BRepAlgoAPI_BuilderAlgo::Build ( const Message_ProgressRange & theRange = Message_ProgressRange())
    overridevirtual

    This is called by Shape(). It does nothing but may be redefined.

    Reimplemented from BRepBuilderAPI_MakeShape.

    Reimplemented in BRepAlgoAPI_Section, and BRepAlgoAPI_Splitter.

    ◆ Builder()

    const BOPAlgo_PBuilder & BRepAlgoAPI_BuilderAlgo::Builder ( ) const
    inline

    Returns the Building tool.

    ◆ BuildResult()

    void BRepAlgoAPI_BuilderAlgo::BuildResult ( const Message_ProgressRange & theRange = Message_ProgressRange())
    protected

    Builds the resulting shape.

    ◆ CheckInverted()

    bool BRepAlgoAPI_BuilderAlgo::CheckInverted ( ) const
    inline

    Returns the flag defining whether the check for input solids on inverted status should be performed or not.

    ◆ Clear()

    void BRepAlgoAPI_BuilderAlgo::Clear ( )
    overrideprotectedvirtual

    Clears all warnings and errors, and any data cached by the algorithm. User defined options are not cleared.

    Reimplemented from BRepAlgoAPI_Algo.

    ◆ DSFiller()

    const BOPAlgo_PPaveFiller & BRepAlgoAPI_BuilderAlgo::DSFiller ( ) const
    inline

    Returns the Building tool.

    ◆ Generated()

    const NCollection_List< TopoDS_Shape > & BRepAlgoAPI_BuilderAlgo::Generated ( const TopoDS_Shape & theS)
    overridevirtual

    Returns the list of shapes generated from the shape <theS>. In frames of Boolean Operations algorithms only Edges and Faces could have Generated elements, as only they produce new elements during intersection:

    • Edges can generate new vertices;
    • Faces can generate new edges and vertices.

    Reimplemented from BRepBuilderAPI_MakeShape.

    ◆ Glue()

    BOPAlgo_GlueEnum BRepAlgoAPI_BuilderAlgo::Glue ( ) const
    inline

    Returns the glue option of the algorithm.

    ◆ HasDeleted()

    virtual bool BRepAlgoAPI_BuilderAlgo::HasDeleted ( ) const
    virtual

    Returns true if any of the input shapes has been deleted during operation. Normally, General Fuse operation should not have Deleted elements, but all derived operation can have.

    ◆ HasGenerated()

    virtual bool BRepAlgoAPI_BuilderAlgo::HasGenerated ( ) const
    virtual

    Returns true if any of the input shapes has generated shapes during operation.

    ◆ HasHistory()

    bool BRepAlgoAPI_BuilderAlgo::HasHistory ( ) const
    inline

    Returns flag of history availability.

    ◆ HasModified()

    virtual bool BRepAlgoAPI_BuilderAlgo::HasModified ( ) const
    virtual

    Returns true if any of the input shapes has been modified during operation.

    ◆ History()

    occ::handle< BRepTools_History > BRepAlgoAPI_BuilderAlgo::History ( ) const
    inline

    History tool.

    ◆ IntersectShapes()

    void BRepAlgoAPI_BuilderAlgo::IntersectShapes ( const NCollection_List< TopoDS_Shape > & theArgs,
    const Message_ProgressRange & theRange )
    protected

    Builds the resulting shape.

    ◆ IsDeleted()

    bool BRepAlgoAPI_BuilderAlgo::IsDeleted ( const TopoDS_Shape & aS)
    overridevirtual

    Checks if the shape <theS> has been completely removed from the result, i.e. the result does not contain the shape itself and any of its splits. Returns TRUE if the shape has been deleted.

    Reimplemented from BRepBuilderAPI_MakeShape.

    ◆ Modified()

    const NCollection_List< TopoDS_Shape > & BRepAlgoAPI_BuilderAlgo::Modified ( const TopoDS_Shape & theS)
    overridevirtual

    Returns the list of shapes generated from the shape <theS>. In frames of Boolean Operations algorithms only Edges and Faces could have Generated elements, as only they produce new elements during intersection:

    • Edges can generate new vertices;
    • Faces can generate new edges and vertices.

    Reimplemented from BRepBuilderAPI_MakeShape.

    ◆ NonDestructive()

    bool BRepAlgoAPI_BuilderAlgo::NonDestructive ( ) const
    inline

    Returns the flag that defines the mode of treatment. In non-destructive mode the argument shapes are not modified. Instead a copy of a sub-shape is created in the result if it is needed to be updated.

    ◆ operator=() [1/2]

    BRepAlgoAPI_BuilderAlgo & BRepAlgoAPI_BuilderAlgo::operator= ( BRepAlgoAPI_BuilderAlgo && )
    delete

    Move assignment is not allowed.

    ◆ operator=() [2/2]

    BRepAlgoAPI_BuilderAlgo & BRepAlgoAPI_BuilderAlgo::operator= ( const BRepAlgoAPI_BuilderAlgo & )
    delete

    Copy assignment is not allowed.

    ◆ SectionEdges()

    const NCollection_List< TopoDS_Shape > & BRepAlgoAPI_BuilderAlgo::SectionEdges ( )

    ◆ SetArguments()

    void BRepAlgoAPI_BuilderAlgo::SetArguments ( const NCollection_List< TopoDS_Shape > & theLS)
    inline

    Gets the arguments.

    ◆ SetAttributes()

    virtual void BRepAlgoAPI_BuilderAlgo::SetAttributes ( )
    inlineprotectedvirtual

    Reimplemented in BRepAlgoAPI_Section.

    ◆ SetCheckInverted()

    void BRepAlgoAPI_BuilderAlgo::SetCheckInverted ( const bool theCheck)
    inline

    Enables/Disables the check of the input solids for inverted status.

    ◆ SetGlue()

    void BRepAlgoAPI_BuilderAlgo::SetGlue ( const BOPAlgo_GlueEnum theGlue)
    inline

    Sets the glue option for the algorithm, which allows increasing performance of the intersection of the input shapes.

    ◆ SetNonDestructive()

    void BRepAlgoAPI_BuilderAlgo::SetNonDestructive ( const bool theFlag)
    inline

    Returns the flag that defines the mode of treatment. In non-destructive mode the argument shapes are not modified. Instead a copy of a sub-shape is created in the result if it is needed to be updated.

    ◆ SetToFillHistory()

    void BRepAlgoAPI_BuilderAlgo::SetToFillHistory ( const bool theHistFlag)
    inline

    Returns flag of history availability.

    ◆ SimplifyResult()

    void BRepAlgoAPI_BuilderAlgo::SimplifyResult ( const bool theUnifyEdges = true,
    const bool theUnifyFaces = true,
    const double theAngularTol = Precision::Angular() )

    Field Documentation

    ◆ myArguments

    NCollection_List<TopoDS_Shape> BRepAlgoAPI_BuilderAlgo::myArguments
    protected

    Arguments of the operation.

    ◆ myBuilder

    BOPAlgo_PBuilder BRepAlgoAPI_BuilderAlgo::myBuilder
    protected

    Building tool performs construction of the result basing on the results of intersection.

    ◆ myCheckInverted

    bool BRepAlgoAPI_BuilderAlgo::myCheckInverted
    protected

    Check for inverted solids management.

    ◆ myDSFiller

    BOPAlgo_PPaveFiller BRepAlgoAPI_BuilderAlgo::myDSFiller
    protected

    Intersection tool performs intersection of the argument shapes.

    ◆ myFillHistory

    bool BRepAlgoAPI_BuilderAlgo::myFillHistory
    protected

    Controls the history collection.

    ◆ myGlue

    BOPAlgo_GlueEnum BRepAlgoAPI_BuilderAlgo::myGlue
    protected

    Gluing mode management.

    ◆ myHistory

    occ::handle<BRepTools_History> BRepAlgoAPI_BuilderAlgo::myHistory
    protected

    General History tool, containing all History of shapes modifications during the operation (including result simplification).

    ◆ myIsIntersectionNeeded

    bool BRepAlgoAPI_BuilderAlgo::myIsIntersectionNeeded
    protected

    Flag to control whether the intersection of arguments should be performed or not.

    ◆ myNonDestructive

    bool BRepAlgoAPI_BuilderAlgo::myNonDestructive
    protected

    Non-destructive mode management.

    ◆ mySimplifierHistory

    occ::handle<BRepTools_History> BRepAlgoAPI_BuilderAlgo::mySimplifierHistory
    protected

    History of result shape simplification.


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