* \note Each compound from ListShapes and ListTools will be exploded in order
* to avoid possible intersection between shapes from this compound.
* \param theLimit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
+ # \param KeepNonlimitShapes: if this parameter == 0 - only shapes with
+ # type <= Limit are kept in the result,
+ # else - shapes with type > Limit are kept
+ # also (if they exist)
*
* After implementation new version of PartitionAlgo (October 2006)
* other parameters are ignored by current functionality. They are kept
in ListOfGO theRemoveInside,
in short theLimit,
in boolean theRemoveWebs,
- in ListOfLong theMaterials);
+ in ListOfLong theMaterials,
+ in short theKeepNonlimitShapes);
/*!
* Perform partition operation.
in ListOfGO theRemoveInside,
in short theLimit,
in boolean theRemoveWebs,
- in ListOfLong theMaterials);
+ in ListOfLong theMaterials,
+ in short theKeepNonlimitShapes);
/*!
* Perform partition of the Shape with the Plane
in GEOM_List theRemoveInside,
in short theLimit,
in boolean theRemoveWebs,
- in GEOM_List theMaterials) ;
+ in GEOM_List theMaterials,
+ in short theKeepNonlimitShapes);
GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
in GEOM_Object thePlane) ;
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/****************************************************************************
+** Form implementation generated from reading ui file 'DlgRef_4Sel1List_QTD.ui'
+**
+** Created: lun oct 31 17:21:04 2006
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "DlgRef_2Sel1List1Check_QTD.h"
+
+#include <qvariant.h>
+#include <qcombobox.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include <qradiobutton.h>
+
+/*
+ * Constructs a DlgRef_2Sel1List_QTD which is a child of 'parent', with the
+ * name 'name' and widget flags set to 'f'.
+ */
+DlgRef_2Sel1List1Check_QTD::DlgRef_2Sel1List1Check_QTD( QWidget* parent,
+ const char* name,
+ WFlags fl )
+ : QWidget( parent, name, fl )
+{
+ if ( !name )
+ setName( "DlgRef_2Sel1List1Check_QTD" );
+ resize( 129, 175 );
+ setCaption( trUtf8( "DlgRef_2Sel1List1Check_QTD" ) );
+ DlgRef_2Sel1List1Check_QTDLayout = new QGridLayout( this, 1, 1, 0, 6, "DlgRef_2Sel1List1Check_QTDLayout");
+
+ GroupBox1 = new QGroupBox( this, "GroupBox1" );
+ GroupBox1->setTitle( trUtf8( "" ) );
+ GroupBox1->setColumnLayout(0, Qt::Vertical );
+ GroupBox1->layout()->setSpacing( 6 );
+ GroupBox1->layout()->setMargin( 11 );
+ GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
+ GroupBox1Layout->setAlignment( Qt::AlignTop );
+
+ Layout1 = new QGridLayout( 0, 1, 1, 0, 6, "Layout1");
+
+ TextLabel1 = new QLabel( GroupBox1, "TextLabel1" );
+ TextLabel1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
+ TextLabel1->setText( trUtf8( "TL1" ) );
+
+ Layout1->addWidget( TextLabel1, 0, 0 );
+
+ PushButton1 = new QPushButton( GroupBox1, "PushButton1" );
+ PushButton1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton1->sizePolicy().hasHeightForWidth() ) );
+ PushButton1->setText( trUtf8( "" ) );
+
+ Layout1->addWidget( PushButton1, 0, 1 );
+
+ LineEdit1 = new QLineEdit( GroupBox1, "LineEdit1" );
+
+ Layout1->addWidget( LineEdit1, 0, 2 );
+
+
+ TextLabel2 = new QLabel( GroupBox1, "TextLabel2" );
+ TextLabel2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel2->sizePolicy().hasHeightForWidth() ) );
+ TextLabel2->setText( trUtf8( "TL2" ) );
+
+ Layout1->addWidget( TextLabel2, 1, 0 );
+
+ PushButton2 = new QPushButton( GroupBox1, "PushButton2" );
+ PushButton2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, PushButton2->sizePolicy().hasHeightForWidth() ) );
+ PushButton2->setText( trUtf8( "" ) );
+
+ Layout1->addWidget( PushButton2, 1, 1 );
+
+ LineEdit2 = new QLineEdit( GroupBox1, "LineEdit2" );
+
+ Layout1->addWidget( LineEdit2, 1, 2 );
+
+
+ TextLabel3 = new QLabel( GroupBox1, "TextLabel3" );
+ TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );
+ TextLabel3->setText( trUtf8( "TL3" ) );
+
+ Layout1->addMultiCellWidget( TextLabel3, 2, 2, 0, 1 );
+
+ ComboBox1 = new QComboBox( FALSE, GroupBox1, "ComboBox1" );
+ ComboBox1->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, ComboBox1->sizePolicy().hasHeightForWidth() ) );
+
+ Layout1->addWidget( ComboBox1, 2, 2 );
+
+ radioButton4 = new QRadioButton( GroupBox1, "radioButton4" );
+ GroupBox1Layout->addMultiCellWidget( radioButton4, 3, 3, 0, 1 );
+
+ GroupBox1Layout->addLayout( Layout1, 0, 0 );
+
+ DlgRef_2Sel1List1Check_QTDLayout->addWidget( GroupBox1, 0, 0 );
+
+ QSpacerItem* spacer = new QSpacerItem( 0, 80, QSizePolicy::Minimum, QSizePolicy::Expanding );
+ Layout1->addItem( spacer, 5, 2 );
+
+}
+
+/*
+ * Destroys the object and frees any allocated resources
+ */
+DlgRef_2Sel1List1Check_QTD::~DlgRef_2Sel1List1Check_QTD()
+{
+ // no need to delete child widgets, Qt does it all for us
+}
+
--- /dev/null
+// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+/****************************************************************************
+** Form interface generated from reading ui file 'DlgRef_2Sel1List_QTD.ui'
+**
+** Created: lun oct 31 17:21:03 2006
+** by: The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef DLGREF_2SEL1LIST_QTD_H
+#define DLGREF_2SEL1LIST_QTD_H
+
+#include <qvariant.h>
+#include <qwidget.h>
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QComboBox;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QRadioButton;
+
+class DlgRef_2Sel1List1Check_QTD : public QWidget
+{
+ Q_OBJECT
+
+public:
+ DlgRef_2Sel1List1Check_QTD( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
+ ~DlgRef_2Sel1List1Check_QTD();
+
+ QGroupBox* GroupBox1;
+ QLineEdit* LineEdit2;
+ QPushButton* PushButton1;
+ QPushButton* PushButton2;
+ QLabel* TextLabel1;
+ QLineEdit* LineEdit1;
+ QLabel* TextLabel2;
+ QComboBox* ComboBox1;
+ QLabel* TextLabel3;
+ QRadioButton* radioButton4;
+
+
+protected:
+ QGridLayout* DlgRef_2Sel1List1Check_QTDLayout;
+ QGridLayout* GroupBox1Layout;
+ QGridLayout* Layout1;
+};
+
+#endif // DLGREF_2SEL1LIST1CHECK_QTD_H
DlgRef_3Sel4Spin2Check_QTD.cxx \
DlgRef_4Sel1List_QTD.cxx \
DlgRef_2Sel1List_QTD.cxx \
+ DlgRef_2Sel1List1Check_QTD.cxx \
DlgRef_1List1Spin1Btn_QTD.cxx \
DlgRef_4Sel1List1Check_QTD.cxx \
DlgRef_1Spin_QTD.cxx \
DlgRef_3Sel4Spin2Check_QTD.h \
DlgRef_4Sel1List_QTD.h \
DlgRef_2Sel1List_QTD.h \
+ DlgRef_2Sel1List1Check_QTD.h \
DlgRef_1List1Spin1Btn_QTD.h \
DlgRef_4Sel1List1Check_QTD.h \
DlgRef_1Spin_QTD.h \
Limit(me)
returns ShapeEnum from TopAbs;
+
+ SetLimitMode(me:out;
+ aLimitMode:Integer from Standard);
+
+ LimitMode(me)
+ returns Integer from Standard;
+
--
-- Protected methods
--
myTools : ListOfShape from TopTools is protected;
myMapTools : MapOfShape from TopTools is protected;
myLimit : ShapeEnum from TopAbs is protected;
+ myLimitMode : Integer from Standard is protected;
+
end Splitter;
#include <NMTTools_DSFiller.hxx>
+static
+ void TreatCompound(const TopoDS_Shape& aC,
+ TopTools_ListOfShape& aLSX);
+
//=======================================================================
//function :
//purpose :
GEOMAlgo_Builder()
{
myLimit=TopAbs_SHAPE;
+ myLimitMode=0;
}
//=======================================================================
//function : ~
return myLimit;
}
//=======================================================================
+//function : SetLimitMode
+//purpose :
+//=======================================================================
+ void GEOMAlgo_Splitter::SetLimitMode(const Standard_Integer aMode)
+{
+ myLimitMode=aMode;
+}
+//=======================================================================
+//function : LimitMode
+//purpose :
+//=======================================================================
+ Standard_Integer GEOMAlgo_Splitter::LimitMode()const
+{
+ return myLimitMode;
+}
+//=======================================================================
//function : Clear
//purpose :
//=======================================================================
Standard_Integer i, aNbS;
BRep_Builder aBB;
TopoDS_Compound aC;
- TopTools_IndexedMapOfShape aM;
+ TopTools_IndexedMapOfShape aMx;
//
aBB.MakeCompound(aC);
//
- TopExp::MapShapes(myShape, myLimit, aM);
- aNbS=aM.Extent();
+ TopExp::MapShapes(myShape, myLimit, aMx);
+ aNbS=aMx.Extent();
for (i=1; i<=aNbS; ++i) {
- const TopoDS_Shape& aS=aM(i);
+ const TopoDS_Shape& aS=aMx(i);
aBB.Add(aC, aS);
}
+ //modified by NIZNHY-PKV Thu Feb 15 17:09:32 2007f
+ if (myLimitMode) {
+ Standard_Integer iType, iLimit, iTypeX;
+ TopAbs_ShapeEnum aType, aTypeX;
+ TopTools_ListOfShape aLSP, aLSX;
+ TopTools_ListIteratorOfListOfShape aIt, aItX, aItIm;
+ TopTools_MapOfShape aM;
+ //
+ iLimit=(Standard_Integer)myLimit;
+ //
+ // 1. Collect the shapes to process aLSP
+ aIt.Initialize(myShapes);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aS=aIt.Value();
+ if (myMapTools.Contains(aS)) {
+ continue;
+ }
+ //
+ aType=aS.ShapeType();
+ iType=(Standard_Integer)aType;
+ //
+ if (iType>iLimit) {
+ aLSP.Append(aS);
+ }
+ //
+ else if (aType==TopAbs_COMPOUND) {
+ aLSX.Clear();
+ //
+ TreatCompound(aS, aLSX);
+ //
+ aItX.Initialize(aLSX);
+ for (; aItX.More(); aItX.Next()) {
+ const TopoDS_Shape& aSX=aItX.Value();
+ aTypeX=aSX.ShapeType();
+ iTypeX=(Standard_Integer)aTypeX;
+ //
+ if (iTypeX>iLimit) {
+ aLSP.Append(aSX);
+ }
+ }
+ }
+ }// for (; aIt.More(); aIt.Next()) {
+ //
+ // 2. Add them to aC
+ aIt.Initialize(aLSP);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aS=aIt.Value();
+ if (myImages.HasImage(aS)) {
+ const TopTools_ListOfShape& aLSIm=myImages.Image(aS);
+ aItIm.Initialize(aLSIm);
+ for (; aItIm.More(); aItIm.Next()) {
+ const TopoDS_Shape& aSIm=aItIm.Value();
+ if (aM.Add(aSIm)) {
+ aBB.Add(aC, aSIm);
+ }
+ }
+ }
+ else {
+ if (aM.Add(aS)) {
+ aBB.Add(aC, aS);
+ }
+ }
+ }
+ }// if (myLimitMode) {
+ //modified by NIZNHY-PKV Thu Feb 15 17:09:34 2007t
myShape=aC;
- }
+ }//if (myLimit!=TopAbs_SHAPE) {
//
GEOMAlgo_Builder::PostTreat();
+}
+//=======================================================================
+//function : TreatCompound
+//purpose :
+//=======================================================================
+void TreatCompound(const TopoDS_Shape& aC1,
+ TopTools_ListOfShape& aLSX)
+{
+ Standard_Integer aNbC1;
+ TopAbs_ShapeEnum aType;
+ TopTools_ListOfShape aLC, aLC1;
+ TopTools_ListIteratorOfListOfShape aIt, aIt1;
+ TopoDS_Iterator aItC;
//
+ aLC.Append (aC1);
+ while(1) {
+ aLC1.Clear();
+ aIt.Initialize(aLC);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aC=aIt.Value(); //C is compound
+ //
+ aItC.Initialize(aC);
+ for (; aItC.More(); aItC.Next()) {
+ const TopoDS_Shape& aS=aItC.Value();
+ aType=aS.ShapeType();
+ if (aType==TopAbs_COMPOUND) {
+ aLC1.Append(aS);
+ }
+ else {
+ aLSX.Append(aS);
+ }
+ }
+ }
+ //
+ aNbC1=aLC1.Extent();
+ if (!aNbC1) {
+ break;
+ }
+ //
+ aLC.Clear();
+ aIt.Initialize(aLC1);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aSC=aIt.Value();
+ aLC.Append(aSC);
+ }
+ }// while(1)
}
//
// myErrorStatus
#ifndef _TopAbs_ShapeEnum_HeaderFile
#include <TopAbs_ShapeEnum.hxx>
#endif
+#ifndef _Standard_Integer_HeaderFile
+#include <Standard_Integer.hxx>
+#endif
#ifndef _GEOMAlgo_Builder_HeaderFile
#include <GEOMAlgo_Builder.hxx>
#endif
Standard_EXPORT TopAbs_ShapeEnum Limit() const;
+
+Standard_EXPORT void SetLimitMode(const Standard_Integer aLimitMode) ;
+
+
+Standard_EXPORT Standard_Integer LimitMode() const;
+
//! Adds Tool arguments of the operation as <br>
//! shapes of upper level of container shape theShape <br>
//! ===================================================== <br>
TopTools_ListOfShape myTools;
TopTools_MapOfShape myMapTools;
TopAbs_ShapeEnum myLimit;
+Standard_Integer myLimitMode;
private:
msgid "GEOM_RECONSTRUCTION_LIMIT"
msgstr "Reconstruction Limit"
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
msgid "GEOM_SUPPRESS_RESULT"
msgstr "Suppress Result"
msgid "GEOM_RECONSTRUCTION_LIMIT"
msgstr "Limite de Reconstruction"
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
msgid "GEOM_SUPPRESS_RESULT"
msgstr "Supprimer le Resultat"
msgid "GEOM_RECONSTRUCTION_LIMIT"
msgstr "Reconstruction Limit"
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
msgid "GEOM_SUPPRESS_RESULT"
msgstr "Suppress Result"
msgid "GEOM_RECONSTRUCTION_LIMIT"
msgstr "Limite de Reconstruction"
+msgid "GEOM_KEEP_NONLIMIT_SHAPES"
+msgstr "Keep nonlimit shapes"
+
msgid "GEOM_SUPPRESS_RESULT"
msgstr "Supprimer le Resultat"
const Standard_Integer theLimit,
const Standard_Boolean theRemoveWebs,
const Handle(TColStd_HArray1OfInteger)& theMaterials,
- const Standard_Boolean thePerformSelfIntersections)
+ const Standard_Integer theKeepNonlimitShapes,
+ const Standard_Boolean thePerformSelfIntersections)
{
SetErrorCode(KO);
// Limit
aCI.SetLimit(theLimit);
+ aCI.SetKeepNonlimitShapes(theKeepNonlimitShapes);
// Materials
if (theRemoveWebs) {
pd << ", " << theMaterials->Value(i);
}
}
- pd << "])";
+ pd << "], " << theKeepNonlimitShapes <<")";
SetErrorCode(OK);
return aPartition;
const Standard_Integer theLimit,
const Standard_Boolean theRemoveWebs,
const Handle(TColStd_HArray1OfInteger)& theMaterials,
- const Standard_Boolean thePerformSelfIntersections);
+ const Standard_Integer theKeepNonlimitShapes,
+ const Standard_Boolean thePerformSelfIntersections);
Standard_EXPORT Handle(GEOM_Object) MakeHalfPartition (Handle(GEOM_Object) theShape,
Handle(GEOM_Object) thePlane);
#define PART_ARG_SHAPE 7
#define PART_ARG_PLANE 8
+#define PART_ARG_KEEP_NONLIMIT_SHAPES 9
+
class GEOMImpl_IPartition
{
public:
void SetLimit(int theLimit) { _func->SetInteger(PART_ARG_LIMIT, theLimit); }
+ void SetKeepNonlimitShapes(int theKeepNonlimitShapes)
+ { _func->SetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES,theKeepNonlimitShapes ); }
+
void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
{ _func->SetReferenceList(PART_ARG_SHAPES, theShapes); }
int GetLimit() { return _func->GetInteger(PART_ARG_LIMIT); }
+ int GetKeepNonlimitShapes() { return _func->GetInteger(PART_ARG_KEEP_NONLIMIT_SHAPES); }
+
Handle(TColStd_HSequenceOfTransient) GetShapes() { return _func->GetReferenceList(PART_ARG_SHAPES); }
Handle(TColStd_HSequenceOfTransient) GetTools() { return _func->GetReferenceList(PART_ARG_TOOLS); }
Handle(TColStd_HSequenceOfTransient) GetKeepIns() { return _func->GetReferenceList(PART_ARG_KEEP_IN); }
}
}
+ PS.SetLimitMode(aCI.GetKeepNonlimitShapes());
PS.SetLimit( (TopAbs_ShapeEnum)aCI.GetLimit() );
PS.Perform();
const GEOM::ListOfGO& theRemoveIns,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- const GEOM::ListOfLong& theMaterials)
+ const GEOM::ListOfLong& theMaterials,
+ CORBA::Short theKeepNonlimitShapes)
{
GEOM::GEOM_Object_var aGEOMObject;
Handle(GEOM_Object) anObject =
GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
theLimit, theRemoveWebs, aMaterials,
+ theKeepNonlimitShapes,
/*PerformSelfIntersections*/Standard_True);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
const GEOM::ListOfGO& theRemoveIns,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- const GEOM::ListOfLong& theMaterials)
+ const GEOM::ListOfLong& theMaterials,
+ CORBA::Short theKeepNonlimitShapes)
{
GEOM::GEOM_Object_var aGEOMObject;
Handle(GEOM_Object) anObject =
GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
theLimit, theRemoveWebs, aMaterials,
+ theKeepNonlimitShapes,
/*PerformSelfIntersections*/Standard_False);
if (!GetOperations()->IsDone() || anObject.IsNull())
return aGEOMObject._retn();
const GEOM::ListOfGO& theRemoveInside,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- const GEOM::ListOfLong& theMaterials);
+ const GEOM::ListOfLong& theMaterials,
+ CORBA::Short theKeepNonlimitShapes);
GEOM::GEOM_Object_ptr MakePartitionNonSelfIntersectedShape (const GEOM::ListOfGO& theShapes,
const GEOM::ListOfGO& theTools,
const GEOM::ListOfGO& theRemoveInside,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- const GEOM::ListOfLong& theMaterials);
+ const GEOM::ListOfLong& theMaterials,
+ CORBA::Short theKeepNonlimitShapes);
GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
GEOM::GEOM_List_ptr theRemoveInside,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- GEOM::GEOM_List_ptr theMaterials)
+ GEOM::GEOM_List_ptr theMaterials,
+ CORBA::Short theKeepNonlimitShapes)
{
beginService( " GEOM_Superv_i::MakePartition" );
MESSAGE("GEOM_Superv_i::MakePartition");
dynamic_cast<GEOM_List_i<GEOM::ListOfLong>*>(GetServant(theMaterials, myPOA).in());
if (aListImplS && aListImplT && aListImplKI && aListImplRI && aListImplM) {
getBoolOp();
- GEOM::GEOM_Object_ptr anObj = myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(),
- aListImplKI->GetList(), aListImplRI->GetList(),
- theLimit, theRemoveWebs, aListImplM->GetList());
+ GEOM::GEOM_Object_ptr anObj =
+ myBoolOp->MakePartition(aListImplS->GetList(), aListImplT->GetList(),
+ aListImplKI->GetList(), aListImplRI->GetList(),
+ theLimit, theRemoveWebs, aListImplM->GetList(),
+ theKeepNonlimitShapes);
endService( " GEOM_Superv_i::MakePartition" );
return anObj;
}
GEOM::GEOM_List_ptr theRemoveInside,
CORBA::Short theLimit,
CORBA::Boolean theRemoveWebs,
- GEOM::GEOM_List_ptr theMaterials);
+ GEOM::GEOM_List_ptr theMaterials,
+ CORBA::Short theKeepNonlimitShapes);
GEOM::GEOM_Object_ptr MakeHalfPartition (GEOM::GEOM_Object_ptr theShape,
GEOM::GEOM_Object_ptr thePlane);
addToStudy(t_boite, "t_boite")
-p_element = geompy.MakePartition([t_boite], p_tools, [], [], 4, 0, [])
+p_element = geompy.MakePartition([t_boite], p_tools, [], [], 4, 0, [], 0)
# Compound
# --------
return MakeBoolean(s1, s2, 4)
def MakePartition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+ Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+ KeepNonlimitShapes=0):
anObj = BoolOp.MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
if BoolOp.IsDone() == 0:
print "MakePartition : ", BoolOp.GetErrorCode()
return anObj
def Partition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+ Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+ KeepNonlimitShapes=0):
anObj = MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
return anObj
def MakeHalfPartition(theShape, thePlane):
# in order to avoid possible intersection between shapes from
# this compound.
# @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
+# @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
+# type <= Limit are kept in the result,
+# else - shapes with type > Limit are kept
+# also (if they exist)
#
# After implementation new version of PartitionAlgo (October 2006)
# other parameters are ignored by current functionality. They are kept
#
# Example: see GEOM_TestAll.py
def MakePartition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+ Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+ KeepNonlimitShapes=0):
anObj = BoolOp.MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
if BoolOp.IsDone() == 0:
print "MakePartition : ", BoolOp.GetErrorCode()
return anObj
#
# @return New GEOM_Object, containing the result shapes.
#
-def MakePartitionNonSelfIntersectedShape(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+def MakePartitionNonSelfIntersectedShape(ListShapes, ListTools=[],
+ ListKeepInside=[], ListRemoveInside=[],
+ Limit=ShapeType["SHAPE"], RemoveWebs=0,
+ ListMaterials=[], KeepNonlimitShapes=0):
anObj = BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
if BoolOp.IsDone() == 0:
print "MakePartitionNonSelfIntersectedShape : ", BoolOp.GetErrorCode()
return anObj
#
# Example: see GEOM_TestOthers.py
def Partition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
- Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[]):
+ Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
+ KeepNonlimitShapes=0):
anObj = MakePartition(ListShapes, ListTools,
ListKeepInside, ListRemoveInside,
- Limit, RemoveWebs, ListMaterials);
+ Limit, RemoveWebs, ListMaterials,
+ KeepNonlimitShapes);
return anObj
## Perform partition of the Shape with the Plane
RadioButton3->close(TRUE);
// Full partition (contains half-space partition)
- GroupPoints = new DlgRef_2Sel1List_QTD(this, "GroupPoints");
+ GroupPoints = new DlgRef_2Sel1List1Check_QTD(this, "GroupPoints");
GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION"));
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
GroupPoints->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
GroupPoints->PushButton2->setPixmap(image2);
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
+ GroupPoints->radioButton4->setText(tr("GEOM_KEEP_NONLIMIT_SHAPES"));
Layout1->addWidget(GroupPoints, 2, 0);
/***************************************************************/
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_WIRE"));
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_EDGE"));
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_VERTEX"));
+ GroupPoints->radioButton4->setChecked(FALSE);
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
+ connect(GroupPoints->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
+
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
myListKeepInside.length(0);
myListRemoveInside.length(0);
myListMaterials.length(0);
-
+
switch (constructorId)
{
case 0: /*Full partition */
resize(0, 0);
GroupPoints->TextLabel3->show();
GroupPoints->ComboBox1->show();
-
GroupPoints->ComboBox1->setCurrentItem(0);
+ GroupPoints->radioButton4->show();
break;
}
case 1: /*Half-space partition */
GroupPoints->TextLabel3->hide();
GroupPoints->ComboBox1->hide();
GroupPoints->TextLabel2->setText(tr("GEOM_PLANE"));
+ GroupPoints->radioButton4->hide();
resize(0, 0);
break;
}
int aLimit = GetLimit();
int aConstructorId = getConstructorId();
- if (aConstructorId == 1)
+ int aKeepNonlimitShapes = 0;
+ if (aConstructorId == 1) {
aLimit = GEOM::SHAPE;
+ }
+ else {
+ if(GroupPoints->radioButton4->isChecked()) {
+ aKeepNonlimitShapes = 1;
+ }
+ else {
+ aKeepNonlimitShapes = 0;
+ }
+ }
if (isValid( msg )) {
anObj = GEOM::GEOM_IBooleanOperations::_narrow(getOperation())->
MakePartition(myListShapes, myListTools,
myListKeepInside, myListRemoveInside,
- aLimit, false, myListMaterials);
+ aLimit, false, myListMaterials, aKeepNonlimitShapes);
res = true;
}
#define DIALOGBOX_PARTITION_H
#include "GEOMBase_Skeleton.h"
-#include "DlgRef_2Sel1List_QTD.h"
+#include "DlgRef_2Sel1List1Check_QTD.h"
//=================================================================================
// class : OperationGUI_PartitionDlg
GEOM::ListOfGO myListRemoveInside;
GEOM::ListOfGO myListKeepInside;
- DlgRef_2Sel1List_QTD* GroupPoints;
+ DlgRef_2Sel1List1Check_QTD* GroupPoints;
private slots:
void ClickOnOk();