mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2024-12-24 16:30:35 +05:00
0022471: EDF 2604 GEOM: Suppress the boundary edges of the tools in the fuse operation
This commit is contained in:
parent
a4aaa470ae
commit
ef95b8ac70
Binary file not shown.
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 25 KiB |
@ -12,6 +12,7 @@ In this dialog:
|
||||
- Input or accept the default \b Name of the resulting shape.
|
||||
- Click the arrow button and select in the Object Browser or in the Viewer the <b>Objects</b> to be fused.
|
||||
- Activate the corresponding check-box if you wish to <b> Detect Self-intersections </b>.
|
||||
- Activate the corresponding check-box if you wish to <b> remove extra edges </b>.
|
||||
- Activate \ref restore_presentation_parameters_page "Advanced options" if required.
|
||||
- Press "Apply" or "Apply & Close" button to get the result (GEOM_Object).
|
||||
|
||||
@ -24,15 +25,17 @@ In this dialog:
|
||||
|
||||
This operation can be performed using a <b>TUI Command:</b>
|
||||
|
||||
<em>geompy.MakeFuseList(theShapesList, checkSelfInte)</em>
|
||||
<em>geompy.MakeFuseList(theShapesList, checkSelfInte, rmExtraEdges)</em>
|
||||
|
||||
<b>Arguments:</b> Name + a list of shapes + an optional flag for self-intersection check.
|
||||
<b>Arguments:</b> Name + a list of shapes + an optional flag for
|
||||
self-intersection check + an optional flag to remove extra edges.
|
||||
|
||||
There is also a special <b>TUI Command</b> for \b Fuse operation on two shapes :
|
||||
|
||||
<em>geompy.MakeFuse(s1, s2, checkSelfInte)</em>
|
||||
<em>geompy.MakeFuse(s1, s2, checkSelfInte, rmExtraEdges)</em>
|
||||
|
||||
<b>Arguments:</b> Name + 2 shapes + an optional flag for self-intersection check.
|
||||
<b>Arguments:</b> Name + 2 shapes + an optional flag for self-intersection
|
||||
check + an optional flag to remove extra edges.
|
||||
|
||||
<b>Example:</b>
|
||||
|
||||
|
@ -23,7 +23,7 @@ a list of others. </li>
|
||||
You can use advanced TUI commands performing these operations
|
||||
independently from each other:
|
||||
\par
|
||||
<em>geompy.MakeFuseList(theShapesList, checkSelfInte)</em>, where \em theShapesList is
|
||||
<em>geompy.MakeFuseList(theShapesList, checkSelfInte, rmExtraEdges)</em>, where \em theShapesList is
|
||||
the list of shapes for Fuse operation;
|
||||
\par
|
||||
<em>geompy.MakeCommonList(theShapesList, checkSelfInte)</em>, where \em theShapesList is
|
||||
@ -51,7 +51,7 @@ a Boolean operation, \em Operation is the type of a Boolean operation (1
|
||||
Besides, you can use advanced TUI commands performing these operations
|
||||
independently from each other:
|
||||
\par
|
||||
<em>geompy.MakeFuse(Shape1, Shape2, checkSelfInte)</em>, where \em Shape1 is the first
|
||||
<em>geompy.MakeFuse(Shape1, Shape2, checkSelfInte, rmExtraEdges)</em>, where \em Shape1 is the first
|
||||
argument and \em Shape2 is the second argument of Fuse operation;
|
||||
\par
|
||||
<em>geompy.MakeCommon(Shape1, Shape2, checkSelfInte)</em>, where \em Shape1 is the first
|
||||
@ -73,6 +73,17 @@ not valid for boolean operations.
|
||||
all self-intersections use \ref check_self_intersections_page
|
||||
"Detect Self-intersection tool".
|
||||
|
||||
The flag \em rmExtraEdges is used for \em MakeFuseList and \em MakeFuse
|
||||
operations only. It indicates if Remove Extra Edges operation should be
|
||||
performed during the operation. Its default value is \em False, which
|
||||
means that there is no need to do it.
|
||||
|
||||
\note \em rmExtraEdges is not available for \em MakeBoolean call with
|
||||
operation type 3 (Fuse). \em MakeBoolean operation doesn't perform
|
||||
Remove Extra Edges. So the call <em>geompy.MakeBoolean(Shape1, Shape2,
|
||||
3, checkSelfInte)</em> is equivalent to <em>geompy.MakeFuse(Shape1,
|
||||
Shape2, checkSelfInte, False)</em>.
|
||||
|
||||
Our <b>TUI Scripts</b> provide you with useful examples of the use of
|
||||
\ref tui_boolean_operations_page "Boolean Operations".
|
||||
|
||||
|
@ -2917,16 +2917,33 @@ module GEOM
|
||||
in GEOM_Object theShape2,
|
||||
in long theOperation,
|
||||
in boolean IsCheckSelfInte);
|
||||
/*!
|
||||
* \brief Perform fusion boolean operation on two given shapes.
|
||||
* \param theShape1 First argument for fuse operation.
|
||||
* \param theShape2 Second argument for fuse operation.
|
||||
* \param IsCheckSelfInte If TRUE, perform check self intersection
|
||||
* of arguments before an operation.
|
||||
* \param IsRmExtraEdges If TRUE, perform removal of extra edges
|
||||
* during an operation.
|
||||
* \return New GEOM_Object, containing the result shape.
|
||||
*/
|
||||
GEOM_Object MakeFuse (in GEOM_Object theShape1,
|
||||
in GEOM_Object theShape2,
|
||||
in boolean IsCheckSelfInte,
|
||||
in boolean IsRmExtraEdges);
|
||||
|
||||
/*!
|
||||
* \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.
|
||||
* \param IsRmExtraEdges If TRUE, perform removal of extra edges
|
||||
* during an operation.
|
||||
* \return New GEOM_Object, containing the result shape.
|
||||
*/
|
||||
GEOM_Object MakeFuseList (in ListOfGO theShapes,
|
||||
in boolean IsCheckSelfInte);
|
||||
in boolean IsCheckSelfInte,
|
||||
in boolean IsRmExtraEdges);
|
||||
|
||||
/*!
|
||||
* \brief Perform common boolean operation on list of objects.
|
||||
|
@ -93,7 +93,7 @@ BooleanGUI_Dialog::BooleanGUI_Dialog (const int theOperation, GeometryGUI* theGe
|
||||
mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
|
||||
mainFrame()->RadioButton3->close();
|
||||
|
||||
myGroup = new DlgRef_2Sel2Spin1Check(centralWidget());
|
||||
myGroup = new DlgRef_2Sel2Spin3Check(centralWidget());
|
||||
|
||||
myGroup->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
|
||||
if (myOperation == BooleanGUI::CUT) {
|
||||
@ -108,21 +108,30 @@ BooleanGUI_Dialog::BooleanGUI_Dialog (const int theOperation, GeometryGUI* theGe
|
||||
myGroup->TextLabel2->hide();
|
||||
myGroup->PushButton2->hide();
|
||||
myGroup->LineEdit2->hide();
|
||||
|
||||
if (myOperation == BooleanGUI::FUSE) {
|
||||
myGroup->CheckBox2->setText(tr("GEOM_BOOL_REMOVE_EXTRA_EDGES"));
|
||||
}
|
||||
}
|
||||
|
||||
myGroup->PushButton1->setIcon(image1);
|
||||
myGroup->LineEdit1->setReadOnly(true);
|
||||
|
||||
if (myOperation != BooleanGUI::FUSE && myOperation != BooleanGUI::COMMON) {
|
||||
myGroup->PushButton2->setIcon(image1);
|
||||
myGroup->LineEdit2->setReadOnly(true);
|
||||
if (myOperation != BooleanGUI::FUSE) {
|
||||
myGroup->CheckBox2->hide();
|
||||
|
||||
if (myOperation != BooleanGUI::COMMON) {
|
||||
myGroup->PushButton2->setIcon(image1);
|
||||
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"));
|
||||
myGroup->CheckBox3->hide();
|
||||
myGroup->CheckBox1->setText(tr("GEOM_CHECK_SELF_INTERSECTIONS"));
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
|
||||
layout->setMargin(0); layout->setSpacing(6);
|
||||
@ -158,7 +167,12 @@ void BooleanGUI_Dialog::Init()
|
||||
|
||||
myGroup->LineEdit1->setText("");
|
||||
myGroup->LineEdit2->setText("");
|
||||
myGroup->CheckButton1->setChecked(true);
|
||||
myGroup->CheckBox1->setChecked(true);
|
||||
|
||||
if (myOperation == BooleanGUI::FUSE) {
|
||||
myGroup->CheckBox2->setChecked(true);
|
||||
}
|
||||
|
||||
myObject1.nullify();
|
||||
reset();
|
||||
|
||||
@ -409,11 +423,16 @@ bool BooleanGUI_Dialog::execute (ObjectList& objects)
|
||||
GEOM::GEOM_Object_var anObj;
|
||||
|
||||
GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
|
||||
const bool isCheckSelfInte = myGroup->CheckButton1->isChecked();
|
||||
const bool isCheckSelfInte = myGroup->CheckBox1->isChecked();
|
||||
|
||||
switch (myOperation) {
|
||||
case BooleanGUI::FUSE:
|
||||
anObj = anOper->MakeFuseList(myObjects, isCheckSelfInte);
|
||||
{
|
||||
const bool isRmExtraEdges = myGroup->CheckBox2->isChecked();
|
||||
|
||||
anObj = anOper->MakeFuseList
|
||||
(myObjects, isCheckSelfInte, isRmExtraEdges);
|
||||
}
|
||||
break;
|
||||
case BooleanGUI::COMMON:
|
||||
anObj = anOper->MakeCommonList(myObjects, isCheckSelfInte);
|
||||
|
@ -30,7 +30,7 @@
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "GEOM_GenericObjPtr.h"
|
||||
|
||||
class DlgRef_2Sel2Spin1Check;
|
||||
class DlgRef_2Sel2Spin3Check;
|
||||
|
||||
//=================================================================================
|
||||
// class : BooleanGUI_Dialog
|
||||
@ -65,7 +65,7 @@ private:
|
||||
GEOM::GeomObjPtr myObject1;
|
||||
GEOM::ListOfGO_var myObjects;
|
||||
|
||||
DlgRef_2Sel2Spin1Check* myGroup;
|
||||
DlgRef_2Sel2Spin3Check* myGroup;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
|
@ -4640,6 +4640,10 @@ Please, select face, shell or solid and try again</translation>
|
||||
<source>GEOM_REMOVE_EXTRA_EDGES_TITLE</source>
|
||||
<translation>Remove extra edges</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_BOOL_REMOVE_EXTRA_EDGES</source>
|
||||
<translation>Remove extra edges</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>GEOM_REMOVE_EXTRA_EDGES</source>
|
||||
<translation>Object to remove extra edges</translation>
|
||||
|
@ -26,6 +26,8 @@
|
||||
#include <GEOMImpl_GlueDriver.hxx>
|
||||
#include <GEOM_Function.hxx>
|
||||
#include <GEOMUtils.hxx>
|
||||
#include <BlockFix_BlockFixAPI.hxx>
|
||||
#include <ShHealOper_ShapeProcess.hxx>
|
||||
|
||||
#include <TNaming_CopyShape.hxx>
|
||||
|
||||
@ -61,6 +63,49 @@
|
||||
// here check level is decreased to more appropriate value to avoid problems with performance).
|
||||
#define BOP_SELF_INTERSECTIONS_LEVEL 4
|
||||
|
||||
/**
|
||||
* This function performs extra edges removal.
|
||||
*
|
||||
* \param theShape the shape to be processed.
|
||||
* \return the modified shape or null shape in case of failure.
|
||||
*/
|
||||
static TopoDS_Shape RemoveExtraEdges(const TopoDS_Shape &theShape)
|
||||
{
|
||||
TopoDS_Shape aResult;
|
||||
|
||||
if (theShape.IsNull() == Standard_False) {
|
||||
BlockFix_BlockFixAPI aTool;
|
||||
|
||||
aTool.OptimumNbFaces() = 0;
|
||||
aTool.SetShape(theShape);
|
||||
aTool.Perform();
|
||||
aResult = aTool.Shape();
|
||||
|
||||
// Repair result
|
||||
BRepCheck_Analyzer anAna (aResult, false);
|
||||
Standard_Boolean isValid = anAna.IsValid();
|
||||
|
||||
if (!isValid) {
|
||||
TopoDS_Shape aFixed;
|
||||
ShHealOper_ShapeProcess aHealer;
|
||||
|
||||
aHealer.Perform(aResult, aFixed);
|
||||
|
||||
if (aHealer.isDone()) {
|
||||
aResult = aFixed;
|
||||
anAna.Init(aResult, false);
|
||||
isValid = anAna.IsValid();
|
||||
}
|
||||
}
|
||||
|
||||
if (!isValid) {
|
||||
aResult.Nullify();
|
||||
}
|
||||
}
|
||||
|
||||
return aResult;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetID
|
||||
//purpose :
|
||||
@ -91,6 +136,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
|
||||
GEOMImpl_IBoolean aCI (aFunction);
|
||||
Standard_Integer aType = aFunction->GetType();
|
||||
const Standard_Boolean isCheckSelfInte = aCI.GetCheckSelfIntersection();
|
||||
const Standard_Boolean isRmExtraEdges = aCI.GetRmExtraEdges();
|
||||
|
||||
TopoDS_Shape aShape;
|
||||
|
||||
@ -139,8 +185,13 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
|
||||
|
||||
aShape = performOperation (aShapeCopy1, aShapeCopy2, aType);
|
||||
|
||||
if (aShape.IsNull())
|
||||
if (isRmExtraEdges) {
|
||||
aShape = RemoveExtraEdges(aShape);
|
||||
}
|
||||
|
||||
if (aShape.IsNull()) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -209,6 +260,10 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
|
||||
TNaming_CopyShape::CopyTool(aShape2, aMapTShapes, aShapeCopy);
|
||||
aShape = performOperation (aShape, aShapeCopy, aSimpleType);
|
||||
|
||||
if (isRmExtraEdges) {
|
||||
aShape = RemoveExtraEdges(aShape);
|
||||
}
|
||||
|
||||
if (aShape.IsNull()) {
|
||||
return 0;
|
||||
}
|
||||
@ -621,40 +676,50 @@ GetCreationInformation(std::string& theOperationName,
|
||||
|
||||
GEOMImpl_IBoolean aCI (function);
|
||||
Standard_Integer aType = function->GetType();
|
||||
Standard_Boolean isCheckSelfInte = aCI.GetCheckSelfIntersection();
|
||||
|
||||
switch ( aType ) {
|
||||
case BOOLEAN_COMMON:
|
||||
theOperationName = "COMMON";
|
||||
AddParam( theParams, "Object 1", aCI.GetShape1() );
|
||||
AddParam( theParams, "Object 2", aCI.GetShape2() );
|
||||
AddParam( theParams, "Check self-intersections", isCheckSelfInte );
|
||||
break;
|
||||
case BOOLEAN_CUT:
|
||||
theOperationName = "CUT";
|
||||
AddParam( theParams, "Main Object", aCI.GetShape1() );
|
||||
AddParam( theParams, "Tool Object", aCI.GetShape2() );
|
||||
AddParam( theParams, "Check self-intersections", isCheckSelfInte );
|
||||
break;
|
||||
case BOOLEAN_FUSE:
|
||||
theOperationName = "FUSE";
|
||||
AddParam( theParams, "Object 1", aCI.GetShape1() );
|
||||
AddParam( theParams, "Object 2", aCI.GetShape2() );
|
||||
AddParam( theParams, "Check self-intersections", isCheckSelfInte );
|
||||
AddParam( theParams, "Remove extra edges", aCI.GetRmExtraEdges() );
|
||||
break;
|
||||
case BOOLEAN_SECTION:
|
||||
theOperationName = "SECTION";
|
||||
AddParam( theParams, "Object 1", aCI.GetShape1() );
|
||||
AddParam( theParams, "Object 2", aCI.GetShape2() );
|
||||
AddParam( theParams, "Check self-intersections", isCheckSelfInte );
|
||||
break;
|
||||
case BOOLEAN_COMMON_LIST:
|
||||
theOperationName = "COMMON";
|
||||
AddParam( theParams, "Selected objects", aCI.GetShapes() );
|
||||
AddParam( theParams, "Check self-intersections", isCheckSelfInte );
|
||||
break;
|
||||
case BOOLEAN_FUSE_LIST:
|
||||
theOperationName = "FUSE";
|
||||
AddParam( theParams, "Selected objects", aCI.GetShapes() );
|
||||
AddParam( theParams, "Check self-intersections", isCheckSelfInte );
|
||||
AddParam( theParams, "Remove extra edges", aCI.GetRmExtraEdges() );
|
||||
break;
|
||||
case BOOLEAN_CUT_LIST:
|
||||
theOperationName = "CUT";
|
||||
AddParam( theParams, "Main Object", aCI.GetShape1() );
|
||||
AddParam( theParams, "Tool Objects", aCI.GetShapes() );
|
||||
AddParam( theParams, "Check self-intersections", isCheckSelfInte );
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
@ -29,6 +29,7 @@
|
||||
#define BOOL_ARG_SHAPE2 2
|
||||
#define BOOL_ARG_SHAPES 3
|
||||
#define BOOL_ARG_CHECK_SELF_INTERSECTION 4
|
||||
#define BOOL_ARG_RM_EXTRA_EDGES 5
|
||||
|
||||
class GEOMImpl_IBoolean
|
||||
{
|
||||
@ -42,6 +43,8 @@ class GEOMImpl_IBoolean
|
||||
{ _func->SetReferenceList(BOOL_ARG_SHAPES, theShapes); }
|
||||
void SetCheckSelfIntersection (Standard_Boolean theFlag)
|
||||
{ _func->SetInteger(BOOL_ARG_CHECK_SELF_INTERSECTION, theFlag ? 1 : 0); }
|
||||
void SetRmExtraEdges (Standard_Boolean theFlag)
|
||||
{ _func->SetInteger(BOOL_ARG_RM_EXTRA_EDGES, theFlag ? 1 : 0); }
|
||||
|
||||
Handle(GEOM_Function) GetShape1() { return _func->GetReference(BOOL_ARG_SHAPE1); }
|
||||
Handle(GEOM_Function) GetShape2() { return _func->GetReference(BOOL_ARG_SHAPE2); }
|
||||
@ -49,6 +52,8 @@ class GEOMImpl_IBoolean
|
||||
{ return _func->GetReferenceList(BOOL_ARG_SHAPES); }
|
||||
Standard_Boolean GetCheckSelfIntersection()
|
||||
{ return (_func->GetInteger(BOOL_ARG_CHECK_SELF_INTERSECTION) != 0); }
|
||||
Standard_Boolean GetRmExtraEdges()
|
||||
{ return (_func->GetInteger(BOOL_ARG_RM_EXTRA_EDGES) != 0); }
|
||||
|
||||
private:
|
||||
|
||||
|
@ -148,6 +148,72 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean
|
||||
return aBool;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* MakeFuse
|
||||
*/
|
||||
//=============================================================================
|
||||
Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuse
|
||||
(Handle(GEOM_Object) theShape1,
|
||||
Handle(GEOM_Object) theShape2,
|
||||
const bool IsCheckSelfInte,
|
||||
const bool IsRmExtraEdges)
|
||||
{
|
||||
SetErrorCode(KO);
|
||||
|
||||
if (theShape1.IsNull() || theShape2.IsNull()) return NULL;
|
||||
|
||||
//Add a new Boolean object
|
||||
Handle(GEOM_Object) aBool = GetEngine()->AddObject(GetDocID(), GEOM_BOOLEAN);
|
||||
|
||||
//Add a new Boolean function
|
||||
Handle(GEOM_Function) aFunction =
|
||||
aBool->AddFunction(GEOMImpl_BooleanDriver::GetID(), BOOLEAN_FUSE);
|
||||
|
||||
if (aFunction.IsNull()) return NULL;
|
||||
|
||||
//Check if the function is set correctly
|
||||
if (aFunction->GetDriverGUID() != GEOMImpl_BooleanDriver::GetID()) return NULL;
|
||||
|
||||
GEOMImpl_IBoolean aCI (aFunction);
|
||||
|
||||
Handle(GEOM_Function) aRef1 = theShape1->GetLastFunction();
|
||||
Handle(GEOM_Function) aRef2 = theShape2->GetLastFunction();
|
||||
|
||||
if (aRef1.IsNull() || aRef2.IsNull()) return NULL;
|
||||
|
||||
aCI.SetShape1(aRef1);
|
||||
aCI.SetShape2(aRef2);
|
||||
aCI.SetCheckSelfIntersection(IsCheckSelfInte);
|
||||
aCI.SetRmExtraEdges(IsRmExtraEdges);
|
||||
|
||||
//Compute the Boolean value
|
||||
try {
|
||||
#if OCC_VERSION_LARGE > 0x06010000
|
||||
OCC_CATCH_SIGNALS;
|
||||
#endif
|
||||
if (!GetSolver()->ComputeFunction(aFunction)) {
|
||||
SetErrorCode("Boolean driver failed");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||
SetErrorCode(aFail->GetMessageString());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//Make a Python command
|
||||
GEOM::TPythonDump pd (aFunction);
|
||||
|
||||
pd << aBool << " = geompy.MakeFuse(";
|
||||
pd << theShape1 << ", " << theShape2 << ", "
|
||||
<< IsCheckSelfInte << ", " << IsRmExtraEdges << ")";
|
||||
|
||||
SetErrorCode(OK);
|
||||
return aBool;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* MakeFuseList
|
||||
@ -155,7 +221,8 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeBoolean
|
||||
//=============================================================================
|
||||
Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList
|
||||
(const Handle(TColStd_HSequenceOfTransient)& theShapes,
|
||||
const Standard_Boolean IsCheckSelfInte)
|
||||
const bool IsCheckSelfInte,
|
||||
const bool IsRmExtraEdges)
|
||||
{
|
||||
SetErrorCode(KO);
|
||||
|
||||
@ -183,6 +250,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList
|
||||
|
||||
aCI.SetShapes(aShapesSeq);
|
||||
aCI.SetCheckSelfIntersection(IsCheckSelfInte);
|
||||
aCI.SetRmExtraEdges(IsRmExtraEdges);
|
||||
|
||||
//Compute the Boolean value
|
||||
try {
|
||||
@ -203,14 +271,8 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakeFuseList
|
||||
//Make a Python command
|
||||
GEOM::TPythonDump pd (aFunction);
|
||||
|
||||
pd << aBool <<
|
||||
" = geompy.MakeFuseList([" << aDescription.ToCString() << "]";
|
||||
|
||||
if (IsCheckSelfInte) {
|
||||
pd << ", True";
|
||||
}
|
||||
|
||||
pd << ")";
|
||||
pd << aBool << " = geompy.MakeFuseList([" << aDescription.ToCString() << "], "
|
||||
<< IsCheckSelfInte << ", " << IsRmExtraEdges << ")";
|
||||
|
||||
SetErrorCode(OK);
|
||||
return aBool;
|
||||
|
@ -42,9 +42,16 @@ class GEOMImpl_IBooleanOperations : public GEOM_IOperations {
|
||||
const Standard_Integer theOp,
|
||||
const Standard_Boolean IsCheckSelfInte);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeFuse
|
||||
(Handle(GEOM_Object) theShape1,
|
||||
Handle(GEOM_Object) theShape2,
|
||||
const bool IsCheckSelfInte,
|
||||
const bool IsRmExtraEdges);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeFuseList
|
||||
(const Handle(TColStd_HSequenceOfTransient)& theShapes,
|
||||
const Standard_Boolean IsCheckSelfInte);
|
||||
const bool IsCheckSelfInte,
|
||||
const bool IsRmExtraEdges);
|
||||
|
||||
Standard_EXPORT Handle(GEOM_Object) MakeCommonList
|
||||
(const Handle(TColStd_HSequenceOfTransient)& theShapes,
|
||||
|
@ -87,6 +87,38 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeBoolean
|
||||
return GetObject(anObject);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* MakeFuse
|
||||
*/
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeFuse
|
||||
(GEOM::GEOM_Object_ptr theShape1,
|
||||
GEOM::GEOM_Object_ptr theShape2,
|
||||
CORBA::Boolean IsCheckSelfInte,
|
||||
CORBA::Boolean IsRmExtraEdges)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
|
||||
//Set a not done flag
|
||||
GetOperations()->SetNotDone();
|
||||
|
||||
//Get the reference shapes
|
||||
Handle(GEOM_Object) aSh1 = GetObjectImpl(theShape1);
|
||||
Handle(GEOM_Object) aSh2 = GetObjectImpl(theShape2);
|
||||
|
||||
if (aSh1.IsNull() || aSh2.IsNull()) return aGEOMObject._retn();
|
||||
|
||||
// Make Boolean
|
||||
Handle(GEOM_Object) anObject = GetOperations()->MakeFuse
|
||||
(aSh1, aSh2, IsCheckSelfInte, IsRmExtraEdges);
|
||||
|
||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
return aGEOMObject._retn();
|
||||
|
||||
return GetObject(anObject);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
/*!
|
||||
* MakeFuseList
|
||||
@ -94,7 +126,8 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeBoolean
|
||||
//=============================================================================
|
||||
GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeFuseList
|
||||
(const GEOM::ListOfGO& theShapes,
|
||||
CORBA::Boolean IsCheckSelfInte)
|
||||
CORBA::Boolean IsCheckSelfInte,
|
||||
CORBA::Boolean IsRmExtraEdges)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGEOMObject;
|
||||
|
||||
@ -110,7 +143,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakeFuseList
|
||||
|
||||
// Make fusion
|
||||
Handle(GEOM_Object) anObject =
|
||||
GetOperations()->MakeFuseList(aShapes, IsCheckSelfInte);
|
||||
GetOperations()->MakeFuseList(aShapes, IsCheckSelfInte, IsRmExtraEdges);
|
||||
|
||||
if (!GetOperations()->IsDone() || anObject.IsNull())
|
||||
return aGEOMObject._retn();
|
||||
|
@ -47,8 +47,14 @@ class GEOM_I_EXPORT GEOM_IBooleanOperations_i :
|
||||
CORBA::Long theOp,
|
||||
CORBA::Boolean IsCheckSelfInte);
|
||||
|
||||
GEOM::GEOM_Object_ptr MakeFuse (GEOM::GEOM_Object_ptr theShape1,
|
||||
GEOM::GEOM_Object_ptr theShape2,
|
||||
CORBA::Boolean IsCheckSelfInte,
|
||||
CORBA::Boolean IsRmExtraEdges);
|
||||
|
||||
GEOM::GEOM_Object_ptr MakeFuseList (const GEOM::ListOfGO& theShapes,
|
||||
CORBA::Boolean IsCheckSelfInte);
|
||||
CORBA::Boolean IsCheckSelfInte,
|
||||
CORBA::Boolean IsRmExtraEdges);
|
||||
|
||||
GEOM::GEOM_Object_ptr MakeCommonList (const GEOM::ListOfGO& theShapes,
|
||||
CORBA::Boolean IsCheckSelfInte);
|
||||
|
@ -6846,6 +6846,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
# @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 rmExtraEdges The flag that tells if Remove Extra Edges
|
||||
# operation should be performed during 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.
|
||||
@ -6862,7 +6864,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
#
|
||||
# @ref tui_fuse "Example 1"
|
||||
# \n @ref swig_MakeCommon "Example 2"
|
||||
def MakeFuse(self, theShape1, theShape2, checkSelfInte=False, theName=None):
|
||||
def MakeFuse(self, theShape1, theShape2, checkSelfInte=False,
|
||||
rmExtraEdges=False, theName=None):
|
||||
"""
|
||||
Perform Fuse boolean operation on two given shapes.
|
||||
|
||||
@ -6872,6 +6875,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
checkSelfInte The flag that tells if the arguments should
|
||||
be checked for self-intersection prior to
|
||||
the operation.
|
||||
rmExtraEdges The flag that tells if Remove Extra Edges
|
||||
operation should be performed during 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.
|
||||
@ -6890,8 +6895,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
|
||||
"""
|
||||
# Example: see GEOM_TestOthers.py
|
||||
# note: auto-publishing is done in self.MakeBoolean()
|
||||
return self.MakeBoolean(theShape1, theShape2, 3, checkSelfInte, theName)
|
||||
anObj = self.BoolOp.MakeFuse(theShape1, theShape2,
|
||||
checkSelfInte, rmExtraEdges)
|
||||
RaiseIfFailed("MakeFuse", self.BoolOp)
|
||||
self._autoPublish(anObj, theName, "fuse")
|
||||
return anObj
|
||||
|
||||
## Perform Section boolean operation on two given shapes.
|
||||
# @param theShape1 First argument for boolean operation.
|
||||
@ -6949,6 +6957,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
# @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 rmExtraEdges The flag that tells if Remove Extra Edges
|
||||
# operation should be performed during 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.
|
||||
@ -6965,7 +6975,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
#
|
||||
# @ref tui_fuse "Example 1"
|
||||
# \n @ref swig_MakeCommon "Example 2"
|
||||
def MakeFuseList(self, theShapesList, checkSelfInte=False, theName=None):
|
||||
def MakeFuseList(self, theShapesList, checkSelfInte=False,
|
||||
rmExtraEdges=False, theName=None):
|
||||
"""
|
||||
Perform Fuse boolean operation on the list of shapes.
|
||||
|
||||
@ -6974,6 +6985,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
checkSelfInte The flag that tells if the arguments should
|
||||
be checked for self-intersection prior to
|
||||
the operation.
|
||||
rmExtraEdges The flag that tells if Remove Extra Edges
|
||||
operation should be performed during 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.
|
||||
@ -6992,7 +7005,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
|
||||
"""
|
||||
# Example: see GEOM_TestOthers.py
|
||||
anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte)
|
||||
anObj = self.BoolOp.MakeFuseList(theShapesList, checkSelfInte,
|
||||
rmExtraEdges)
|
||||
RaiseIfFailed("MakeFuseList", self.BoolOp)
|
||||
self._autoPublish(anObj, theName, "fuse")
|
||||
return anObj
|
||||
@ -12662,8 +12676,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
|
||||
Returns:
|
||||
New GEOM_Object, containing the created shape.
|
||||
"""
|
||||
anObj = self.AdvOp.MakeSmoothingSurface
|
||||
(thelPoints, theNbMax, theDegMax, theDMax)
|
||||
anObj = self.AdvOp.MakeSmoothingSurface(thelPoints, theNbMax,
|
||||
theDegMax, theDMax)
|
||||
RaiseIfFailed("MakeSmoothingSurface", self.AdvOp)
|
||||
self._autoPublish(anObj, theName, "smoothing")
|
||||
return anObj
|
||||
|
Loading…
Reference in New Issue
Block a user