mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-03-26 07:07:55 +05:00
Changed for bug NPAL14892.
This commit is contained in:
parent
00de639737
commit
d9f6d20b81
@ -1690,6 +1690,10 @@ module GEOM
|
||||
* \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
|
||||
@ -1710,7 +1714,8 @@ module GEOM
|
||||
in ListOfGO theRemoveInside,
|
||||
in short theLimit,
|
||||
in boolean theRemoveWebs,
|
||||
in ListOfLong theMaterials);
|
||||
in ListOfLong theMaterials,
|
||||
in short theKeepNonlimitShapes);
|
||||
|
||||
/*!
|
||||
* Perform partition operation.
|
||||
@ -1731,7 +1736,8 @@ module GEOM
|
||||
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
|
||||
|
@ -198,7 +198,8 @@ module GEOM
|
||||
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) ;
|
||||
|
||||
|
130
src/DlgRef/DlgRef_2Sel1List1Check_QTD.cxx
Normal file
130
src/DlgRef/DlgRef_2Sel1List1Check_QTD.cxx
Normal file
@ -0,0 +1,130 @@
|
||||
// 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
|
||||
}
|
||||
|
69
src/DlgRef/DlgRef_2Sel1List1Check_QTD.h
Normal file
69
src/DlgRef/DlgRef_2Sel1List1Check_QTD.h
Normal file
@ -0,0 +1,69 @@
|
||||
// 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
|
@ -59,6 +59,7 @@ LIB_SRC = DlgRef_Skeleton_QTD.cxx \
|
||||
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 \
|
||||
@ -115,6 +116,7 @@ LIB_MOC = \
|
||||
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 \
|
||||
|
@ -63,6 +63,13 @@ is
|
||||
|
||||
Limit(me)
|
||||
returns ShapeEnum from TopAbs;
|
||||
|
||||
SetLimitMode(me:out;
|
||||
aLimitMode:Integer from Standard);
|
||||
|
||||
LimitMode(me)
|
||||
returns Integer from Standard;
|
||||
|
||||
--
|
||||
-- Protected methods
|
||||
--
|
||||
@ -89,5 +96,7 @@ fields
|
||||
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;
|
||||
|
||||
|
@ -44,6 +44,10 @@
|
||||
|
||||
#include <NMTTools_DSFiller.hxx>
|
||||
|
||||
static
|
||||
void TreatCompound(const TopoDS_Shape& aC,
|
||||
TopTools_ListOfShape& aLSX);
|
||||
|
||||
//=======================================================================
|
||||
//function :
|
||||
//purpose :
|
||||
@ -53,6 +57,7 @@
|
||||
GEOMAlgo_Builder()
|
||||
{
|
||||
myLimit=TopAbs_SHAPE;
|
||||
myLimitMode=0;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : ~
|
||||
@ -112,6 +117,22 @@
|
||||
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 :
|
||||
//=======================================================================
|
||||
@ -168,21 +189,131 @@
|
||||
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
|
||||
|
@ -29,6 +29,9 @@
|
||||
#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
|
||||
@ -82,6 +85,12 @@ Standard_EXPORT void SetLimit(const TopAbs_ShapeEnum aLimit) ;
|
||||
|
||||
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>
|
||||
@ -108,6 +117,7 @@ Standard_EXPORT virtual void PostTreat() ;
|
||||
TopTools_ListOfShape myTools;
|
||||
TopTools_MapOfShape myMapTools;
|
||||
TopAbs_ShapeEnum myLimit;
|
||||
Standard_Integer myLimitMode;
|
||||
|
||||
|
||||
private:
|
||||
|
@ -1189,6 +1189,9 @@ msgstr "\nShading"
|
||||
msgid "GEOM_RECONSTRUCTION_LIMIT"
|
||||
msgstr "Reconstruction Limit"
|
||||
|
||||
msgid "GEOM_KEEP_NONLIMIT_SHAPES"
|
||||
msgstr "Keep nonlimit shapes"
|
||||
|
||||
msgid "GEOM_SUPPRESS_RESULT"
|
||||
msgstr "Suppress Result"
|
||||
|
||||
|
@ -1190,6 +1190,9 @@ msgstr "Ombré"
|
||||
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"
|
||||
|
||||
|
@ -1312,6 +1312,9 @@ msgstr "\nShading"
|
||||
msgid "GEOM_RECONSTRUCTION_LIMIT"
|
||||
msgstr "Reconstruction Limit"
|
||||
|
||||
msgid "GEOM_KEEP_NONLIMIT_SHAPES"
|
||||
msgstr "Keep nonlimit shapes"
|
||||
|
||||
msgid "GEOM_SUPPRESS_RESULT"
|
||||
msgstr "Suppress Result"
|
||||
|
||||
|
@ -1238,6 +1238,9 @@ msgstr "Ombré"
|
||||
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"
|
||||
|
||||
|
@ -148,7 +148,8 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
|
||||
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);
|
||||
|
||||
@ -251,6 +252,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
|
||||
|
||||
// Limit
|
||||
aCI.SetLimit(theLimit);
|
||||
aCI.SetKeepNonlimitShapes(theKeepNonlimitShapes);
|
||||
|
||||
// Materials
|
||||
if (theRemoveWebs) {
|
||||
@ -302,7 +304,7 @@ Handle(GEOM_Object) GEOMImpl_IBooleanOperations::MakePartition
|
||||
pd << ", " << theMaterials->Value(i);
|
||||
}
|
||||
}
|
||||
pd << "])";
|
||||
pd << "], " << theKeepNonlimitShapes <<")";
|
||||
|
||||
SetErrorCode(OK);
|
||||
return aPartition;
|
||||
|
@ -46,7 +46,8 @@ class GEOMImpl_IBooleanOperations : public GEOM_IOperations {
|
||||
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);
|
||||
|
@ -36,6 +36,8 @@
|
||||
#define PART_ARG_SHAPE 7
|
||||
#define PART_ARG_PLANE 8
|
||||
|
||||
#define PART_ARG_KEEP_NONLIMIT_SHAPES 9
|
||||
|
||||
class GEOMImpl_IPartition
|
||||
{
|
||||
public:
|
||||
@ -44,6 +46,9 @@ class GEOMImpl_IPartition
|
||||
|
||||
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); }
|
||||
|
||||
@ -62,6 +67,8 @@ class GEOMImpl_IPartition
|
||||
|
||||
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); }
|
||||
|
@ -206,6 +206,7 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
|
||||
}
|
||||
}
|
||||
|
||||
PS.SetLimitMode(aCI.GetKeepNonlimitShapes());
|
||||
PS.SetLimit( (TopAbs_ShapeEnum)aCI.GetLimit() );
|
||||
PS.Perform();
|
||||
|
||||
|
@ -99,7 +99,8 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
|
||||
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;
|
||||
|
||||
@ -166,6 +167,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartition
|
||||
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();
|
||||
@ -185,7 +187,8 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
|
||||
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;
|
||||
|
||||
@ -252,6 +255,7 @@ GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersected
|
||||
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();
|
||||
|
@ -49,7 +49,8 @@ class GEOM_IBooleanOperations_i :
|
||||
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,
|
||||
@ -57,7 +58,8 @@ class GEOM_IBooleanOperations_i :
|
||||
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,
|
||||
|
@ -1040,7 +1040,8 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr theSha
|
||||
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");
|
||||
@ -1056,9 +1057,11 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePartition (GEOM::GEOM_List_ptr theSha
|
||||
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;
|
||||
}
|
||||
|
@ -258,7 +258,8 @@ public:
|
||||
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);
|
||||
|
||||
|
@ -97,7 +97,7 @@ p_tools.append(geompy.MakePlane(geompy.MakeVertex(gx+g_rayonPetit, 0, 0), geompy
|
||||
|
||||
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
|
||||
# --------
|
||||
|
@ -699,19 +699,23 @@ def MakeSection(s1, s2):
|
||||
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):
|
||||
|
@ -1468,6 +1468,10 @@ def MakeSection(s1, s2):
|
||||
# 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
|
||||
@ -1485,10 +1489,12 @@ def MakeSection(s1, s2):
|
||||
#
|
||||
# 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
|
||||
@ -1505,11 +1511,14 @@ def MakePartition(ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=
|
||||
#
|
||||
# @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
|
||||
@ -1518,10 +1527,12 @@ def MakePartitionNonSelfIntersectedShape(ListShapes, ListTools=[], ListKeepInsid
|
||||
#
|
||||
# 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
|
||||
|
@ -67,7 +67,7 @@ OperationGUI_PartitionDlg::OperationGUI_PartitionDlg(GeometryGUI* theGeometryGUI
|
||||
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"));
|
||||
@ -76,6 +76,7 @@ OperationGUI_PartitionDlg::OperationGUI_PartitionDlg(GeometryGUI* theGeometryGUI
|
||||
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);
|
||||
/***************************************************************/
|
||||
@ -109,6 +110,7 @@ void OperationGUI_PartitionDlg::Init()
|
||||
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()));
|
||||
@ -123,6 +125,8 @@ void OperationGUI_PartitionDlg::Init()
|
||||
|
||||
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()));
|
||||
|
||||
@ -145,7 +149,7 @@ void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId)
|
||||
myListKeepInside.length(0);
|
||||
myListRemoveInside.length(0);
|
||||
myListMaterials.length(0);
|
||||
|
||||
|
||||
switch (constructorId)
|
||||
{
|
||||
case 0: /*Full partition */
|
||||
@ -155,8 +159,8 @@ void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId)
|
||||
resize(0, 0);
|
||||
GroupPoints->TextLabel3->show();
|
||||
GroupPoints->ComboBox1->show();
|
||||
|
||||
GroupPoints->ComboBox1->setCurrentItem(0);
|
||||
GroupPoints->radioButton4->show();
|
||||
break;
|
||||
}
|
||||
case 1: /*Half-space partition */
|
||||
@ -166,6 +170,7 @@ void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId)
|
||||
GroupPoints->TextLabel3->hide();
|
||||
GroupPoints->ComboBox1->hide();
|
||||
GroupPoints->TextLabel2->setText(tr("GEOM_PLANE"));
|
||||
GroupPoints->radioButton4->hide();
|
||||
resize(0, 0);
|
||||
break;
|
||||
}
|
||||
@ -357,15 +362,25 @@ bool OperationGUI_PartitionDlg::execute( ObjectList& objects )
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
#define DIALOGBOX_PARTITION_H
|
||||
|
||||
#include "GEOMBase_Skeleton.h"
|
||||
#include "DlgRef_2Sel1List_QTD.h"
|
||||
#include "DlgRef_2Sel1List1Check_QTD.h"
|
||||
|
||||
//=================================================================================
|
||||
// class : OperationGUI_PartitionDlg
|
||||
@ -68,7 +68,7 @@ private:
|
||||
GEOM::ListOfGO myListRemoveInside;
|
||||
GEOM::ListOfGO myListKeepInside;
|
||||
|
||||
DlgRef_2Sel1List_QTD* GroupPoints;
|
||||
DlgRef_2Sel1List1Check_QTD* GroupPoints;
|
||||
|
||||
private slots:
|
||||
void ClickOnOk();
|
||||
|
Loading…
x
Reference in New Issue
Block a user