2004-01-07 20:46:21 +05:00
|
|
|
// GEOM GEOMGUI : GUI for Geometry component
|
|
|
|
//
|
|
|
|
// Copyright (C) 2003 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
|
|
|
|
//
|
2008-03-07 12:45:34 +05:00
|
|
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
2004-01-07 20:46:21 +05:00
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// File : OperationGUI_PartitionDlg.cxx
|
|
|
|
// Author : Lucien PIGNOLONI
|
|
|
|
// Module : GEOM
|
|
|
|
// $Header$
|
|
|
|
|
|
|
|
#include "OperationGUI_PartitionDlg.h"
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
#include "GEOMImpl_Types.hxx"
|
|
|
|
|
2005-06-02 13:17:09 +06:00
|
|
|
#include "SUIT_Desktop.h"
|
|
|
|
#include "SUIT_Session.h"
|
|
|
|
#include "SalomeApp_Application.h"
|
2005-11-03 13:30:14 +05:00
|
|
|
#include "LightApp_SelectionMgr.h"
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
#include <qcheckbox.h>
|
2005-06-02 13:17:09 +06:00
|
|
|
#include <qcombobox.h>
|
|
|
|
#include <qlabel.h>
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
#include "utilities.h"
|
2004-01-07 20:46:21 +05:00
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// class : OperationGUI_PartitionDlg()
|
|
|
|
// purpose : Constructs a OperationGUI_PartitionDlg which is a child of 'parent', with the
|
|
|
|
// name 'name' and widget flags set to 'f'.
|
|
|
|
// The dialog will by default be modeless, unless you set 'modal' to
|
|
|
|
// TRUE to construct a modal dialog.
|
|
|
|
//=================================================================================
|
2006-05-06 14:44:32 +06:00
|
|
|
OperationGUI_PartitionDlg::OperationGUI_PartitionDlg(GeometryGUI* theGeometryGUI, QWidget* parent)
|
|
|
|
:GEOMBase_Skeleton(theGeometryGUI, parent, "OperationGUI_PartitionDlg", false,
|
|
|
|
WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
|
2004-01-07 20:46:21 +05:00
|
|
|
{
|
2006-05-06 14:44:32 +06:00
|
|
|
SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
|
|
|
|
QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PARTITION")));
|
|
|
|
QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_PARTITION_PLANE")));
|
|
|
|
QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
|
2004-01-07 20:46:21 +05:00
|
|
|
|
|
|
|
setCaption(tr("GEOM_PARTITION_TITLE"));
|
|
|
|
|
|
|
|
/***************************************************************/
|
|
|
|
GroupConstructors->setTitle(tr("GEOM_PARTITION"));
|
|
|
|
RadioButton1->setPixmap(image0);
|
2004-12-01 15:39:14 +05:00
|
|
|
RadioButton2->setPixmap(image1);
|
2004-01-07 20:46:21 +05:00
|
|
|
RadioButton3->close(TRUE);
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
// Full partition (contains half-space partition)
|
2008-03-07 12:45:34 +05:00
|
|
|
GroupPoints = new DlgRef_2Sel1List1Check_QTD(this, "GroupPoints");
|
2004-01-07 20:46:21 +05:00
|
|
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION"));
|
|
|
|
GroupPoints->TextLabel1->setText(tr("GEOM_OBJECTS"));
|
|
|
|
GroupPoints->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
|
|
|
|
GroupPoints->TextLabel3->setText(tr("GEOM_RECONSTRUCTION_LIMIT"));
|
2004-12-01 15:39:14 +05:00
|
|
|
GroupPoints->PushButton1->setPixmap(image2);
|
|
|
|
GroupPoints->PushButton2->setPixmap(image2);
|
|
|
|
GroupPoints->LineEdit1->setReadOnly( true );
|
|
|
|
GroupPoints->LineEdit2->setReadOnly( true );
|
2008-03-07 12:45:34 +05:00
|
|
|
GroupPoints->radioButton4->setText(tr("GEOM_KEEP_NONLIMIT_SHAPES"));
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
Layout1->addWidget(GroupPoints, 2, 0);
|
2004-01-07 20:46:21 +05:00
|
|
|
/***************************************************************/
|
2006-05-06 14:44:32 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
setHelpFileName("partition_page.html");
|
|
|
|
|
2004-01-07 20:46:21 +05:00
|
|
|
Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : ~OperationGUI_PartitionDlg()
|
|
|
|
// purpose : Destroys the object and frees any allocated resources
|
|
|
|
//=================================================================================
|
|
|
|
OperationGUI_PartitionDlg::~OperationGUI_PartitionDlg()
|
|
|
|
{
|
|
|
|
// no need to delete child widgets, Qt does it all for us
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : Init()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void OperationGUI_PartitionDlg::Init()
|
|
|
|
{
|
|
|
|
/* type for sub shape selection */
|
|
|
|
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_SOLID"));
|
|
|
|
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_SHELL"));
|
|
|
|
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_FACE"));
|
|
|
|
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_WIRE"));
|
|
|
|
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_EDGE"));
|
|
|
|
GroupPoints->ComboBox1->insertItem(tr("GEOM_RECONSTRUCTION_LIMIT_VERTEX"));
|
2008-03-07 12:45:34 +05:00
|
|
|
GroupPoints->radioButton4->setChecked(FALSE);
|
|
|
|
|
2004-01-07 20:46:21 +05:00
|
|
|
/* signals and slots connections */
|
|
|
|
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
|
|
|
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
2004-12-01 15:39:14 +05:00
|
|
|
connect(GroupConstructors, SIGNAL(clicked(int)), this, SLOT(ConstructorsClicked(int)));
|
|
|
|
|
2004-01-07 20:46:21 +05:00
|
|
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
|
|
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2004-01-07 20:46:21 +05:00
|
|
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
|
|
|
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2004-01-07 20:46:21 +05:00
|
|
|
connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
|
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
connect(GroupPoints->radioButton4, SIGNAL(stateChanged(int)), this, SLOT(ReverseSense(int)));
|
|
|
|
|
|
|
|
connect(myGeomGUI->getApp()->selectionMgr(),
|
2005-06-02 13:17:09 +06:00
|
|
|
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
initName( tr( "GEOM_PARTITION" ) );
|
|
|
|
ConstructorsClicked( 0 );
|
|
|
|
}
|
2004-01-07 20:46:21 +05:00
|
|
|
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
//=================================================================================
|
|
|
|
// function : ConstructorsClicked()
|
|
|
|
// purpose : Radio button management
|
|
|
|
//=================================================================================
|
|
|
|
void OperationGUI_PartitionDlg::ConstructorsClicked(int constructorId)
|
|
|
|
{
|
2006-05-06 14:44:32 +06:00
|
|
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
2004-12-01 15:39:14 +05:00
|
|
|
globalSelection();
|
|
|
|
|
|
|
|
myListShapes.length(0);
|
2008-03-07 12:45:34 +05:00
|
|
|
myListTools.length(0);
|
2004-12-01 15:39:14 +05:00
|
|
|
myListKeepInside.length(0);
|
|
|
|
myListRemoveInside.length(0);
|
|
|
|
myListMaterials.length(0);
|
2008-03-07 12:45:34 +05:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
switch (constructorId)
|
|
|
|
{
|
|
|
|
case 0: /*Full partition */
|
|
|
|
{
|
|
|
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION"));
|
|
|
|
GroupPoints->TextLabel2->setText(tr("GEOM_TOOL_OBJECT"));
|
|
|
|
resize(0, 0);
|
|
|
|
GroupPoints->TextLabel3->show();
|
|
|
|
GroupPoints->ComboBox1->show();
|
|
|
|
GroupPoints->ComboBox1->setCurrentItem(0);
|
2008-03-07 12:45:34 +05:00
|
|
|
GroupPoints->radioButton4->show();
|
2004-12-01 15:39:14 +05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1: /*Half-space partition */
|
|
|
|
{
|
|
|
|
|
|
|
|
GroupPoints->GroupBox1->setTitle(tr("GEOM_PARTITION_HALFSPACE"));
|
|
|
|
GroupPoints->TextLabel3->hide();
|
|
|
|
GroupPoints->ComboBox1->hide();
|
|
|
|
GroupPoints->TextLabel2->setText(tr("GEOM_PLANE"));
|
2008-03-07 12:45:34 +05:00
|
|
|
GroupPoints->radioButton4->hide();
|
2004-12-01 15:39:14 +05:00
|
|
|
resize(0, 0);
|
|
|
|
break;
|
2008-03-07 12:45:34 +05:00
|
|
|
}
|
2004-12-01 15:39:14 +05:00
|
|
|
}
|
2006-05-06 14:44:32 +06:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
|
|
|
GroupPoints->LineEdit1->clear();
|
|
|
|
GroupPoints->LineEdit2->clear();
|
|
|
|
|
|
|
|
myEditCurrentArgument->setFocus();
|
2008-03-07 12:45:34 +05:00
|
|
|
connect(myGeomGUI->getApp()->selectionMgr(),
|
2005-06-02 13:17:09 +06:00
|
|
|
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
2004-12-01 15:39:14 +05:00
|
|
|
MESSAGE(width()<<" "<<height());
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : ClickOnOk()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void OperationGUI_PartitionDlg::ClickOnOk()
|
|
|
|
{
|
2004-12-01 15:39:14 +05:00
|
|
|
if ( ClickOnApply() )
|
|
|
|
ClickOnCancel();
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : ClickOnApply()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
2004-12-01 15:39:14 +05:00
|
|
|
bool OperationGUI_PartitionDlg::ClickOnApply()
|
2004-01-07 20:46:21 +05:00
|
|
|
{
|
2004-12-01 15:39:14 +05:00
|
|
|
if ( !onAccept() )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
initName();
|
|
|
|
ConstructorsClicked( getConstructorId() );
|
|
|
|
return true;
|
|
|
|
}
|
2004-01-07 20:46:21 +05:00
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : SelectionIntoArgument()
|
|
|
|
// purpose : Called when selection as changed or other case
|
|
|
|
//=================================================================================
|
|
|
|
void OperationGUI_PartitionDlg::SelectionIntoArgument()
|
|
|
|
{
|
2004-12-01 15:39:14 +05:00
|
|
|
myEditCurrentArgument->setText( "" );
|
|
|
|
QString aString = "";
|
|
|
|
|
2005-06-02 13:17:09 +06:00
|
|
|
int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
|
2008-03-07 12:45:34 +05:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
if ( nbSel < 1 )
|
|
|
|
{
|
|
|
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
|
|
|
{
|
|
|
|
myListShapes.length( 0 );
|
|
|
|
myListMaterials.length( 0 );
|
2004-01-28 19:08:37 +05:00
|
|
|
}
|
2004-12-01 15:39:14 +05:00
|
|
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
|
|
|
myListTools.length( 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
// One and only one plane can be selected
|
|
|
|
|
|
|
|
if ( getConstructorId() == 1 && myEditCurrentArgument == GroupPoints->LineEdit2 && nbSel != 1 )
|
|
|
|
{
|
|
|
|
myListTools.length( 0 );
|
2004-01-07 20:46:21 +05:00
|
|
|
return;
|
|
|
|
}
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
|
|
|
{
|
2005-06-02 13:17:09 +06:00
|
|
|
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myListShapes, true );
|
2004-12-01 15:39:14 +05:00
|
|
|
myListMaterials.length( 0 );
|
|
|
|
if ( !myListShapes.length() )
|
|
|
|
return;
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|
2004-12-01 15:39:14 +05:00
|
|
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
|
|
|
{
|
2005-06-02 13:17:09 +06:00
|
|
|
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myListTools, true );
|
2004-12-01 15:39:14 +05:00
|
|
|
if ( !myListTools.length() )
|
|
|
|
return;
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
myEditCurrentArgument->setText( aString );
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : SetEditCurrentArgument()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void OperationGUI_PartitionDlg::SetEditCurrentArgument()
|
|
|
|
{
|
|
|
|
QPushButton* send = (QPushButton*)sender();
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
if(send == GroupPoints->PushButton1)
|
2004-01-07 20:46:21 +05:00
|
|
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
2004-12-01 15:39:14 +05:00
|
|
|
else if(send == GroupPoints->PushButton2)
|
|
|
|
{
|
2004-01-07 20:46:21 +05:00
|
|
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
2004-12-01 15:39:14 +05:00
|
|
|
if( getConstructorId()==1 )
|
|
|
|
globalSelection( GEOM_PLANE );
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|
2004-12-01 15:39:14 +05:00
|
|
|
|
|
|
|
globalSelection( GEOM_ALLSHAPES );
|
2008-03-07 12:45:34 +05:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
myEditCurrentArgument->setFocus();
|
|
|
|
SelectionIntoArgument();
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : LineEditReturnPressed()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void OperationGUI_PartitionDlg::LineEditReturnPressed()
|
|
|
|
{
|
|
|
|
QLineEdit* send = (QLineEdit*)sender();
|
2006-05-06 14:44:32 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
if(send == GroupPoints->LineEdit1 ||
|
|
|
|
send == GroupPoints->LineEdit2 )
|
2004-12-01 15:39:14 +05:00
|
|
|
{
|
|
|
|
myEditCurrentArgument = send;
|
|
|
|
GEOMBase_Skeleton::LineEditReturnPressed();
|
|
|
|
}
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : ActivateThisDialog()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void OperationGUI_PartitionDlg::ActivateThisDialog()
|
|
|
|
{
|
|
|
|
GEOMBase_Skeleton::ActivateThisDialog();
|
2008-03-07 12:45:34 +05:00
|
|
|
connect(myGeomGUI->getApp()->selectionMgr(),
|
2005-06-02 13:17:09 +06:00
|
|
|
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
|
2004-12-01 15:39:14 +05:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
ConstructorsClicked( getConstructorId() );
|
2004-12-01 15:39:14 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-01-07 20:46:21 +05:00
|
|
|
//=================================================================================
|
|
|
|
// function : enterEvent()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void OperationGUI_PartitionDlg::enterEvent(QEvent* e)
|
|
|
|
{
|
2006-05-06 14:44:32 +06:00
|
|
|
if (!GroupConstructors->isEnabled())
|
2004-12-01 15:39:14 +05:00
|
|
|
this->ActivateThisDialog();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : createOperation
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
GEOM::GEOM_IOperations_ptr OperationGUI_PartitionDlg::createOperation()
|
|
|
|
{
|
|
|
|
return getGeomEngine()->GetIBooleanOperations( getStudyId() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : isValid
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
bool OperationGUI_PartitionDlg::isValid( QString& msg )
|
|
|
|
{
|
2006-05-06 14:44:32 +06:00
|
|
|
return (myListShapes.length() || myListTools.length() ||
|
|
|
|
myListKeepInside.length() || myListRemoveInside.length());
|
2004-12-01 15:39:14 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : execute
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
bool OperationGUI_PartitionDlg::execute( ObjectList& objects )
|
|
|
|
{
|
|
|
|
bool res = false;
|
2006-05-06 14:44:32 +06:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
GEOM::GEOM_Object_var anObj;
|
|
|
|
QString msg;
|
2006-05-06 14:44:32 +06:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
int aLimit = GetLimit();
|
|
|
|
int aConstructorId = getConstructorId();
|
2006-05-06 14:44:32 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
int aKeepNonlimitShapes = 0;
|
|
|
|
if (aConstructorId == 1) {
|
2004-12-01 15:39:14 +05:00
|
|
|
aLimit = GEOM::SHAPE;
|
2008-03-07 12:45:34 +05:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
if(GroupPoints->radioButton4->isChecked()) {
|
|
|
|
aKeepNonlimitShapes = 1;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
aKeepNonlimitShapes = 0;
|
|
|
|
}
|
|
|
|
}
|
2006-05-06 14:44:32 +06:00
|
|
|
|
|
|
|
if (isValid( msg )) {
|
|
|
|
|
|
|
|
anObj = GEOM::GEOM_IBooleanOperations::_narrow(getOperation())->
|
|
|
|
MakePartition(myListShapes, myListTools,
|
|
|
|
myListKeepInside, myListRemoveInside,
|
2008-03-07 12:45:34 +05:00
|
|
|
aLimit, false, myListMaterials, aKeepNonlimitShapes);
|
2006-05-06 14:44:32 +06:00
|
|
|
res = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!anObj->_is_nil())
|
2004-12-01 15:39:14 +05:00
|
|
|
objects.push_back( anObj._retn() );
|
2006-05-06 14:44:32 +06:00
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : closeEvent
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
void OperationGUI_PartitionDlg::closeEvent( QCloseEvent* e )
|
|
|
|
{
|
|
|
|
GEOMBase_Skeleton::closeEvent( e );
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=======================================================================
|
|
|
|
//function : ComboTextChanged
|
|
|
|
//purpose :
|
|
|
|
//=======================================================================
|
|
|
|
void OperationGUI_PartitionDlg::ComboTextChanged()
|
|
|
|
{
|
2004-12-01 15:39:14 +05:00
|
|
|
bool IsEnabled = GroupPoints->ComboBox1->currentItem() < 3;
|
2008-03-07 12:45:34 +05:00
|
|
|
//GroupPoints->LineEdit3->setEnabled(IsEnabled);
|
|
|
|
//GroupPoints->LineEdit4->setEnabled(IsEnabled);
|
|
|
|
//GroupPoints->TextLabel4->setEnabled(IsEnabled);
|
|
|
|
//GroupPoints->TextLabel5->setEnabled(IsEnabled);
|
|
|
|
//GroupPoints->PushButton3->setEnabled(IsEnabled);
|
|
|
|
//GroupPoints->PushButton4->setEnabled(IsEnabled);
|
2004-12-01 15:39:14 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//=================================================================================
|
|
|
|
// function : GetLimit()
|
|
|
|
// purpose :
|
|
|
|
//=================================================================================
|
|
|
|
int OperationGUI_PartitionDlg::GetLimit() const
|
|
|
|
{
|
|
|
|
int aLimit = GroupPoints->ComboBox1->currentItem();
|
2006-05-06 14:44:32 +06:00
|
|
|
|
2008-03-07 12:45:34 +05:00
|
|
|
switch (aLimit)
|
2006-05-06 14:44:32 +06:00
|
|
|
{
|
|
|
|
case 0: aLimit = GEOM::SOLID ; break;
|
|
|
|
case 1: aLimit = GEOM::SHELL ; break;
|
|
|
|
case 2: aLimit = GEOM::FACE ; break;
|
|
|
|
case 3: aLimit = GEOM::WIRE ; break;
|
|
|
|
case 4: aLimit = GEOM::EDGE ; break;
|
|
|
|
case 5: aLimit = GEOM::VERTEX; break;
|
|
|
|
default: aLimit = GEOM::SHAPE ;
|
|
|
|
}
|
|
|
|
|
2004-12-01 15:39:14 +05:00
|
|
|
return aLimit;
|
2004-01-07 20:46:21 +05:00
|
|
|
}
|