geom/src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx

528 lines
18 KiB
C++
Raw Normal View History

2022-05-05 17:01:14 +05:00
// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
2004-12-01 15:39:14 +05:00
//
2012-08-09 13:58:02 +06:00
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
2004-12-01 15:39:14 +05:00
//
2012-08-09 13:58:02 +06:00
// 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
2014-02-18 12:44:41 +06:00
// version 2.1 of the License, or (at your option) any later version.
2004-12-01 15:39:14 +05:00
//
2012-08-09 13:58:02 +06:00
// 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.
2004-12-01 15:39:14 +05:00
//
2012-08-09 13:58:02 +06:00
// 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
2004-12-01 15:39:14 +05:00
//
2012-08-09 13:58:02 +06:00
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
2004-12-01 15:39:14 +05:00
//
2012-08-09 13:58:02 +06:00
2009-02-13 17:16:39 +05:00
// GEOM GEOMGUI : GUI for Geometry component
// File : BlocksGUI_ExplodeDlg.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S. (julia.dorovskikh@opencascade.com)
2004-12-01 15:39:14 +05:00
//
#include "BlocksGUI_ExplodeDlg.h"
2009-02-13 17:16:39 +05:00
#include <DlgRef.h>
#include <GeometryGUI.h>
#include <GEOMBase.h>
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
#include <SUIT_Session.h>
#include <SUIT_Desktop.h>
#include <SUIT_ResourceMgr.h>
#include <SUIT_ViewWindow.h>
#include <SUIT_ViewManager.h>
#include <SUIT_MessageBox.h>
#include <SalomeApp_Application.h>
#include <LightApp_SelectionMgr.h>
#include <OCCViewer_ViewModel.h>
#include <SALOME_ListIO.hxx>
2004-12-01 15:39:14 +05:00
//=================================================================================
// class : BlocksGUI_ExplodeDlg()
// purpose : Constructs a BlocksGUI_ExplodeDlg which is a child of 'parent'.
//=================================================================================
2009-02-13 17:16:39 +05:00
BlocksGUI_ExplodeDlg::BlocksGUI_ExplodeDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
: GEOMBase_Skeleton( theGeometryGUI, parent ), myNbBlocks( 0 )
2004-12-01 15:39:14 +05:00
{
2009-02-13 17:16:39 +05:00
QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BLOCK_EXPLODE" ) ) );
QPixmap imageS( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
setWindowTitle( tr( "GEOM_BLOCK_EXPLODE_TITLE" ) );
2004-12-01 15:39:14 +05:00
/***************************************************************/
2009-02-13 17:16:39 +05:00
mainFrame()->GroupConstructors->setTitle( tr( "GEOM_BLOCK_EXPLODE" ) );
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
mainFrame()->RadioButton1->setIcon( image1 );
mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton2->close();
mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
mainFrame()->RadioButton3->close();
2004-12-01 15:39:14 +05:00
// Create first group
2009-02-13 17:16:39 +05:00
myGrp1 = new DlgRef_1Sel2Spin1View1Check( centralWidget() );
myGrp1->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
myGrp1->TextLabel1->setText( tr( "GEOM_MAIN_OBJECT" ) );
myGrp1->PushButton1->setIcon( imageS );
myGrp1->LineEdit1->setReadOnly( true );
myGrp1->TextLabel2->setText( tr( "NB_FACES_MIN" ) );
myGrp1->TextLabel3->setText( tr( "NB_FACES_MAX" ) );
myGrp1->CheckBox1->setText( tr( "GEOM_SUBSHAPE_SELECT" ) );
2004-12-01 15:39:14 +05:00
// Add groups to layout
2009-02-13 17:16:39 +05:00
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( myGrp1 );
2004-12-01 15:39:14 +05:00
/***************************************************************/
2009-02-13 17:16:39 +05:00
setHelpFileName( "explode_on_blocks_operation_page.html" );
2004-12-01 15:39:14 +05:00
Init();
}
//=================================================================================
// function : ~BlocksGUI_ExplodeDlg()
// purpose : Destroys the object and frees any allocated resources
//=================================================================================
BlocksGUI_ExplodeDlg::~BlocksGUI_ExplodeDlg()
{
// no need to delete child widgets, Qt does it all for us
clearTemporary();
}
//=================================================================================
// function : Init()
// purpose :
//=================================================================================
void BlocksGUI_ExplodeDlg::Init()
{
2009-02-13 17:16:39 +05:00
mainFrame()->GroupBoxName->hide();
2004-12-01 15:39:14 +05:00
// Set range of spinboxes
2009-02-13 17:16:39 +05:00
int SpecificStep = 1;
initSpinBox( myGrp1->SpinBox1, 0, 999, SpecificStep );
initSpinBox( myGrp1->SpinBox2, 0, 999, SpecificStep );
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
if ( SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
!= OCCViewer_Viewer::Type() )
myGrp1->CheckBox1->setEnabled( false );
2004-12-01 15:39:14 +05:00
// signals and slots connections
2009-02-13 17:16:39 +05:00
connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
connect( myGrp1->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
connect( myGrp1->SpinBox1, SIGNAL( valueChanged( int ) ), this, SLOT( ValueChangedInSpinBox( int ) ) );
connect( myGrp1->SpinBox2, SIGNAL( valueChanged( int ) ), this, SLOT( ValueChangedInSpinBox( int ) ) );
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
connect( myGrp1->CheckBox1, SIGNAL( stateChanged( int ) ), this, SLOT( SubShapeToggled() ) );
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
2012-08-09 13:58:02 +06:00
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
2004-12-01 15:39:14 +05:00
myConstructorId = -1;
2009-02-13 17:16:39 +05:00
ConstructorsClicked( 0 );
2004-12-01 15:39:14 +05:00
}
//=================================================================================
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
2009-02-13 17:16:39 +05:00
void BlocksGUI_ExplodeDlg::ConstructorsClicked( int constructorId )
2004-12-01 15:39:14 +05:00
{
2009-02-13 17:16:39 +05:00
if ( myConstructorId == constructorId )
2004-12-01 15:39:14 +05:00
return;
myConstructorId = constructorId;
2009-02-13 17:16:39 +05:00
switch ( constructorId ) {
2004-12-01 15:39:14 +05:00
case 0:
myGrp1->show();
2009-02-13 17:16:39 +05:00
myGrp1->SpinBox1->setValue( 6 );
myGrp1->SpinBox2->setValue( 6 );
myGrp1->CheckBox1->setChecked( false );
2004-12-01 15:39:14 +05:00
break;
default:
break;
}
// init fields
2009-02-13 17:16:39 +05:00
myEditCurrentArgument = myGrp1->LineEdit1;
2004-12-01 15:39:14 +05:00
myObject = GEOM::GEOM_Object::_nil();
activateSelection();
}
//=================================================================================
// function : ClickOnOk()
// purpose :
//=================================================================================
void BlocksGUI_ExplodeDlg::ClickOnOk()
{
2012-08-09 13:58:02 +06:00
setIsApplyAndClose( true );
2009-02-13 17:16:39 +05:00
if ( ClickOnApply() )
2004-12-01 15:39:14 +05:00
ClickOnCancel();
}
//=================================================================================
// function : ClickOnApply()
// purpose :
//=================================================================================
bool BlocksGUI_ExplodeDlg::ClickOnApply()
{
2009-02-13 17:16:39 +05:00
SUIT_Session::session()->activeApplication()->putInfo( tr( "" ) );
2004-12-01 15:39:14 +05:00
2012-08-09 13:58:02 +06:00
// Explode all sub-shapes
2009-02-13 17:16:39 +05:00
if ( isAllSubShapes() ) {
2012-08-09 13:58:02 +06:00
// More than 30 sub-shapes : ask confirmation
2009-02-13 17:16:39 +05:00
if ( myNbBlocks > 30 ) {
if ( SUIT_MessageBox::warning( this,
2012-08-09 13:58:02 +06:00
tr( "GEOM_CONFIRM" ),
tr( "GEOM_CONFIRM_INFO" ).arg( myNbBlocks ),
tr( "GEOM_BUT_EXPLODE" ),
tr( "GEOM_BUT_CANCEL" ) ) != 0 )
2004-12-01 15:39:14 +05:00
return false; /* aborted */
}
}
if ( !onAccept( true, true, false ) )
2004-12-01 15:39:14 +05:00
return false;
activateSelection();
return true;
}
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection has changed
//=================================================================================
void BlocksGUI_ExplodeDlg::SelectionIntoArgument()
{
if (!isAllSubShapes())
return;
myObject = GEOM::GEOM_Object::_nil();
2009-02-13 17:16:39 +05:00
myGrp1->LineEdit1->setText("");
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
if (aSelList.Extent() == 1) {
2012-08-09 13:58:02 +06:00
GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
2004-12-01 15:39:14 +05:00
2012-08-09 13:58:02 +06:00
if ( GEOMBase::IsShape(anObj) ) {
2004-12-01 15:39:14 +05:00
myObject = anObj;
2009-02-13 17:16:39 +05:00
myGrp1->LineEdit1->setText(GEOMBase::GetName(anObj));
2004-12-01 15:39:14 +05:00
}
}
updateButtonState();
}
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
//=================================================================================
void BlocksGUI_ExplodeDlg::SetEditCurrentArgument()
{
QPushButton* aSender = (QPushButton*)sender();
2009-02-13 17:16:39 +05:00
if ( myGrp1->PushButton1 == aSender ) {
myGrp1->LineEdit1->setFocus();
myEditCurrentArgument = myGrp1->LineEdit1;
myGrp1->CheckBox1->setChecked( false );
2004-12-01 15:39:14 +05:00
}
activateSelection();
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
//=================================================================================
void BlocksGUI_ExplodeDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
2009-02-13 17:16:39 +05:00
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
2012-08-09 13:58:02 +06:00
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
2004-12-01 15:39:14 +05:00
activateSelection();
}
//=================================================================================
// function : enterEvent()
// purpose :
//=================================================================================
2009-02-13 17:16:39 +05:00
void BlocksGUI_ExplodeDlg::enterEvent( QEvent* )
2004-12-01 15:39:14 +05:00
{
2009-02-13 17:16:39 +05:00
if ( !mainFrame()->GroupConstructors->isEnabled() )
2004-12-01 15:39:14 +05:00
this->ActivateThisDialog();
}
//=================================================================================
// function : ValueChangedInSpinBox()
// purpose :
//=================================================================================
2009-02-13 17:16:39 +05:00
void BlocksGUI_ExplodeDlg::ValueChangedInSpinBox()
2004-12-01 15:39:14 +05:00
{
2009-02-13 17:16:39 +05:00
if ( !isAllSubShapes() )
2004-12-01 15:39:14 +05:00
activateSelection();
else
updateButtonState();
}
//=================================================================================
// function : SubShapeToggled()
2012-08-09 13:58:02 +06:00
// purpose : Allow user selection of all or only selected sub-shapes
2009-02-13 17:16:39 +05:00
// : Called when 'myGrp1->CheckBox1' state change
2004-12-01 15:39:14 +05:00
//=================================================================================
void BlocksGUI_ExplodeDlg::SubShapeToggled()
{
activateSelection();
}
//=================================================================================
// function : activateSelection
// purpose : Redisplay preview and Activate selection
//=================================================================================
void BlocksGUI_ExplodeDlg::activateSelection()
{
clearTemporary();
2009-02-13 17:16:39 +05:00
erasePreview( true );
2004-12-01 15:39:14 +05:00
2009-02-13 17:16:39 +05:00
if ( isAllSubShapes() ) { // Sub-shapes selection disabled
disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
2012-08-09 13:58:02 +06:00
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
2004-12-01 15:39:14 +05:00
globalSelection( GEOM_ALLSHAPES );
2009-02-13 17:16:39 +05:00
if ( myObject->_is_nil() ) {
2004-12-17 16:18:33 +05:00
SelectionIntoArgument();
}
2009-02-13 17:16:39 +05:00
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
2012-08-09 13:58:02 +06:00
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
2009-02-13 17:16:39 +05:00
}
else {
2012-08-09 13:58:02 +06:00
displayPreview( true, true, true, false );
2009-02-13 17:16:39 +05:00
globalSelection( GEOM_PREVIEW );
2004-12-01 15:39:14 +05:00
}
}
//=================================================================================
// function : updateButtonState
// purpose :
//=================================================================================
void BlocksGUI_ExplodeDlg::updateButtonState()
{
2009-02-13 17:16:39 +05:00
if ( SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
!= OCCViewer_Viewer::Type() || myObject->_is_nil() ) {
myGrp1->CheckBox1->setChecked( false );
myGrp1->CheckBox1->setEnabled( false );
}
else {
myGrp1->CheckBox1->setEnabled( true );
2004-12-01 15:39:14 +05:00
}
myNbBlocks = 0;
2009-02-13 17:16:39 +05:00
if ( myObject->_is_nil() ) {
myGrp1->TextBrowser1->setText( "" );
}
else {
2012-08-09 13:58:02 +06:00
GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
bool isOnlyBlocks = anOper->IsCompoundOfBlocks( myObject,
myGrp1->SpinBox1->value(),
myGrp1->SpinBox2->value(),
myNbBlocks );
2009-02-13 17:16:39 +05:00
if ( isOnlyBlocks )
myGrp1->TextBrowser1->setText( tr( "GEOM_NB_BLOCKS_NO_OTHERS" ).arg( myNbBlocks ) );
2004-12-01 15:39:14 +05:00
else
2009-02-13 17:16:39 +05:00
myGrp1->TextBrowser1->setText( tr( "GEOM_NB_BLOCKS_SOME_OTHERS" ).arg( myNbBlocks ) );
2004-12-01 15:39:14 +05:00
}
}
//=================================================================================
// function : isAllSubShapes
// purpose :
//=================================================================================
bool BlocksGUI_ExplodeDlg::isAllSubShapes() const
{
return !(myGrp1->CheckBox1->isEnabled() && myGrp1->CheckBox1->isChecked());
2004-12-01 15:39:14 +05:00
}
//=================================================================================
// function : createOperation
// purpose :
//=================================================================================
GEOM::GEOM_IOperations_ptr BlocksGUI_ExplodeDlg::createOperation()
{
2017-06-13 14:57:14 +05:00
return getGeomEngine()->GetIBlocksOperations();
2004-12-01 15:39:14 +05:00
}
//=================================================================================
// function : isValid()
// purpose : Verify validity of input data
//=================================================================================
2009-02-13 17:16:39 +05:00
bool BlocksGUI_ExplodeDlg::isValid (QString& msg)
2004-12-01 15:39:14 +05:00
{
2009-02-13 17:16:39 +05:00
bool okSP = true;
okSP = myGrp1->SpinBox1->isValid( msg, !IsPreview() ) && okSP;
okSP = myGrp1->SpinBox2->isValid( msg, !IsPreview() ) && okSP;
bool ok = false;
switch ( getConstructorId() ) {
2004-12-01 15:39:14 +05:00
case 0:
2009-02-13 17:16:39 +05:00
if ( IsPreview() ) {
ok = !myObject->_is_nil();
}
else {
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
ok = !myObject->_is_nil() && (isAllSubShapes() || aSelList.Extent());
}
break;
2004-12-01 15:39:14 +05:00
default:
2009-02-13 17:16:39 +05:00
break;
2004-12-01 15:39:14 +05:00
}
2009-02-13 17:16:39 +05:00
return ok && okSP;
2004-12-01 15:39:14 +05:00
}
//=================================================================================
// function : execute
// purpose :
//=================================================================================
2009-02-13 17:16:39 +05:00
bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
2004-12-01 15:39:14 +05:00
{
GEOM::ListOfGO_var aList;
2012-08-09 13:58:02 +06:00
GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
2009-02-13 17:16:39 +05:00
switch ( getConstructorId() ) {
case 0:
2012-08-09 13:58:02 +06:00
aList = anOper->ExplodeCompoundOfBlocks( myObject,
myGrp1->SpinBox1->value(),
myGrp1->SpinBox2->value() );
2009-02-13 17:16:39 +05:00
break;
2004-12-01 15:39:14 +05:00
}
2009-02-13 17:16:39 +05:00
if ( !aList->length() )
2004-12-01 15:39:14 +05:00
return false;
2009-02-13 17:16:39 +05:00
if ( IsPreview() ) {
2004-12-01 15:39:14 +05:00
clearTemporary();
2009-02-13 17:16:39 +05:00
2004-12-01 15:39:14 +05:00
// Store objects. They will be put in study when "Apply" is pressed
2009-02-13 17:16:39 +05:00
for ( int i = 0, n = aList->length(); i < n; i++ ) {
objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
myTmpObjs.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
2004-12-01 15:39:14 +05:00
}
2009-02-13 17:16:39 +05:00
return objects.size() > 0;
2004-12-01 15:39:14 +05:00
}
2009-02-13 17:16:39 +05:00
QStringList aParameters;
aParameters << myGrp1->SpinBox1->text();
aParameters << myGrp1->SpinBox2->text();
2004-12-01 15:39:14 +05:00
// Throw away sub-shapes not selected by user if not in preview mode
// and manual selection is active
2009-02-13 17:16:39 +05:00
if ( !isAllSubShapes() ) {
2004-12-01 15:39:14 +05:00
QMap<QString, char> selected;
2009-02-13 17:16:39 +05:00
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
SALOME_ListIO aSelList;
aSelMgr->selectedObjects(aSelList);
2004-12-01 15:39:14 +05:00
// Get names of selected objects
2009-02-13 17:16:39 +05:00
SALOME_ListIteratorOfListIO it (aSelList);
for ( ; it.More(); it.Next() ) {
selected.insert( it.Value()->getName(), 0 );
2004-12-01 15:39:14 +05:00
}
// Iterate through result and select objects with names from selection
2009-02-13 17:16:39 +05:00
ObjectList toRemoveFromEngine;
2004-12-01 15:39:14 +05:00
ObjectList::iterator anIter;
2009-02-13 17:16:39 +05:00
for ( anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter ) {
CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string( *anIter );
if ( selected.contains( QString( objStr.in() ) ) )
{
2012-08-09 13:58:02 +06:00
if ( !IsPreview() )
(*anIter)->SetParameters(aParameters.join(":").toUtf8().constData());
2009-02-13 17:16:39 +05:00
objects.push_back( *anIter );
}
2004-12-01 15:39:14 +05:00
else
2009-02-13 17:16:39 +05:00
toRemoveFromEngine.push_back( *anIter );
2004-12-01 15:39:14 +05:00
}
// Remove from engine useless objects
2009-02-13 17:16:39 +05:00
ObjectList::iterator anIter2 = toRemoveFromEngine.begin();
for ( ; anIter2 != toRemoveFromEngine.end(); ++anIter2 )
getGeomEngine()->RemoveObject( *anIter2 );
2004-12-01 15:39:14 +05:00
myTmpObjs.clear();
2009-02-13 17:16:39 +05:00
}
else {
for ( int i = 0, n = aList->length(); i < n; i++ )
{
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_duplicate( aList[i] );
if ( !IsPreview() )
anObj->SetParameters(aParameters.join(":").toUtf8().constData());
2009-02-13 17:16:39 +05:00
objects.push_back( anObj._retn() );
}
2004-12-01 15:39:14 +05:00
}
return objects.size();
}
//=================================================================================
// function : clearTemporary
// purpose : Remove temporary objects from engine
//=================================================================================
void BlocksGUI_ExplodeDlg::clearTemporary()
{
ObjectList::iterator anIter;
2009-02-13 17:16:39 +05:00
for ( anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter )
getGeomEngine()->RemoveObject( *anIter );
2004-12-01 15:39:14 +05:00
myTmpObjs.clear();
}
//================================================================
// Function : getFather
// Purpose : Get father object for object to be added in study
// ( called with addInStudy method )
//================================================================
2009-02-13 17:16:39 +05:00
GEOM::GEOM_Object_ptr BlocksGUI_ExplodeDlg::getFather( GEOM::GEOM_Object_ptr )
2004-12-01 15:39:14 +05:00
{
return myObject;
}
2005-06-10 18:43:15 +06:00
//================================================================
// Function : getNewObjectName
// Purpose : Redefine this method to return proper name for a new object
//================================================================
2013-02-12 17:35:16 +06:00
QString BlocksGUI_ExplodeDlg::getNewObjectName (int) const
2005-06-10 18:43:15 +06:00
{
2009-02-13 17:16:39 +05:00
return QString::null;
2005-06-10 18:43:15 +06:00
}
//=================================================================================
// function : getSourceObjects
// purpose : virtual method to get source objects
//=================================================================================
QList<GEOM::GeomObjPtr> BlocksGUI_ExplodeDlg::getSourceObjects()
{
QList<GEOM::GeomObjPtr> res;
GEOM::GeomObjPtr aGeomObjPtr(myObject);
res << aGeomObjPtr;
return res;
}