Open CASCADE Technology 7.8.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.
 
Setters for the shapes to make connected
void SetArguments (const TopTools_ListOfShape &theArgs)
 Sets the shape for making them connected.
 
void AddArgument (const TopoDS_Shape &theS)
 Adds the shape to the arguments.
 
const TopTools_ListOfShapeArguments () const
 Returns the list of arguments of the operation.
 
Performing the operations
void Perform ()
 Performs the operation, i.e. makes the input shapes connected.
 
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.
 
void RepeatShape (const Standard_Integer theDirectionID, const Standard_Integer theTimes)
 Performs repetition of the periodic shape in specified direction required number of times.
 
void ClearRepetitions ()
 Clears the repetitions performed on the periodic shape, keeping the shape periodic.
 
const BOPAlgo_MakePeriodicPeriodicityTool () const
 Returns the periodicity tool.
 
Material transitions
const TopTools_ListOfShapeMaterialsOnPositiveSide (const TopoDS_Shape &theS)
 Returns the original shapes which images contain the the given shape with FORWARD orientation.
 
const TopTools_ListOfShapeMaterialsOnNegativeSide (const TopoDS_Shape &theS)
 Returns the original shapes which images contain the the given shape with REVERSED orientation.
 
History methods
const Handle< BRepTools_History > & History () const
 Returns the history of operations.
 
const TopTools_ListOfShapeGetModified (const TopoDS_Shape &theS)
 Returns the list of shapes modified from the given shape.
 
const TopTools_ListOfShapeGetOrigins (const TopoDS_Shape &theS)
 Returns the list of original shapes from which the current shape has been created.
 
Getting the result shapes
const TopoDS_ShapeShape () const
 Returns the resulting connected shape.
 
const TopoDS_ShapePeriodicShape () const
 Returns the resulting periodic & repeated shape.
 
Clearing the contents of the algorithm from previous runs
void Clear ()
 Clears the contents of the algorithm.
 
- Public Member Functions inherited from BOPAlgo_Options
 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.
 

Protected Attributes

Fields
TopTools_ListOfShape myArguments
 Input shapes for making them connected.
 
TopTools_IndexedMapOfShape myAllInputsMap
 Map of all BRep sub-elements of the input shapes.
 
BOPAlgo_MakePeriodic myPeriodicityMaker
 Tool for making the shape periodic.
 
NCollection_DataMap< TopoDS_Shape, TopTools_ListOfShapemyMaterials
 Map of the materials associations for the border elements.
 
TopTools_DataMapOfShapeListOfShape myOrigins
 Map of origins (allows tracking the shape's ancestors)
 
Handle< BRepTools_HistorymyGlueHistory
 Gluing History.
 
Handle< BRepTools_HistorymyHistory
 Final History of shapes modifications (including making the shape periodic and repetitions)
 
TopoDS_Shape myGlued
 The resulting connected (glued) shape.
 
TopoDS_Shape myShape
 The resulting shape.
 
- 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.
 

Protected methods performing the operation

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

Additional Inherited Members

- Static Public 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.
 
- 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.
 

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
aMC.DumpErrors(aSStream);
return;
}
if (aMC.HasWarnings()) // Check for the warnings
{
// warnings treatment
aMC.DumpWarnings(aSStream);
}
const TopoDS_Shape& aGluedShape = aMC.Shape(); // Connected shape
// Checking material associations
TopAbs_ShapeEnum anElemType = ...; // Type of border element
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
if (aMC.PeriodicityTool().HasErrors())
{
// Periodicity maker error treatment
}
// Shape repetition in periodic directions
aMC.RepeatShape(0, 2);
const TopoDS_Shape& aShape = aMC.PeriodicShape(); // Periodic and repeated shape
std::stringstream Standard_SStream
Defines Standard_SStream as typedef to C++ string stream.
Definition Standard_SStream.hxx:21
TopAbs_ShapeEnum
Identifies various topological shapes. This enumeration allows you to use dynamic typing of shapes....
Definition TopAbs_ShapeEnum.hxx:46
BOPAlgo_MakeConnected is the algorithm for making the touching shapes connected or glued,...
Definition BOPAlgo_MakeConnected.hxx:133
Definition NCollection_UBTree.hxx:64
An Explorer is a Tool to visit a Topological Data Structure form the TopoDS package.
Definition TopExp_Explorer.hxx:82
Describes a shape which.
Definition TopoDS_Shape.hxx:41
Structure to keep all periodicity parameters:
Definition BOPAlgo_MakePeriodic.hxx:152

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

NCollection_DataMap<TopoDS_Shape, TopTools_ListOfShape> BOPAlgo_MakeConnected::myMaterials
protected

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: