Open CASCADE Technology
7.7.0
|
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>
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_ListOfShape & | Arguments () 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_MakePeriodic & | PeriodicityTool () const |
Returns the periodicity tool. More... | |
Material transitions | |
const TopTools_ListOfShape & | MaterialsOnPositiveSide (const TopoDS_Shape &theS) |
Returns the original shapes which images contain the the given shape with FORWARD orientation. More... | |
const TopTools_ListOfShape & | MaterialsOnNegativeSide (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_ListOfShape & | GetModified (const TopoDS_Shape &theS) |
Returns the list of shapes modified from the given shape. More... | |
const TopTools_ListOfShape & | GetOrigins (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_Shape & | Shape () const |
Returns the resulting connected shape. More... | |
const TopoDS_Shape & | PeriodicShape () 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_OrientedShapeMapHasher > | myMaterials |
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_History > | myGlueHistory |
Gluing History. More... | |
Handle< BRepTools_History > | myHistory |
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_BaseAllocator > | myAllocator |
Enables/Disables the usage of OBB. More... | |
Handle< Message_Report > | myReport |
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... | |
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:
|
inline |
Empty constructor.
|
inline |
Adds the shape to the arguments.
theS | [in] One of the argument shapes. |
|
inline |
Returns the list of arguments of the operation.
|
protected |
Associates the materials transitions for the border elements:
|
protected |
Checks the validity of input data.
|
inlinevirtual |
Clears the contents of the algorithm.
Reimplemented from BOPAlgo_Options.
void BOPAlgo_MakeConnected::ClearRepetitions | ( | ) |
Clears the repetitions performed on the periodic shape, keeping the shape periodic.
|
protected |
Fills the map of origins.
|
inline |
Returns the list of shapes modified from the given shape.
theS | [in] The shape for which the modified shapes are necessary. |
|
inline |
Returns the list of original shapes from which the current shape has been created.
theS | [in] The shape for which the origins are necessary. |
|
inline |
Returns the history of operations.
|
protected |
Makes the argument shapes connected (or glued).
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.
theParams | [in] Periodic options. |
|
inline |
Returns the original shapes which images contain the the given shape with REVERSED orientation.
theS | [in] The shape for which the materials are necessary. |
|
inline |
Returns the original shapes which images contain the the given shape with FORWARD orientation.
theS | [in] The shape for which the materials are necessary. |
void BOPAlgo_MakeConnected::Perform | ( | ) |
Performs the operation, i.e. makes the input shapes connected.
|
inline |
Returns the periodicity tool.
|
inline |
Returns the resulting periodic & repeated shape.
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.
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)). |
|
inline |
Sets the shape for making them connected.
theArgs | [in] The arguments for the operation. |
|
inline |
Returns the resulting connected shape.
|
protected |
Updates the history, material associations, origins map after periodicity operations.
|
protected |
Map of all BRep sub-elements of the input shapes.
|
protected |
Input shapes for making them connected.
|
protected |
The resulting connected (glued) shape.
|
protected |
Gluing History.
|
protected |
Final History of shapes modifications (including making the shape periodic and repetitions)
|
protected |
Map of the materials associations for the border elements.
|
protected |
Map of origins (allows tracking the shape's ancestors)
|
protected |
Tool for making the shape periodic.
|
protected |
The resulting shape.