mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-26 12:05:37 +05:00
Merge remote branch 'origin/V7_dev' into V8_0_0_BR
This commit is contained in:
commit
d45ec2f5db
@ -165,9 +165,55 @@ namespace
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function constructs a shell or a compound of shells from a set of faces and/or shells.
|
* This function adds faces from the input shape into the list of faces. If
|
||||||
|
* the input shape is a face, it is added itself. If it is a shell, its
|
||||||
|
* sub-shapes (faces) are added. If it is a compound, its sub-shapes
|
||||||
|
* (faces or shells) are added in the list. For null shapes and for other
|
||||||
|
* types of shapes an exception is thrown.
|
||||||
*
|
*
|
||||||
* @param theShapes is a set of faces and/or shells.
|
* @param theShape the shape to be added. Either face or shell or a compound
|
||||||
|
* of faces and/or shells.
|
||||||
|
* @param theListFaces the list of faces that is modified on output.
|
||||||
|
* @param theMapFence the map that protects from adding the same faces in
|
||||||
|
* the list.
|
||||||
|
*/
|
||||||
|
void addFaces(const TopoDS_Shape &theShape,
|
||||||
|
TopTools_ListOfShape &theListFaces,
|
||||||
|
TopTools_MapOfShape &theMapFence)
|
||||||
|
{
|
||||||
|
if (theShape.IsNull()) {
|
||||||
|
Standard_NullObject::Raise("Face for shell construction is null");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Append the shape is the mapFence
|
||||||
|
if (theMapFence.Add(theShape)) {
|
||||||
|
// Shape type
|
||||||
|
const TopAbs_ShapeEnum aType = theShape.ShapeType();
|
||||||
|
|
||||||
|
if (aType == TopAbs_FACE) {
|
||||||
|
theListFaces.Append(theShape);
|
||||||
|
} else if (aType == TopAbs_SHELL || aType == TopAbs_COMPOUND) {
|
||||||
|
TopoDS_Iterator anIter(theShape);
|
||||||
|
|
||||||
|
for (; anIter.More(); anIter.Next()) {
|
||||||
|
// Add sub-shapes: faces for shell or faces/shells for compound.
|
||||||
|
const TopoDS_Shape &aSubShape = anIter.Value();
|
||||||
|
|
||||||
|
addFaces(aSubShape, theListFaces, theMapFence);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Standard_TypeMismatch::Raise
|
||||||
|
("Shape for shell construction is neither a shell nor a face");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function constructs a shell or a compound of shells
|
||||||
|
* from a set of faces and/or shells.
|
||||||
|
*
|
||||||
|
* @param theShapes is a set of faces, shells and/or
|
||||||
|
* compounds of faces/shells.
|
||||||
* @return a shell or a compound of shells.
|
* @return a shell or a compound of shells.
|
||||||
*/
|
*/
|
||||||
TopoDS_Shape makeShellFromFaces
|
TopoDS_Shape makeShellFromFaces
|
||||||
@ -192,33 +238,7 @@ namespace
|
|||||||
// Shape
|
// Shape
|
||||||
const TopoDS_Shape aShape = aRefShape->GetValue();
|
const TopoDS_Shape aShape = aRefShape->GetValue();
|
||||||
|
|
||||||
if (aShape.IsNull()) {
|
addFaces(aShape, aListFaces, aMapFence);
|
||||||
Standard_NullObject::Raise("Face for shell construction is null");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Shape type
|
|
||||||
const TopAbs_ShapeEnum aType = aShape.ShapeType();
|
|
||||||
|
|
||||||
if (aType == TopAbs_SHELL) {
|
|
||||||
// Get faces.
|
|
||||||
TopExp_Explorer anExp(aShape, TopAbs_FACE);
|
|
||||||
|
|
||||||
for (; anExp.More(); anExp.Next()) {
|
|
||||||
const TopoDS_Shape &aFace = anExp.Current();
|
|
||||||
|
|
||||||
if (aMapFence.Add(aFace)) {
|
|
||||||
aListFaces.Append(aFace);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (aType == TopAbs_FACE) {
|
|
||||||
// Append the face in the list
|
|
||||||
if (aMapFence.Add(aShape)) {
|
|
||||||
aListFaces.Append(aShape);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Standard_TypeMismatch::Raise
|
|
||||||
("Shape for shell construction is neither a shell nor a face");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Perform computation of shells.
|
// Perform computation of shells.
|
||||||
|
@ -4834,8 +4834,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
|||||||
self._autoPublish(anObj, theName, "face")
|
self._autoPublish(anObj, theName, "face")
|
||||||
return anObj
|
return anObj
|
||||||
|
|
||||||
## Create a shell from the set of faces and shells.
|
## Create a shell from the set of faces, shells and/or compounds of faces.
|
||||||
# @param theFacesAndShells List of faces and/or shells.
|
# @param theFacesAndShells List of faces, shells and/or compounds of faces.
|
||||||
# @param theName Object name; when specified, this parameter is used
|
# @param theName Object name; when specified, this parameter is used
|
||||||
# for result publication in the study. Otherwise, if automatic
|
# for result publication in the study. Otherwise, if automatic
|
||||||
# publication is switched on, default value is used for result name.
|
# publication is switched on, default value is used for result name.
|
||||||
|
Loading…
Reference in New Issue
Block a user