The \b Result will be a \b GEOM_Object.
-<b>TUI Command:</b> <em>geompy.MakeCommonList(theShapesList)</em>\n
-<b>Arguments:</b> Name + a list of shapes.\n
+<b>TUI Command:</b> <em>geompy.MakeCommonList(theShapesList, checkSelfInte)</em>\n
+<b>Arguments:</b> Name + a list of shapes + an optional flag for self-intersection check.\n
<b>Advanced option:</b>
\ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments".
\image html bool2.png "Common dialog"
-\r
+
For a particular case with two shapes for the Common operation there is the following TUI command:
-<b>TUI Command:</b> <em>geompy.MakeCommon(s1, s2)</em>\n\r
-<b>Arguments:</b> Name + 2 shapes.\r
+<b>TUI Command:</b> <em>geompy.MakeCommon(s1, s2, checkSelfInte)</em>\n
+<b>Arguments:</b> Name + 2 shapes + an optional flag for self-intersection check.
<b>Example:</b>
\image html fusesn1.png "The initial shapes"
-\image html commonsn.png "The resulting object"
+\image html commonsn.png "The resulting object"
Our <b>TUI Scripts</b> provide you with useful examples of the use of
\ref tui_common "Boolean Operations".
<b> More details </b>
For a detailed description of the Boolean operations please refer to
-<a href="SALOME_BOA_PA.pdf">this document</a>.
+<a href="SALOME_BOA_PA.pdf">this document</a>.
It provides a general review of the Partition and Boolean
operations algorithms, describes the usage methodology and highlights
major limitations of these operations.
The \b Result will be a \b GEOM_Object.
-<b>TUI Command:</b> <em>geompy.MakeCutList(theMainShape, theShapesList)</em>\n
-<b>Arguments:</b> Name + a main shape + a list of other shapes.\n
+<b>TUI Command:</b> <em>geompy.MakeCutList(theMainShape, theShapesList, checkSelfInte)</em>\n
+<b>Arguments:</b> Name + a main shape + a list of other shapes + an optional flag for self-intersection check.\n
<b>Advanced option:</b>
\ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments".
For a particular case with two shapes (object and tool) for the Cut operation there is the following TUI command:
-<b>TUI Command:</b> <em>geompy.MakeCut(s1, s2)</em>\n\r
-<b>Arguments:</b> Name + the object + the tool.\r
+<b>TUI Command:</b> <em>geompy.MakeCut(s1, s2, checkSelfInte)</em>\n
+<b>Arguments:</b> Name + the object + the tool + an optional flag for self-intersection check.
<b>Example:</b>
\image html cutsn.png "The resulting object"
-Our <b>TUI Scripts</b> provide you with useful examples of the use of
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
\ref tui_cut "Boolean Operations".
<b> More details </b>
For a detailed description of the Boolean operations please refer to
-<a href="SALOME_BOA_PA.pdf">this document</a>.
+<a href="SALOME_BOA_PA.pdf">this document</a>.
It provides a general review of the Partition and Boolean
operations algorithms, describes the usage methodology and highlights
major limitations of these operations.
\page fuse_operation_page Fuse
To produce a \b Fuse operation in the <b>Main Menu</b> select
-<b>Operations - > Boolean - > Fuse</b>.
+<b>Operations - > Boolean - > Fuse</b>.
This operation creates one shape from a list of shapes.
The \b Result will be a \b GEOM_Object.
-<b>TUI Command:</b> <em>geompy.MakeFuseList(theShapesList)</em>\n
-<b>Arguments:</b> Name + a list of shapes.\n
+<b>TUI Command:</b> <em>geompy.MakeFuseList(theShapesList, checkSelfInte)</em>\n
+<b>Arguments:</b> Name + a list of shapes + an optional flag for self-intersection check.\n
<b>Advanced option:</b>
\ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments".
For a particular case with two shapes to be fused there is the following TUI command:
-<b>TUI Command:</b> <em>geompy.MakeFuse(s1, s2)</em>\n\r
-<b>Arguments:</b> Name + 2 shapes.\r
+<b>TUI Command:</b> <em>geompy.MakeFuse(s1, s2, checkSelfInte)</em>\n
+<b>Arguments:</b> Name + 2 shapes + an optional flag for self-intersection check.
<b>Example:</b>
\image html fusesn2.png "The resulting fuse"
-Our <b>TUI Scripts</b> provide you with useful examples of the use of
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
\ref tui_fuse "Boolean Operations".
<b> More details </b>
<ul>
<li>For a detailed description of the Boolean operations please refer to
-<a href="SALOME_BOA_PA.pdf">this document</a>.
+<a href="SALOME_BOA_PA.pdf">this document</a>.
It provides a general review of the Partition and Boolean
operations algorithms, describes the usage methodology and highlights
major limitations of these operations.</li>
The \b Result will be any \b GEOM_Object (EDGE or WIRE).
-<b>TUI Command:</b> <em>geompy.MakeSection(s1, s2)</em>\n
-<b>Arguments:</b> Name + 2 shapes.\n
+<b>TUI Command:</b> <em>geompy.MakeSection(s1, s2, checkSelfInte)</em>\n
+<b>Arguments:</b> Name + 2 shapes + an optional flag for self-intersection check.\n
<b>Advanced option:</b>
\ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments".
\image html sectionsn.png "The resulting object"
-Our <b>TUI Scripts</b> provide you with useful examples of the use of
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
\ref tui_section "Boolean Operations".
<b> More details </b>
For a detailed description of the Boolean operations please refer to
-<a href="SALOME_BOA_PA.pdf">this document</a>.
+<a href="SALOME_BOA_PA.pdf">this document</a>.
It provides a general review of the Partition and Boolean
operations algorithms, describes the usage methodology and highlights
major limitations of these operations.
You can use advanced TUI commands performing these operations
independently from each other:
\par
-<em>geompy.MakeFuseList(theShapesList)</em>, where \em theShapesList is
+<em>geompy.MakeFuseList(theShapesList, checkSelfInte)</em>, where \em theShapesList is
the list of shapes for Fuse operation;
\par
-<em>geompy.MakeCommonList(theShapesList)</em>, where \em theShapesList is
+<em>geompy.MakeCommonList(theShapesList, checkSelfInte)</em>, where \em theShapesList is
the list of shapes for Common operation;
\par
-<em>geompy.MakeCutList(theMainShape, theShapesList)</em>, where \em
+<em>geompy.MakeCutList(theMainShape, theShapesList, checkSelfInte)</em>, where \em
theMainShape is the object of the operation and \em theShapesList is
the list of tools for Cut operation;
\par
-<em>geompy.MakeSection(Shape1, Shape2)</em>, where \em Shape1 is the first
+<em>geompy.MakeSection(Shape1, Shape2, checkSelfInte)</em>, where \em Shape1 is the first
argument and \em Shape2 is the second argument of Section operation;
operations, which can be used alongside with separate commands for each
operation.
\par
-<em>geompy.MakeBoolean(Shape1, Shape2, Operation),</em> where \em
+<em>geompy.MakeBoolean(Shape1, Shape2, Operation, checkSelfInte),</em> where \em
Shape1 is the first argument and \em Shape2 is the second argument of
Boolean operation, \em Operation is a type of the Boolean operation (1
— Common, 2 — Cut, 3 — Fuse, 4 — Section).
Besides, you can use advanced TUI commands performing these operations
independently from each other:
\par
-<em>geompy.MakeFuse(Shape1, Shape2)</em>, where \em Shape1 is the first
+<em>geompy.MakeFuse(Shape1, Shape2, checkSelfInte)</em>, where \em Shape1 is the first
argument and \em Shape2 is the second argument of Fuse operation;
\par
-<em>geompy.MakeCommon(Shape1, Shape2)</em>, where \em Shape1 is the first
+<em>geompy.MakeCommon(Shape1, Shape2, checkSelfInte)</em>, where \em Shape1 is the first
argument and \em Shape2 is the second argument of Common operation;
\par
-<em>geompy.MakeCut(Shape1, Shape2)</em>, where \em Shape1 is the first
+<em>geompy.MakeCut(Shape1, Shape2, checkSelfInte)</em>, where \em Shape1 is the first
argument and \em Shape2 is the second argument of Cut operation;
+The flag \em checkSelfInte tells whether arguments should be checked for
+self-intersection prior to an operation. Its default value is \em False which
+means that there is no need to check it. This option is provided to ensure that
+an operation is performed on not self-intersected shapes as these shapes are
+not valid for boolean operations.
+
+
Our <b>TUI Scripts</b> provide you with useful examples of the use of
\ref tui_boolean_operations_page "Boolean Operations".
* \param theShape2 Second argument for boolean operation.
* \param theOperation Indicates the operation to be done:
* 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
+ * \param IsCheckSelfInte If TRUE, perform check self intersection
+ * of arguments before an operation.
* \return New GEOM_Object, containing the result shape.
*/
GEOM_Object MakeBoolean (in GEOM_Object theShape1,
in GEOM_Object theShape2,
- in long theOperation);
+ in long theOperation,
+ in boolean IsCheckSelfInte);
/*!
* \brief Perform fusion boolean operation on list of objects.
* \param theShapes Shapes to be fused.
+ * \param IsCheckSelfInte If TRUE, perform check self intersection
+ * of arguments before an operation.
* \return New GEOM_Object, containing the result shape.
*/
- GEOM_Object MakeFuseList (in ListOfGO theShapes);
+ GEOM_Object MakeFuseList (in ListOfGO theShapes,
+ in boolean IsCheckSelfInte);
/*!
* \brief Perform common boolean operation on list of objects.
* \param theShapes Shapes for common operation.
+ * \param IsCheckSelfInte If TRUE, perform check self intersection
+ * of arguments before an operation.
* \return New GEOM_Object, containing the result shape.
*/
- GEOM_Object MakeCommonList (in ListOfGO theShapes);
+ GEOM_Object MakeCommonList (in ListOfGO theShapes,
+ in boolean IsCheckSelfInte);
/*!
* \brief Perform cutting of list of objects from theMainShape.
* \param theMainShape the object for cut operation.
* \param theShapes Shapes to be cut from theMainShape (tools).
+ * \param IsCheckSelfInte If TRUE, perform check self intersection
+ * of arguments before an operation.
* \return New GEOM_Object, containing the result shape.
*/
GEOM_Object MakeCutList (in GEOM_Object theMainShape,
- in ListOfGO theShapes);
+ in ListOfGO theShapes,
+ in boolean IsCheckSelfInte);
/*!
* \brief Perform partition operation.
//-----------------------------------------------------------//
GEOM_Object MakeBoolean (in GEOM_Object theShape1,
in GEOM_Object theShape2,
- in long theOperation) ;
+ in long theOperation,
+ in boolean IsCheckSelfInte) ;
GEOM_Object MakeFuse (in GEOM_Object theShape1,
- in GEOM_Object theShape2) ;
+ in GEOM_Object theShape2,
+ in boolean IsCheckSelfInte) ;
GEOM_Object MakePartition (in GEOM_List theShapes,
in GEOM_List theTools,
in GEOM_List theKeepInside,
aBox->GetLastFunction()->SetDescription("");
aShell->GetLastFunction()->SetDescription("");
// Get the common shapes between shell and shape
- Handle(GEOM_Object) aCommonCompound = myBooleanOperations->MakeBoolean (theShape, aShell, 1); // MakeCommon
+ Handle(GEOM_Object) aCommonCompound = myBooleanOperations->MakeBoolean
+ (theShape, aShell, 1, Standard_False); // MakeCommon
if (aCommonCompound.IsNull()) {
SetErrorCode(myBooleanOperations->GetErrorCode());
return false;
mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
mainFrame()->RadioButton3->close();
- myGroup = new DlgRef_2Sel(centralWidget());
+ myGroup = new DlgRef_2Sel2Spin1Check(centralWidget());
myGroup->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
if (myOperation == BooleanGUI::CUT) {
myGroup->LineEdit2->setReadOnly(true);
}
+ myGroup->TextLabel3->hide();
+ myGroup->TextLabel4->hide();
+ myGroup->SpinBox_DX->hide();
+ myGroup->SpinBox_DY->hide();
+ myGroup->CheckButton1->setText(tr("GEOM_CHECK_SELF_INTERSECTIONS"));
+
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
layout->setMargin(0); layout->setSpacing(6);
layout->addWidget(myGroup);
myGroup->LineEdit1->setText("");
myGroup->LineEdit2->setText("");
+ myGroup->CheckButton1->setChecked(true);
myObject1.nullify();
reset();
GEOM::GEOM_Object_var anObj;
GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
+ const bool isCheckSelfInte = myGroup->CheckButton1->isChecked();
switch (myOperation) {
case BooleanGUI::FUSE:
- anObj = anOper->MakeFuseList(myObjects);
+ anObj = anOper->MakeFuseList(myObjects, isCheckSelfInte);
break;
case BooleanGUI::COMMON:
- anObj = anOper->MakeCommonList(myObjects);
+ anObj = anOper->MakeCommonList(myObjects, isCheckSelfInte);
break;
case BooleanGUI::CUT:
- anObj = anOper->MakeCutList(myObject1.get(), myObjects);
+ anObj =
+ anOper->MakeCutList(myObject1.get(), myObjects, isCheckSelfInte);
break;
case BooleanGUI::SECTION:
- anObj = anOper->MakeBoolean(myObject1.get(), myObjects[0], myOperation);
+ anObj = anOper->MakeBoolean
+ (myObject1.get(), myObjects[0], myOperation, isCheckSelfInte);
break;
default:
break;
#include "GEOMBase_Skeleton.h"
#include "GEOM_GenericObjPtr.h"
-class DlgRef_2Sel;
+class DlgRef_2Sel2Spin1Check;
//=================================================================================
// class : BooleanGUI_Dialog
GEOM::GeomObjPtr myObject1;
GEOM::ListOfGO_var myObjects;
- DlgRef_2Sel* myGroup;
+ DlgRef_2Sel2Spin1Check* myGroup;
private slots:
void ClickOnOk();
#include <Standard_ConstructionError.hxx>
#include <StdFail_NotDone.hxx>
-// Comment next macro in order to avoid check of boolean operations arguments for self-intersections
-#define BOP_CHECK_SELF_INTERSECTIONS
// Depth of self-intersection check (see BOPAlgo_CheckerSI::SetLevelOfCheck() for more details)
// Default value for BOPAlgo_CheckerSI gives very long computation when checking face-to-face intersections;
// here check level is decreased to more appropriate value to avoid problems with performance).
GEOMImpl_IBoolean aCI (aFunction);
Standard_Integer aType = aFunction->GetType();
+ const Standard_Boolean isCheckSelfInte = aCI.GetCheckSelfIntersection();
TopoDS_Shape aShape;
if (!ana.IsValid())
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-#ifdef BOP_CHECK_SELF_INTERSECTIONS
- BOPAlgo_CheckerSI aCSI; // checker of self-interferences
- aCSI.SetLevelOfCheck(BOP_SELF_INTERSECTIONS_LEVEL);
- BOPCol_ListOfShape aList1, aList2;
- aList1.Append(aShape1);
- aList2.Append(aShape2);
- aCSI.SetArguments(aList1);
- aCSI.Perform();
- if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0)
- StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
- aCSI.SetArguments(aList2);
- aCSI.Perform();
- if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0)
- StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
-#endif
+ if (isCheckSelfInte) {
+ BOPAlgo_CheckerSI aCSI; // checker of self-interferences
+ aCSI.SetLevelOfCheck(BOP_SELF_INTERSECTIONS_LEVEL);
+ BOPCol_ListOfShape aList1, aList2;
+ aList1.Append(aShape1);
+ aList2.Append(aShape2);
+ aCSI.SetArguments(aList1);
+ aCSI.Perform();
+ if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0)
+ StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
+ aCSI.SetArguments(aList2);
+ aCSI.Perform();
+ if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0)
+ StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
+ }
// Make a copy to prevent the original shape changes.
TopoDS_Shape aShapeCopy1;
if (!aShape.IsNull()) {
BRepCheck_Analyzer anAna (aShape, Standard_True);
-#ifdef BOP_CHECK_SELF_INTERSECTIONS
- BOPAlgo_CheckerSI aCSI; // checker of self-interferences
- aCSI.SetLevelOfCheck(BOP_SELF_INTERSECTIONS_LEVEL);
-#endif
if (!anAna.IsValid()) {
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
}
-#ifdef BOP_CHECK_SELF_INTERSECTIONS
- BOPCol_ListOfShape aList1;
- aList1.Append(aShape);
- aCSI.SetArguments(aList1);
- aCSI.Perform();
- if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
- StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
- }
-#endif
+ BOPAlgo_CheckerSI aCSI; // checker of self-interferences
+
+ if (isCheckSelfInte) {
+ aCSI.SetLevelOfCheck(BOP_SELF_INTERSECTIONS_LEVEL);
+ BOPCol_ListOfShape aList1;
+ aList1.Append(aShape);
+ aCSI.SetArguments(aList1);
+ aCSI.Perform();
+ if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
+ StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
+ }
+ }
// Copy shape
TopoDS_Shape aShapeCopy;
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
}
-#ifdef BOP_CHECK_SELF_INTERSECTIONS
- BOPCol_ListOfShape aList2;
- aList2.Append(aShape2);
- aCSI.SetArguments(aList2);
- aCSI.Perform();
- if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
- StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
- }
-#endif
+ if (isCheckSelfInte) {
+ BOPCol_ListOfShape aList2;
+ aList2.Append(aShape2);
+ aCSI.SetArguments(aList2);
+ aCSI.Perform();
+ if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
+ StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
+ }
+ }
+
// Copy shape
TNaming_CopyShape::CopyTool(aShape2, aMapTShapes, aShapeCopy);
aShape = performOperation (aShape, aShapeCopy, aSimpleType);
if (!aShape.IsNull()) {
// check arguments for Mantis issue 0021019
BRepCheck_Analyzer anAna (aShape, Standard_True);
-#ifdef BOP_CHECK_SELF_INTERSECTIONS
- BOPAlgo_CheckerSI aCSI; // checker of self-interferences
- aCSI.SetLevelOfCheck(BOP_SELF_INTERSECTIONS_LEVEL);
-#endif
+
if (!anAna.IsValid()) {
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
}
-#ifdef BOP_CHECK_SELF_INTERSECTIONS
- BOPCol_ListOfShape aList1;
- aList1.Append(aShape);
- aCSI.SetArguments(aList1);
- aCSI.Perform();
- if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
- StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
- }
-#endif
+ BOPAlgo_CheckerSI aCSI; // checker of self-interferences
+
+ if (isCheckSelfInte) {
+ aCSI.SetLevelOfCheck(BOP_SELF_INTERSECTIONS_LEVEL);
+ BOPCol_ListOfShape aList1;
+ aList1.Append(aShape);
+ aCSI.SetArguments(aList1);
+ aCSI.Perform();
+ if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
+ StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
+ }
+ }
+
// Copy shape
TopoDS_Shape aShapeCopy;
TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
}
-#ifdef BOP_CHECK_SELF_INTERSECTIONS
- BOPCol_ListOfShape aList2;
- aList2.Append(aTool);
- aCSI.SetArguments(aList2);
- aCSI.Perform();
- if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
- StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
- }
-#endif
+ if (isCheckSelfInte) {
+ BOPCol_ListOfShape aList2;
+ aList2.Append(aTool);
+ aCSI.SetArguments(aList2);
+ aCSI.Perform();
+ if (aCSI.ErrorStatus() || aCSI.DS().Interferences().Extent() > 0) {
+ StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is self-intersected");
+ }
+ }
// Copy shape
TNaming_CopyShape::CopyTool(aTool, aMapTShapes, aShapeCopy);
#include "GEOM_Function.hxx"
#include "TColStd_HSequenceOfTransient.hxx"
-#define BOOL_ARG_SHAPE1 1
-#define BOOL_ARG_SHAPE2 2
-#define BOOL_ARG_SHAPES 3
+#define BOOL_ARG_SHAPE1 1
+#define BOOL_ARG_SHAPE2 2
+#define BOOL_ARG_SHAPES 3
+#define BOOL_ARG_CHECK_SELF_INTERSECTION 4
class GEOMImpl_IBoolean
{
void SetShape2(Handle(GEOM_Function) theRef) { _func->SetReference(BOOL_ARG_SHAPE2, theRef); }
void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
{ _func->SetReferenceList(BOOL_ARG_SHAPES, theShapes); }
+ void SetCheckSelfIntersection (Standard_Boolean theFlag)
+ { _func->SetInteger(BOOL_ARG_CHECK_SELF_INTERSECTION, theFlag ? 1 : 0); }
Handle(GEOM_Function) GetShape1() { return _func->GetReference(BOOL_ARG_SHAPE1); }
Handle(GEOM_Function) GetShape2() { return _func->GetReference(BOOL_ARG_SHAPE2); }
Handle(TColStd_HSequenceOfTransient) GetShapes()
{ return _func->GetReferenceList(BOOL_ARG_SHAPES); }
+ Standard_Boolean GetCheckSelfIntersection()
+ { return (_func->GetInteger(BOOL_ARG_CHECK_SELF_INTERSECTION) != 0); }
private:
* MakeBoolean
*/
//=============================================================================
-Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean (Handle(GEOM_Object) theShape1,
- Handle(GEOM_Object) theShape2,
- Standard_Integer theOp)
+Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean
+ (Handle(GEOM_Object) theShape1,
+ Handle(GEOM_Object) theShape2,
+ const Standard_Integer theOp,
+ const Standard_Boolean IsCheckSelfInte)
{
SetErrorCode(KO);
aCI.SetShape1(aRef1);
aCI.SetShape2(aRef2);
+ aCI.SetCheckSelfIntersection(IsCheckSelfInte);
//Compute the Boolean value
try {
else if (theOp == 3) pd << " = geompy.MakeFuse(";
else if (theOp == 4) pd << " = geompy.MakeSection(";
else {}
- pd << theShape1 << ", " << theShape2 << ")";
+ pd << theShape1 << ", " << theShape2;
+
+ if (IsCheckSelfInte) {
+ pd << ", True";
+ }
+
+ pd << ")";
SetErrorCode(OK);
return aBool;
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList
- (const Handle(TColStd_HSequenceOfTransient)& theShapes)
+ (const Handle(TColStd_HSequenceOfTransient)& theShapes,
+ const Standard_Boolean IsCheckSelfInte)
{
SetErrorCode(KO);
if (aShapesSeq.IsNull()) return NULL;
aCI.SetShapes(aShapesSeq);
+ aCI.SetCheckSelfIntersection(IsCheckSelfInte);
//Compute the Boolean value
try {
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aBool <<
- " = geompy.MakeFuseList([" << aDescription.ToCString() << "])";
+ GEOM::TPythonDump pd (aFunction);
+
+ pd << aBool <<
+ " = geompy.MakeFuseList([" << aDescription.ToCString() << "]";
+
+ if (IsCheckSelfInte) {
+ pd << ", True";
+ }
+
+ pd << ")";
SetErrorCode(OK);
return aBool;
*/
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeCommonList
- (const Handle(TColStd_HSequenceOfTransient)& theShapes)
+ (const Handle(TColStd_HSequenceOfTransient)& theShapes,
+ const Standard_Boolean IsCheckSelfInte)
{
SetErrorCode(KO);
if (aShapesSeq.IsNull()) return NULL;
aCI.SetShapes(aShapesSeq);
+ aCI.SetCheckSelfIntersection(IsCheckSelfInte);
//Compute the Boolean value
try {
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aBool <<
- " = geompy.MakeCommonList([" << aDescription.ToCString() << "])";
+ GEOM::TPythonDump pd (aFunction);
+
+ pd << aBool <<
+ " = geompy.MakeCommonList([" << aDescription.ToCString() << "]";
+
+ if (IsCheckSelfInte) {
+ pd << ", True";
+ }
+
+ pd << ")";
SetErrorCode(OK);
return aBool;
//=============================================================================
Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeCutList
(Handle(GEOM_Object) theMainShape,
- const Handle(TColStd_HSequenceOfTransient)& theShapes)
+ const Handle(TColStd_HSequenceOfTransient)& theShapes,
+ const Standard_Boolean IsCheckSelfInte)
{
SetErrorCode(KO);
aCI.SetShape1(aMainRef);
aCI.SetShapes(aShapesSeq);
+ aCI.SetCheckSelfIntersection(IsCheckSelfInte);
//Compute the Boolean value
try {
}
//Make a Python command
- GEOM::TPythonDump(aFunction) << aBool << " = geompy.MakeCutList("
- << theMainShape << ", [" << aDescription.ToCString() << "])";
+ GEOM::TPythonDump pd (aFunction);
+
+ pd << aBool << " = geompy.MakeCutList("
+ << theMainShape << ", [" << aDescription.ToCString() << "]";
+
+ if (IsCheckSelfInte) {
+ pd << ", True";
+ }
+
+ pd << ")";
SetErrorCode(OK);
return aBool;
Standard_EXPORT GEOMImpl_IBooleanOperations(GEOM_Engine* theEngine, int theDocID);
Standard_EXPORT ~GEOMImpl_IBooleanOperations();
- Standard_EXPORT Handle(GEOM_Object) MakeBoolean (Handle(GEOM_Object) theShape1,
- Handle(GEOM_Object) theShape2,
- Standard_Integer theOp);
+ Standard_EXPORT Handle(GEOM_Object) MakeBoolean
+ (Handle(GEOM_Object) theShape1,
+ Handle(GEOM_Object) theShape2,
+ const Standard_Integer theOp,
+ const Standard_Boolean IsCheckSelfInte);
Standard_EXPORT Handle(GEOM_Object) MakeFuseList
- (const Handle(TColStd_HSequenceOfTransient)& theShapes);
+ (const Handle(TColStd_HSequenceOfTransient)& theShapes,
+ const Standard_Boolean IsCheckSelfInte);
Standard_EXPORT Handle(GEOM_Object) MakeCommonList
- (const Handle(TColStd_HSequenceOfTransient)& theShapes);
+ (const Handle(TColStd_HSequenceOfTransient)& theShapes,
+ const Standard_Boolean IsCheckSelfInte);
Standard_EXPORT Handle(GEOM_Object) MakeCutList
(Handle(GEOM_Object) theMainShape,
- const Handle(TColStd_HSequenceOfTransient)& theShapes);
+ const Handle(TColStd_HSequenceOfTransient)& theShapes,
+ const Standard_Boolean IsCheckSelfInte);
Standard_EXPORT Handle(GEOM_Object) MakePartition
(const Handle(TColStd_HSequenceOfTransient)& theShapes,
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeBoolean
- (GEOM::GEOM_Object_ptr theShape1,
- GEOM::GEOM_Object_ptr theShape2,
- CORBA::Long theOp)
+ (GEOM::GEOM_Object_ptr theShape1,
+ GEOM::GEOM_Object_ptr theShape2,
+ CORBA::Long theOp,
+ CORBA::Boolean IsCheckSelfInte)
{
GEOM::GEOM_Object_var aGEOMObject;
if (aSh1.IsNull() || aSh2.IsNull()) return aGEOMObject._retn();
// Make Boolean
- Handle(GEOM_Object) anObject = GetOperations()->MakeBoolean(aSh1, aSh2, theOp);
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeBoolean(aSh1, aSh2, theOp, IsCheckSelfInte);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeFuseList
- (const GEOM::ListOfGO& theShapes)
+ (const GEOM::ListOfGO& theShapes,
+ CORBA::Boolean IsCheckSelfInte)
{
GEOM::GEOM_Object_var aGEOMObject;
}
// Make fusion
- Handle(GEOM_Object) anObject = GetOperations()->MakeFuseList(aShapes);
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeFuseList(aShapes, IsCheckSelfInte);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
*/
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeCommonList
- (const GEOM::ListOfGO& theShapes)
+ (const GEOM::ListOfGO& theShapes,
+ CORBA::Boolean IsCheckSelfInte)
{
GEOM::GEOM_Object_var aGEOMObject;
}
// Make fusion
- Handle(GEOM_Object) anObject = GetOperations()->MakeCommonList(aShapes);
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeCommonList(aShapes, IsCheckSelfInte);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
//=============================================================================
GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeCutList
(GEOM::GEOM_Object_ptr theMainShape,
- const GEOM::ListOfGO& theShapes)
+ const GEOM::ListOfGO& theShapes,
+ CORBA::Boolean IsCheckSelfInte)
{
GEOM::GEOM_Object_var aGEOMObject;
}
// Make fusion
- Handle(GEOM_Object) anObject = GetOperations()->MakeCutList(aMainShape, aShapes);
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakeCutList(aMainShape, aShapes, IsCheckSelfInte);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
GEOM::GEOM_Object_ptr MakeBoolean (GEOM::GEOM_Object_ptr theShape1,
GEOM::GEOM_Object_ptr theShape2,
- CORBA::Long theOp);
+ CORBA::Long theOp,
+ CORBA::Boolean IsCheckSelfInte);
- GEOM::GEOM_Object_ptr MakeFuseList (const GEOM::ListOfGO& theShapes);
+ GEOM::GEOM_Object_ptr MakeFuseList (const GEOM::ListOfGO& theShapes,
+ CORBA::Boolean IsCheckSelfInte);
- GEOM::GEOM_Object_ptr MakeCommonList (const GEOM::ListOfGO& theShapes);
+ GEOM::GEOM_Object_ptr MakeCommonList (const GEOM::ListOfGO& theShapes,
+ CORBA::Boolean IsCheckSelfInte);
GEOM::GEOM_Object_ptr MakeCutList (GEOM::GEOM_Object_ptr theMainShape,
- const GEOM::ListOfGO& theShapes);
+ const GEOM::ListOfGO& theShapes,
+ CORBA::Boolean IsCheckSelfInte);
GEOM::GEOM_Object_ptr MakePartition (const GEOM::ListOfGO& theShapes,
const GEOM::ListOfGO& theTools,
//=============================================================================
// MakeBoolean:
//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoolean (GEOM::GEOM_Object_ptr theShape1,
- GEOM::GEOM_Object_ptr theShape2,
- CORBA::Long theOperation)
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeBoolean
+ (GEOM::GEOM_Object_ptr theShape1,
+ GEOM::GEOM_Object_ptr theShape2,
+ CORBA::Long theOperation,
+ CORBA::Boolean IsCheckSelfInte)
{
beginService( " GEOM_Superv_i::MakeBoolean" );
// theOperation indicates the operation to be done:
// 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section
MESSAGE("GEOM_Superv_i::MakeBoolean");
getBoolOp();
- GEOM::GEOM_Object_ptr anObj = myBoolOp->MakeBoolean(theShape1, theShape2, theOperation);
+ GEOM::GEOM_Object_ptr anObj =
+ myBoolOp->MakeBoolean(theShape1, theShape2, theOperation, IsCheckSelfInte);
endService( " GEOM_Superv_i::MakeBoolean" );
return anObj;
}
//=============================================================================
// MakeFuse:
//=============================================================================
-GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFuse (GEOM::GEOM_Object_ptr theShape1,
- GEOM::GEOM_Object_ptr theShape2)
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFuse
+ (GEOM::GEOM_Object_ptr theShape1,
+ GEOM::GEOM_Object_ptr theShape2,
+ CORBA::Boolean IsCheckSelfInte)
{
beginService( " GEOM_Superv_i::MakeFuse" );
MESSAGE("GEOM_Superv_i::MakeFuse");
getBoolOp();
- GEOM::GEOM_Object_ptr anObj = myBoolOp->MakeBoolean(theShape1, theShape2, 3);
+ GEOM::GEOM_Object_ptr anObj =
+ myBoolOp->MakeBoolean(theShape1, theShape2, 3, IsCheckSelfInte);
endService( " GEOM_Superv_i::MakeFuse" );
return anObj;
}
//-----------------------------------------------------------//
GEOM::GEOM_Object_ptr MakeBoolean (GEOM::GEOM_Object_ptr theShape1,
GEOM::GEOM_Object_ptr theShape2,
- CORBA::Long theOperation);
+ CORBA::Long theOperation,
+ CORBA::Boolean IsCheckSelfInte);
GEOM::GEOM_Object_ptr MakeFuse (GEOM::GEOM_Object_ptr theShape1,
- GEOM::GEOM_Object_ptr theShape2);
+ GEOM::GEOM_Object_ptr theShape2,
+ CORBA::Boolean IsCheckSelfInte);
GEOM::GEOM_Object_ptr MakePartition (GEOM::GEOM_List_ptr theShapes,
GEOM::GEOM_List_ptr theTools,
GEOM::GEOM_List_ptr theKeepInside,
# @param theShape2 Second argument for boolean operation.
# @param theOperation Indicates the operation to be done:\n
# 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
# @return New GEOM.GEOM_Object, containing the result shape.
#
# @ref tui_fuse "Example"
- def MakeBoolean(self, theShape1, theShape2, theOperation, theName=None):
+ def MakeBoolean(self, theShape1, theShape2, theOperation, checkSelfInte=False, theName=None):
"""
Perform one of boolean operations on two given shapes.
theShape2 Second argument for boolean operation.
theOperation Indicates the operation to be done:
1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
New GEOM.GEOM_Object, containing the result shape.
"""
# Example: see GEOM_TestAll.py
- anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
+ anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation, checkSelfInte)
RaiseIfFailed("MakeBoolean", self.BoolOp)
def_names = { 1: "common", 2: "cut", 3: "fuse", 4: "section" }
self._autoPublish(anObj, theName, def_names[theOperation])
## Perform Common boolean operation on two given shapes.
# @param theShape1 First argument for boolean operation.
# @param theShape2 Second argument for boolean operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @ref tui_common "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeCommon(self, theShape1, theShape2, theName=None):
+ def MakeCommon(self, theShape1, theShape2, checkSelfInte=False, theName=None):
"""
Perform Common boolean operation on two given shapes.
Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
- return self.MakeBoolean(theShape1, theShape2, 1, theName)
+ return self.MakeBoolean(theShape1, theShape2, 1, checkSelfInte, theName)
## Perform Cut boolean operation on two given shapes.
# @param theShape1 First argument for boolean operation.
# @param theShape2 Second argument for boolean operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @ref tui_cut "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeCut(self, theShape1, theShape2, theName=None):
+ def MakeCut(self, theShape1, theShape2, checkSelfInte=False, theName=None):
"""
Perform Cut boolean operation on two given shapes.
Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
- return self.MakeBoolean(theShape1, theShape2, 2, theName)
+ return self.MakeBoolean(theShape1, theShape2, 2, checkSelfInte, theName)
## Perform Fuse boolean operation on two given shapes.
# @param theShape1 First argument for boolean operation.
# @param theShape2 Second argument for boolean operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @ref tui_fuse "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeFuse(self, theShape1, theShape2, theName=None):
+ def MakeFuse(self, theShape1, theShape2, checkSelfInte=False, theName=None):
"""
Perform Fuse boolean operation on two given shapes.
Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
- return self.MakeBoolean(theShape1, theShape2, 3, theName)
+ return self.MakeBoolean(theShape1, theShape2, 3, checkSelfInte, theName)
## Perform Section boolean operation on two given shapes.
# @param theShape1 First argument for boolean operation.
# @param theShape2 Second argument for boolean operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @ref tui_section "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeSection(self, theShape1, theShape2, theName=None):
+ def MakeSection(self, theShape1, theShape2, checkSelfInte=False, theName=None):
"""
Perform Section boolean operation on two given shapes.
Parameters:
theShape1 First argument for boolean operation.
theShape2 Second argument for boolean operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
"""
# Example: see GEOM_TestOthers.py
# note: auto-publishing is done in self.MakeBoolean()
- return self.MakeBoolean(theShape1, theShape2, 4, theName)
+ return self.MakeBoolean(theShape1, theShape2, 4, checkSelfInte, theName)
## Perform Fuse boolean operation on the list of shapes.
# @param theShapesList Shapes to be fused.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @ref tui_fuse "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeFuseList(self, theShapesList, theName=None):
+ def MakeFuseList(self, theShapesList, checkSelfInte=False, theName=None):
"""
Perform Fuse boolean operation on the list of shapes.
Parameters:
theShapesList Shapes to be fused.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
"""
# Example: see GEOM_TestOthers.py
- anObj = self.BoolOp.MakeFuseList(theShapesList)
+ anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte)
RaiseIfFailed("MakeFuseList", self.BoolOp)
self._autoPublish(anObj, theName, "fuse")
return anObj
## Perform Common boolean operation on the list of shapes.
# @param theShapesList Shapes for Common operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @ref tui_common "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeCommonList(self, theShapesList, theName=None):
+ def MakeCommonList(self, theShapesList, checkSelfInte=False, theName=None):
"""
Perform Common boolean operation on the list of shapes.
Parameters:
theShapesList Shapes for Common operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
"""
# Example: see GEOM_TestOthers.py
- anObj = self.BoolOp.MakeCommonList(theShapesList)
+ anObj = self.BoolOp.MakeCommonList(theShapesList, checkSelfInte)
RaiseIfFailed("MakeCommonList", self.BoolOp)
self._autoPublish(anObj, theName, "common")
return anObj
## Perform Cut boolean operation on one object and the list of tools.
# @param theMainShape The object of the operation.
# @param theShapesList The list of tools of the operation.
+ # @param checkSelfInte The flag that tells if the arguments should
+ # be checked for self-intersection prior to the operation.
# @param theName Object name; when specified, this parameter is used
# for result publication in the study. Otherwise, if automatic
# publication is switched on, default value is used for result name.
#
# @ref tui_cut "Example 1"
# \n @ref swig_MakeCommon "Example 2"
- def MakeCutList(self, theMainShape, theShapesList, theName=None):
+ def MakeCutList(self, theMainShape, theShapesList, checkSelfInte=False, theName=None):
"""
Perform Cut boolean operation on one object and the list of tools.
Parameters:
theMainShape The object of the operation.
theShapesList The list of tools of the operation.
+ checkSelfInte The flag that tells if the arguments should
+ be checked for self-intersection prior to
+ the operation.
theName Object name; when specified, this parameter is used
for result publication in the study. Otherwise, if automatic
publication is switched on, default value is used for result name.
"""
# Example: see GEOM_TestOthers.py
- anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList)
+ anObj = self.BoolOp.MakeCutList(theMainShape, theShapesList, checkSelfInte)
RaiseIfFailed("MakeCutList", self.BoolOp)
self._autoPublish(anObj, theName, "cut")
return anObj