Open CASCADE Technology  7.7.0
BOPAlgo_MakeConnected Class Reference

BOPAlgo_MakeConnected is the algorithm for making the touching shapes connected or glued, i.e. for making the coinciding geometries be topologically shared among the shapes. More...

#include <BOPAlgo_MakeConnected.hxx>

Inheritance diagram for BOPAlgo_MakeConnected:
Inheritance graph
[legend]

Public Member Functions

Constructor
 BOPAlgo_MakeConnected ()
 Empty constructor. More...
 
Setters for the shapes to make connected
void SetArguments (const TopTools_ListOfShape &theArgs)
 Sets the shape for making them connected. More...
 
void AddArgument (const TopoDS_Shape &theS)
 Adds the shape to the arguments. More...
 
const TopTools_ListOfShapeArguments () const
 Returns the list of arguments of the operation. More...
 
Performing the operations
void Perform ()
 Performs the operation, i.e. makes the input shapes connected. More...
 
Shape periodicity & repetition
void MakePeriodic (const BOPAlgo_MakePeriodic::PeriodicityParams &theParams)
 Makes the connected shape periodic. Repeated calls of this method overwrite the previous calls working with the basis connected shape. More...
 
void RepeatShape (const Standard_Integer theDirectionID, const Standard_Integer theTimes)
 Performs repetition of the periodic shape in specified direction required number of times. More...
 
void ClearRepetitions ()
 Clears the repetitions performed on the periodic shape, keeping the shape periodic. More...
 
const BOPAlgo_MakePeriodicPeriodicityTool () const
 Returns the periodicity tool. More...
 
Material transitions
const TopTools_ListOfShapeMaterialsOnPositiveSide (const TopoDS_Shape &theS)
 Returns the original shapes which images contain the the given shape with FORWARD orientation. More...
 
const TopTools_ListOfShapeMaterialsOnNegativeSide (const TopoDS_Shape &theS)
 Returns the original shapes which images contain the the given shape with REVERSED orientation. More...
 
History methods
const Handle< BRepTools_History > & History () const
 Returns the history of operations. More...
 
const TopTools_ListOfShapeGetModified (const TopoDS_Shape &theS)
 Returns the list of shapes modified from the given shape. More...
 
const TopTools_ListOfShapeGetOrigins (const TopoDS_Shape &theS)
 Returns the list of original shapes from which the current shape has been created. More...
 
Getting the result shapes
const TopoDS_ShapeShape () const
 Returns the resulting connected shape. More...
 
const TopoDS_ShapePeriodicShape () const
 Returns the resulting periodic & repeated shape. More...
 
Clearing the contents of the algorithm from previous runs
void Clear ()
 Clears the contents of the algorithm. More...
 
- Public Member Functions inherited from BOPAlgo_Options
 BOPAlgo_Options ()
 Empty constructor. More...
 
 BOPAlgo_Options (const Handle< NCollection_BaseAllocator > &theAllocator)
 Constructor with allocator. More...
 
virtual ~BOPAlgo_Options ()
 Destructor. More...
 
const Handle< NCollection_BaseAllocator > & Allocator () const
 Returns allocator. More...
 
void AddError (const Handle< Message_Alert > &theAlert)
 Adds the alert as error (fail) More...
 
void AddWarning (const Handle< Message_Alert > &theAlert)
 Adds the alert as warning. More...
 
Standard_Boolean HasErrors () const
 Returns true if algorithm has failed. More...
 
Standard_Boolean HasError (const Handle< Standard_Type > &theType) const
 Returns true if algorithm has generated error of specified type. More...
 
Standard_Boolean HasWarnings () const
 Returns true if algorithm has generated some warning alerts. More...
 
Standard_Boolean HasWarning (const Handle< Standard_Type > &theType) const
 Returns true if algorithm has generated warning of specified type. More...
 
const Handle< Message_Report > & GetReport () const
 Returns report collecting all errors and warnings. More...
 
void DumpErrors (Standard_OStream &theOS) const
 Dumps the error status into the given stream. More...
 
