Open CASCADE Technology 7.8.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. | |
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_ListOfShape & | Arguments () 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_MakePeriodic & | PeriodicityTool () const |
Returns the periodicity tool. | |
Material transitions | |
const TopTools_ListOfShape & | MaterialsOnPositiveSide (const TopoDS_Shape &theS) |
Returns the original shapes which images contain the the given shape with FORWARD orientation. | |
const TopTools_ListOfShape & | MaterialsOnNegativeSide (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_ListOfShape & | GetModified (const TopoDS_Shape &theS) |
Returns the list of shapes modified from the given shape. | |
const TopTools_ListOfShape & | GetOrigins (const TopoDS_Shape &theS) |
Returns the list of original shapes from which the current shape has been created. | |
Getting the result shapes | |
const TopoDS_Shape & | Shape () const |
Returns the resulting connected shape. | |
const TopoDS_Shape & | PeriodicShape () 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_ListOfShape > | myMaterials |
Map of the materials associations for the border elements. | |
TopTools_DataMapOfShapeListOfShape | myOrigins |
Map of origins (allows tracking the shape's ancestors) | |
Handle< BRepTools_History > | myGlueHistory |
Gluing History. | |
Handle< BRepTools_History > | myHistory |
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_BaseAllocator > | myAllocator |
Enables/Disables the usage of OBB. | |
Handle< Message_Report > | myReport |
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. | |
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.