Open CASCADE Technology 7.8.2.dev
BRepAlgoAPI_BooleanOperation Class Reference

The root API class for performing Boolean Operations on arbitrary shapes. More...

#include <BRepAlgoAPI_BooleanOperation.hxx>

Inheritance diagram for BRepAlgoAPI_BooleanOperation:

Public Member Functions

Setting/getting arguments
const TopoDS_ShapeShape1 () const
 Returns the first argument involved in this Boolean operation. Obsolete.
 
const TopoDS_ShapeShape2 () const
 Returns the second argument involved in this Boolean operation. Obsolete.
 
void SetTools (const TopTools_ListOfShape &theLS)
 Sets the Tool arguments.
 
const TopTools_ListOfShapeTools () const
 Returns the Tools arguments.
 
Setting/Getting the type of Boolean operation
void SetOperation (const BOPAlgo_Operation theBOP)
 Sets the type of Boolean operation.
 
BOPAlgo_Operation Operation () const
 Returns the type of Boolean Operation.
 
Performing the operation
virtual void Build (const Message_ProgressRange &theRange=Message_ProgressRange()) override
 Performs the Boolean operation.
 
- Public Member Functions inherited from BRepAlgoAPI_BuilderAlgo
 BRepAlgoAPI_BuilderAlgo ()
 Empty constructor.
 
virtual ~BRepAlgoAPI_BuilderAlgo ()
 Empty constructor.
 
 BRepAlgoAPI_BuilderAlgo (const BOPAlgo_PaveFiller &thePF)
 Constructor with prepared Filler object.
 
void SetArguments (const TopTools_ListOfShape &theLS)
 Sets the arguments.
 
const TopTools_ListOfShapeArguments () const
 Gets the arguments.
 
void SetNonDestructive (const Standard_Boolean theFlag)
 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.
 
Standard_Boolean 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 Standard_Boolean theCheck)
 Enables/Disables the check of the input solids for inverted status.
 
Standard_Boolean CheckInverted () const
 Returns the flag defining whether the check for input solids on inverted status should be performed or not.
 
void SimplifyResult (const Standard_Boolean theUnifyEdges=Standard_True, const Standard_Boolean theUnifyFaces=Standard_True, const Standard_Real theAngularTol=Precision::Angular())
 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.
 
virtual const TopTools_ListOfShapeModified (const TopoDS_Shape &theS) override
 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.
 