void DumpWarnings (Standard_OStream &theOS) const
 Dumps the warning statuses into the given stream. More...
 
void ClearWarnings ()
 Clears the warnings of the algorithm. More...
 
void SetFuzzyValue (const Standard_Real theFuzz)
 Sets the additional tolerance. More...
 
Standard_Real FuzzyValue () const
 Returns the additional tolerance. More...
 
void SetUseOBB (const Standard_Boolean theUseOBB)
 Enables/Disables the usage of OBB. More...
 
Standard_Boolean UseOBB () const
 Returns the flag defining usage of OBB. More...
 
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. More...
 
Standard_Boolean RunParallel () const
 Returns the flag of parallel processing. More...
 

Protected Attributes

Fields
TopTools_ListOfShape myArguments
 Input shapes for making them connected. More...
 
TopTools_IndexedMapOfShape myAllInputsMap
 Map of all BRep sub-elements of the input shapes. More...
 
BOPAlgo_MakePeriodic myPeriodicityMaker
 Tool for making the shape periodic. More...
 
NCollection_DataMap< TopoDS_Shape, TopTools_ListOfShape, TopTools_OrientedShapeMapHashermyMaterials
 Map of the materials associations for the border elements. More...
 
TopTools_DataMapOfShapeListOfShape myOrigins
 Map of origins (allows tracking the shape's ancestors) More...
 
Handle< BRepTools_HistorymyGlueHistory
 Gluing History. More...
 
Handle< BRepTools_HistorymyHistory
 Final History of shapes modifications (including making the shape periodic and repetitions) More...
 
TopoDS_Shape myGlued
 The resulting connected (glued) shape. More...
 
TopoDS_Shape myShape
 The resulting shape. More...
 
- Protected Attributes inherited from BOPAlgo_Options
Handle< NCollection_BaseAllocatormyAllocator
 Enables/Disables the usage of OBB. More...
 
Handle< Message_ReportmyReport
 Enables/Disables the usage of OBB. More...
 
Standard_Boolean myRunParallel
 Enables/Disables the usage of OBB. More...
 
Standard_Real myFuzzyValue
 Enables/Disables the usage of OBB. More...
 
Standard_Boolean myUseOBB
 Enables/Disables the usage of OBB. More...
 

Protected methods performing the operation

void CheckData ()
 Checks the validity of input data. More...
 
void MakeConnected ()
 Makes the argument shapes connected (or glued). More...
 
void AssociateMaterials ()
 Associates the materials transitions for the border elements: More...
 
void FillOrigins ()
 Fills the map of origins. More...
 
void Update ()
 Updates the history, material associations, origins map after periodicity operations. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from BOPAlgo_Options
static Standard_Boolean GetParallelMode ()
 Gets the global parallel mode. More...
 
static void SetParallelMode (const Standard_Boolean theNewMode)
 Sets the global parallel mode. More...
 
- 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. More...
 

Detailed Description

BOPAlgo_MakeConnected is the algorithm for making the touching shapes connected or glued, i.e. for making the coinciding geometries be topologically shared among the shapes.

The input shapes should be of the same dimension, otherwise the gluing will not make any sense.

After the shapes are made connected, the border elements of input shapes are associated with the shapes to which they belong. At that, the orientation of the border element in the shape is taken into account. The associations are made for the following types:

In frames of this algorithm the input shapes are called materials, and the association process is called the material association. The material association allows finding the coinciding elements for the opposite input shapes. These elements will be associated to at least two materials.

After making the shapes connected, it is possible to make the connected shape periodic using the BOPAlgo_MakePeriodic tool. After making the shape periodic, the material associations will be updated to correspond to the actual state of the result shape. Repetition of the periodic shape is also possible here. Material associations are not going to be lost.

The algorithm supports history of shapes modification, thus it is possible to track the modification of the input shapes during the operations. Additionally to standard history methods, the algorithm provides the the method GetOrigins() which allows obtaining the input shapes from which the resulting shape has been created.

The algorithm supports the parallel processing mode, which allows faster completion of the operations.

The algorithm returns the following Error/Warning messages:

Here is the example of usage of the algorithm:

TopTools_ListOfShape anArguments = ...; // Shapes to make connected
Standard_Boolean bRunParallel = ...; // Parallel processing mode
BOPAlgo_MakeConnected aMC; // Tool for making the shapes connected
aMC.SetArguments(anArguments); // Set the shapes
aMC.SetRunParallel(bRunParallel); // Set parallel processing mode
aMC.Perform(); // Perform the operation
if (aMC.HasErrors()) // Check for the errors
{
// errors treatment
Standard_SStream aSStream;
aMC.DumpErrors(aSStream);
return;
}
if (aMC.HasWarnings()) // Check for the warnings
{
// warnings treatment
Standard_SStream aSStream;
aMC.DumpWarnings(aSStream);
}
const TopoDS_Shape& aGluedShape = aMC.Shape(); // Connected shape
// Checking material associations
TopAbs_ShapeEnum anElemType = ...; // Type of border element
TopExp_Explorer anExp(anArguments.First(), anElemType);
for (; anExp.More(); anExp.Next())
{
const TopoDS_Shape& anElement = anExp.Current();
const TopTools_ListOfShape& aNegativeM = aMC.MaterialsOnNegativeSide(anElement);
const TopTools_ListOfShape& aPositiveM = aMC.MaterialsOnPositiveSide(anElement);
}
// Making the connected shape periodic
BOPAlgo_MakePeriodic::PeriodicityParams aParams = ...; // Options for periodicity of the connected shape
aMC.MakePeriodic(aParams);
// Shape repetition after making it periodic
// Check if the shape has been made periodic successfully
{
// Periodicity maker error treatment
}
// Shape repetition in periodic directions
aMC.RepeatShape(0, 2);
const TopoDS_Shape& aShape = aMC.PeriodicShape(); // Periodic and repeated shape

Constructor & Destructor Documentation

◆ BOPAlgo_MakeConnected()

BOPAlgo_MakeConnected::BOPAlgo_MakeConnected ( )
inline

Empty constructor.

Member Function Documentation

◆ AddArgument()

void BOPAlgo_MakeConnected::AddArgument ( const TopoDS_Shape theS)
inline

Adds the shape to the arguments.

Parameters
theS[in] One of the argument shapes.

◆ Arguments()

const TopTools_ListOfShape& BOPAlgo_MakeConnected::Arguments ( ) const
inline

Returns the list of arguments of the operation.

◆ AssociateMaterials()

void BOPAlgo_MakeConnected::AssociateMaterials ( )
protected

Associates the materials transitions for the border elements:

  • For input Solids, associates the Faces to Solids;
  • For input Faces, associates the Edges to Faces;
  • For input Edges, associates the Vertices to Edges.

◆ CheckData()

void BOPAlgo_MakeConnected::CheckData ( )
protected

Checks the validity of input data.

◆ Clear()

void BOPAlgo_MakeConnected::Clear ( )
inlinevirtual

Clears the contents of the algorithm.

Reimplemented from BOPAlgo_Options.

◆ ClearRepetitions()

void BOPAlgo_MakeConnected::ClearRepetitions ( )

Clears the repetitions performed on the periodic shape, keeping the shape periodic.

◆ FillOrigins()

void BOPAlgo_MakeConnected::FillOrigins ( )
protected

Fills the map of origins.

◆ GetModified()

const TopTools_ListOfShape& BOPAlgo_MakeConnected::GetModified ( const TopoDS_Shape theS)
inline

Returns the list of shapes modified from the given shape.

Parameters
theS[in] The shape for which the modified shapes are necessary.

◆ GetOrigins()

const TopTools_ListOfShape& BOPAlgo_MakeConnected::GetOrigins ( const TopoDS_Shape theS)
inline

Returns the list of original shapes from which the current shape has been created.

Parameters
theS[in] The shape for which the origins are necessary.

◆ History()

const Handle< BRepTools_History >& BOPAlgo_MakeConnected::History ( ) const
inline

Returns the history of operations.

◆ MakeConnected()

void BOPAlgo_MakeConnected::MakeConnected ( )
protected

Makes the argument shapes connected (or glued).

◆ MakePeriodic()

void BOPAlgo_MakeConnected::MakePeriodic ( const BOPAlgo_MakePeriodic::PeriodicityParams theParams)

Makes the connected shape periodic. Repeated calls of this method overwrite the previous calls working with the basis connected shape.

Parameters
theParams[in] Periodic options.

◆ MaterialsOnNegativeSide()

const TopTools_ListOfShape& BOPAlgo_MakeConnected::MaterialsOnNegativeSide ( const TopoDS_Shape theS)
inline

Returns the original shapes which images contain the the given shape with REVERSED orientation.

Parameters
theS[in] The shape for which the materials are necessary.

◆ MaterialsOnPositiveSide()

const TopTools_ListOfShape& BOPAlgo_MakeConnected::MaterialsOnPositiveSide ( const TopoDS_Shape theS)
inline

Returns the original shapes which images contain the the given shape with FORWARD orientation.

Parameters
theS[in] The shape for which the materials are necessary.

◆ Perform()

void BOPAlgo_MakeConnected::Perform ( )

Performs the operation, i.e. makes the input shapes connected.

◆ PeriodicityTool()

const BOPAlgo_MakePeriodic& BOPAlgo_MakeConnected::PeriodicityTool ( ) const
inline

Returns the periodicity tool.

◆ PeriodicShape()

const TopoDS_Shape& BOPAlgo_MakeConnected::PeriodicShape ( ) const
inline

Returns the resulting periodic & repeated shape.

◆ RepeatShape()

void BOPAlgo_MakeConnected::RepeatShape ( const Standard_Integer  theDirectionID,
const Standard_Integer  theTimes 
)

Performs repetition of the periodic shape in specified direction required number of times.

Parameters
theDirectionID[in] The direction's ID (0 for X, 1 for Y, 2 for Z);
theTimes[in] Requested number of repetitions (sign of the value defines the side of the repetition direction (positive or negative)).

◆ SetArguments()

void BOPAlgo_MakeConnected::SetArguments ( const TopTools_ListOfShape theArgs)
inline

Sets the shape for making them connected.

Parameters
theArgs[in] The arguments for the operation.

◆ Shape()

const TopoDS_Shape& BOPAlgo_MakeConnected::Shape ( ) const
inline

Returns the resulting connected shape.

◆ Update()

void BOPAlgo_MakeConnected::Update ( )
protected

Updates the history, material associations, origins map after periodicity operations.

Field Documentation

◆ myAllInputsMap

TopTools_IndexedMapOfShape BOPAlgo_MakeConnected::myAllInputsMap
protected

Map of all BRep sub-elements of the input shapes.

◆ myArguments

TopTools_ListOfShape BOPAlgo_MakeConnected::myArguments
protected

Input shapes for making them connected.

◆ myGlued

TopoDS_Shape BOPAlgo_MakeConnected::myGlued
protected

The resulting connected (glued) shape.

◆ myGlueHistory

Handle< BRepTools_History > BOPAlgo_MakeConnected::myGlueHistory
protected

Gluing History.

◆ myHistory

Handle< BRepTools_History > BOPAlgo_MakeConnected::myHistory
protected

Final History of shapes modifications (including making the shape periodic and repetitions)

◆ myMaterials

Map of the materials associations for the border elements.

◆ myOrigins

TopTools_DataMapOfShapeListOfShape BOPAlgo_MakeConnected::myOrigins
protected

Map of origins (allows tracking the shape's ancestors)

◆ myPeriodicityMaker

BOPAlgo_MakePeriodic BOPAlgo_MakeConnected::myPeriodicityMaker
protected

Tool for making the shape periodic.

◆ myShape

TopoDS_Shape BOPAlgo_MakeConnected::myShape
protected

The resulting shape.


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