virtual const TopTools_ListOfShapeGenerated (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:
 
virtual Standard_Boolean 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 Standard_Boolean HasModified () const
 Returns true if any of the input shapes has been modified during operation.
 
virtual Standard_Boolean HasGenerated () const
 Returns true if any of the input shapes has generated shapes during operation.
 
virtual Standard_Boolean 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.
 
void SetToFillHistory (const Standard_Boolean theHistFlag)
 Allows disabling the history collection.
 
Standard_Boolean HasHistory () const
 Returns flag of history availability.
 
const TopTools_ListOfShapeSectionEdges ()
 Returns a list of section edges. The edges represent the result of intersection between arguments of operation.
 
const BOPAlgo_PPaveFillerDSFiller () const
 Returns the Intersection tool.
 
const BOPAlgo_PBuilderBuilder () const
 Returns the Building tool.
 
Handle< BRepTools_HistoryHistory () const
 History tool.
 
- Public Member Functions inherited from BRepAlgoAPI_Algo
virtual const TopoDS_ShapeShape () override
 Returns a shape built by the shape construction algorithm. Does not check if the shape is built.
 
void SetRunParallel (const Standard_Boolean 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.
 
Standard_Boolean RunParallel () const
 Returns the flag of parallel processing.
 
void SetFuzzyValue (const Standard_Real theFuzz)
 Sets the additional tolerance.
 
Standard_Real FuzzyValue () const
 Returns the additional tolerance.
 
Standard_Boolean HasErrors () const
 Returns true if algorithm has failed.
 
Standard_Boolean HasWarnings () const
 Returns true if algorithm has generated some warning alerts.
 
Standard_Boolean HasError (const Handle< Standard_Type > &theType) const
 Returns true if algorithm has generated error of specified type.
 
Standard_Boolean HasWarning (const Handle< Standard_Type > &theType) const
 Returns true if algorithm has generated warning of specified type.
 
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.
 
const Handle< Message_Report > & GetReport () const
 Returns report collecting all errors and warnings.
 
void SetUseOBB (const Standard_Boolean 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 Standard_Boolean IsDone () const
 
void Check () const
 Raises NotDone if done is false.
 

Protected Attributes

Fields
TopTools_ListOfShape myTools
 Tool arguments of operation.
 
BOPAlgo_Operation myOperation
 Type of Boolean Operation.
 
- Protected Attributes inherited from BRepAlgoAPI_BuilderAlgo
TopTools_ListOfShape myArguments
 Arguments of the operation.
 
Standard_Boolean myNonDestructive
 Non-destructive mode management.
 
BOPAlgo_GlueEnum myGlue
 Gluing mode management.
 
Standard_Boolean myCheckInverted
 Check for inverted solids management.
 
Standard_Boolean myFillHistory
 Controls the history collection.
 
Standard_Boolean 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.
 
Handle< BRepTools_HistorymyHistory
 General History tool, containing all History of shapes modifications during the operation (including result simplification)
 
Handle< BRepTools_HistorymySimplifierHistory
 History of result shape simplification.
 
- Protected Attributes inherited from BRepBuilderAPI_MakeShape
TopoDS_Shape myShape
 
TopTools_ListOfShape myGenerated
 
- Protected Attributes inherited from BOPAlgo_Options
Handle< NCollection_BaseAllocatormyAllocator
 Enables/Disables the usage of OBB.
 
Handle< Message_ReportmyReport
 Enables/Disables the usage of OBB.
 
Standard_Boolean myRunParallel
 Enables/Disables the usage of OBB.
 
Standard_Real myFuzzyValue
 Enables/Disables the usage of OBB.
 
Standard_Boolean myUseOBB
 Enables/Disables the usage of OBB.
 

Constructors

 BRepAlgoAPI_BooleanOperation ()
 Empty constructor.
 
 BRepAlgoAPI_BooleanOperation (const BOPAlgo_PaveFiller &thePF)
 Constructor with precomputed intersections of arguments.
 
 BRepAlgoAPI_BooleanOperation (const TopoDS_Shape &theS1, const TopoDS_Shape &theS2, const BOPAlgo_Operation theOperation)
 Constructor to perform Boolean operation on only two arguments. Obsolete.
 
 BRepAlgoAPI_BooleanOperation (const TopoDS_Shape &theS1, const TopoDS_Shape &theS2, const BOPAlgo_PaveFiller &thePF, const BOPAlgo_Operation theOperation)
 Constructor to perform Boolean operation on only two arguments with precomputed intersection results. Obsolete.
 

Additional Inherited Members

- Protected Member Functions inherited from BRepAlgoAPI_BuilderAlgo
virtual void SetAttributes ()
 Sets options (available in child classes) for the intersection tool. Here it does nothing.
 
void IntersectShapes (const TopTools_ListOfShape &theArgs, const Message_ProgressRange &theRange)
 Intersects the given shapes with the intersection tool.
 
void BuildResult (const Message_ProgressRange &theRange=Message_ProgressRange())
 Builds the resulting shape.
 
virtual void Clear () override
 Clears the algorithm from previous runs.
 
- Protected Member Functions inherited from BRepAlgoAPI_Algo
 BRepAlgoAPI_Algo ()
 Empty constructor.
 
virtual ~BRepAlgoAPI_Algo ()
 Destructor.
 
 BRepAlgoAPI_Algo (const 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.
 
- Protected Member Functions inherited from BOPAlgo_Options
Standard_Boolean 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 Handle< NCollection_BaseAllocator > &theAllocator)
 Constructor with allocator.
 
virtual ~BOPAlgo_Options ()
 Destructor.
 
const Handle< NCollection_BaseAllocator > & Allocator () const
 Returns allocator.
 
void AddError (const Handle< Message_Alert > &theAlert)
 Adds the alert as error (fail)
 
void AddWarning (const Handle< Message_Alert > &theAlert)
 Adds the alert as warning.
 
Standard_Boolean HasErrors () const
 Returns true if algorithm has failed.
 
Standard_Boolean HasError (const Handle< Standard_Type > &theType) const
 Returns true if algorithm has generated error of specified type.
 
Standard_Boolean HasWarnings () const
 Returns true if algorithm has generated some warning alerts.
 
Standard_Boolean HasWarning (const Handle< Standard_Type > &theType) const
 Returns true if algorithm has generated warning of specified type.
 
const 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 Standard_Real theFuzz)
 Sets the additional tolerance.
 
Standard_Real FuzzyValue () const
 Returns the additional tolerance.
 
void SetUseOBB (const Standard_Boolean theUseOBB)
 Enables/Disables the usage of OBB.
 
Standard_Boolean UseOBB () const
 Returns the flag defining usage of OBB.
 
void SetRunParallel (const Standard_Boolean 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.
 
Standard_Boolean RunParallel () const
 Returns the flag of parallel processing.
 
- Static Protected Member Functions inherited from BOPAlgo_Options
static Standard_Boolean GetParallelMode ()
 Gets the global parallel mode.
 
static void SetParallelMode (const Standard_Boolean theNewMode)
 Sets the global parallel mode.
 

Detailed Description

The root API class for performing Boolean Operations on arbitrary shapes.

The arguments of the operation are divided in two groups - Objects and Tools. Each group can contain any number of shapes, but each shape should be valid in terms of BRepCheck_Analyzer and BOPAlgo_ArgumentAnalyzer. The algorithm builds the splits of the given arguments using the intersection results and combines the result of Boolean Operation of given type:

  • FUSE - union of two groups of objects;
  • COMMON - intersection of two groups of objects;
  • CUT - subtraction of one group from the other;
  • SECTION - section edges and vertices of all arguments;

The rules for the arguments and type of the operation are the following:

  • For Boolean operation FUSE all arguments should have equal dimensions;
  • For Boolean operation CUT the minimal dimension of Tools should not be less than the maximal dimension of Objects;
  • For Boolean operation COMMON the arguments can have any dimension.
  • For Boolean operation SECTION the arguments can be of any type.

Additionally to the errors of the base class the algorithm returns the following Errors:

  • BOPAlgo_AlertBOPNotSet - in case the type of Boolean Operation is not set.

Constructor & Destructor Documentation

◆ BRepAlgoAPI_BooleanOperation() [1/4]

BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation ( )

Empty constructor.

◆ BRepAlgoAPI_BooleanOperation() [2/4]

BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation ( const BOPAlgo_PaveFiller & thePF)

Constructor with precomputed intersections of arguments.

◆ BRepAlgoAPI_BooleanOperation() [3/4]

BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation ( const TopoDS_Shape & theS1,
const TopoDS_Shape & theS2,
const BOPAlgo_Operation theOperation )
protected

Constructor to perform Boolean operation on only two arguments. Obsolete.

◆ BRepAlgoAPI_BooleanOperation() [4/4]

BRepAlgoAPI_BooleanOperation::BRepAlgoAPI_BooleanOperation ( const TopoDS_Shape & theS1,
const TopoDS_Shape & theS2,
const BOPAlgo_PaveFiller & thePF,
const BOPAlgo_Operation theOperation )
protected

Constructor to perform Boolean operation on only two arguments with precomputed intersection results. Obsolete.

Member Function Documentation

◆ Build()

virtual void BRepAlgoAPI_BooleanOperation::Build ( const Message_ProgressRange & theRange = Message_ProgressRange())
overridevirtual

Performs the Boolean operation.

Reimplemented from BRepAlgoAPI_BuilderAlgo.

Reimplemented in BRepAlgoAPI_Section.

◆ Operation()

BOPAlgo_Operation BRepAlgoAPI_BooleanOperation::Operation ( ) const
inline

Returns the type of Boolean Operation.

◆ SetOperation()

void BRepAlgoAPI_BooleanOperation::SetOperation ( const BOPAlgo_Operation theBOP)
inline

Sets the type of Boolean operation.

◆ SetTools()

void BRepAlgoAPI_BooleanOperation::SetTools ( const TopTools_ListOfShape & theLS)
inline

Sets the Tool arguments.

◆ Shape1()

const TopoDS_Shape & BRepAlgoAPI_BooleanOperation::Shape1 ( ) const
inline

Returns the first argument involved in this Boolean operation. Obsolete.

◆ Shape2()

const TopoDS_Shape & BRepAlgoAPI_BooleanOperation::Shape2 ( ) const
inline

Returns the second argument involved in this Boolean operation. Obsolete.

◆ Tools()

const TopTools_ListOfShape & BRepAlgoAPI_BooleanOperation::Tools ( ) const
inline

Returns the Tools arguments.

Field Documentation

◆ myOperation

BOPAlgo_Operation BRepAlgoAPI_BooleanOperation::myOperation
protected

Type of Boolean Operation.

◆ myTools

TopTools_ListOfShape BRepAlgoAPI_BooleanOperation::myTools
protected

Tool arguments of operation.


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