Mantis issue 0020812: EDF 1356 GEOM: Deleted objects still appear in the dump.

This commit is contained in:
jfa 2010-04-16 07:01:28 +00:00
parent eea6c0633d
commit 2e84c26b17

View File

@ -19,10 +19,10 @@
// //
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
// //
// GEOM GEOMGUI : GUI for Geometry component // GEOM GEOMGUI : GUI for Geometry component
// File : GEOMBase_Helper.cxx // File : GEOMBase_Helper.cxx
// Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com) // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
//
#include "GEOMBase_Helper.h" #include "GEOMBase_Helper.h"
#include "GEOMBase.h" #include "GEOMBase.h"
#include "GEOM_Operation.h" #include "GEOM_Operation.h"
@ -54,7 +54,7 @@
//To disable automatic genericobj management, the following line should be commented. //To disable automatic genericobj management, the following line should be commented.
//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx //Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx
//#define WITHGENERICOBJ #define WITHGENERICOBJ
//================================================================ //================================================================
// Function : getActiveView // Function : getActiveView
@ -107,7 +107,7 @@ GEOMBase_Helper::~GEOMBase_Helper()
if(aGeomGUI) if(aGeomGUI)
globalSelection(aGeomGUI->getLocalSelectionMode() , true ); globalSelection(aGeomGUI->getLocalSelectionMode() , true );
} }
if (myDisplayer) if (myDisplayer)
delete myDisplayer; delete myDisplayer;
if ( !CORBA::is_nil( myOperation ) ) if ( !CORBA::is_nil( myOperation ) )
@ -246,8 +246,8 @@ void GEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object,
void GEOMBase_Helper::displayPreview( const bool activate, void GEOMBase_Helper::displayPreview( const bool activate,
const bool update, const bool update,
const bool toRemoveFromEngine, const bool toRemoveFromEngine,
const double lineWidth, const double lineWidth,
const int displayMode, const int displayMode,
const int color ) const int color )
{ {
isPreview = true; isPreview = true;
@ -295,8 +295,8 @@ void GEOMBase_Helper::displayPreview( GEOM::GEOM_Object_ptr object,
const bool append, const bool append,
const bool activate, const bool activate,
const bool update, const bool update,
const double lineWidth, const double lineWidth,
const int displayMode, const int displayMode,
const int color ) const int color )
{ {
// Set color for preview shape // Set color for preview shape
@ -304,7 +304,7 @@ void GEOMBase_Helper::displayPreview( GEOM::GEOM_Object_ptr object,
// set width of displayed shape // set width of displayed shape
getDisplayer()->SetWidth( lineWidth ); getDisplayer()->SetWidth( lineWidth );
// set display mode of displayed shape // set display mode of displayed shape
int aPrevDispMode = getDisplayer()->SetDisplayMode( displayMode ); int aPrevDispMode = getDisplayer()->SetDisplayMode( displayMode );
@ -859,7 +859,7 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction )
commitCommand(); commitCommand();
updateObjBrowser(); updateObjBrowser();
SUIT_Session::session()->activeApplication()->putInfo( QObject::tr("GEOM_PRP_DONE") ); SUIT_Session::session()->activeApplication()->putInfo( QObject::tr("GEOM_PRP_DONE") );
result = true; result = true;
} }
else else
abortCommand(); abortCommand();
@ -964,7 +964,7 @@ QString GEOMBase_Helper::getNewObjectName() const
//================================================================ //================================================================
// Function : extractPrefix // Function : extractPrefix
// Purpose : Redefine this method to return \c true if necessary // Purpose : Redefine this method to return \c true if necessary
// to extract prefix when generating new name for the // to extract prefix when generating new name for the
// object(s) being created // object(s) being created
//================================================================ //================================================================
@ -1015,7 +1015,7 @@ SUIT_Desktop* GEOMBase_Helper::getDesktop() const
//================================================================ //================================================================
// Function : selectObjects // Function : selectObjects
// Purpose : Selects list of objects // Purpose : Selects list of objects
//================================================================ //================================================================
bool GEOMBase_Helper::selectObjects( ObjectList& objects ) bool GEOMBase_Helper::selectObjects( ObjectList& objects )
{ {
@ -1028,7 +1028,7 @@ bool GEOMBase_Helper::selectObjects( ObjectList& objects )
LightApp_DataOwner* anOwher = new LightApp_DataOwner( aEntry ); LightApp_DataOwner* anOwher = new LightApp_DataOwner( aEntry );
aList.append( anOwher ); aList.append( anOwher );
} }
SUIT_Session* session = SUIT_Session::session(); SUIT_Session* session = SUIT_Session::session();
SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() ); SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
if ( !app ) if ( !app )
@ -1037,12 +1037,12 @@ bool GEOMBase_Helper::selectObjects( ObjectList& objects )
LightApp_SelectionMgr* aMgr = app->selectionMgr(); LightApp_SelectionMgr* aMgr = app->selectionMgr();
if ( !aMgr ) if ( !aMgr )
return false; return false;
aMgr->setSelected( aList, false ); aMgr->setSelected( aList, false );
return true; return true;
} }
//================================================================ //================================================================
// Function : findObjectInFather // Function : findObjectInFather
// Purpose : It should return an object if its founded in study or // Purpose : It should return an object if its founded in study or
@ -1074,11 +1074,11 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather (GEOM::GEOM_Object_ptr
return GEOM::GEOM_Object::_nil(); return GEOM::GEOM_Object::_nil();
} }
//================================================================ //================================================================
// Function : addSubshapesToStudy // Function : addSubshapesToStudy
// Purpose : Virtual method to add subshapes if needs // Purpose : Virtual method to add subshapes if needs
//================================================================ //================================================================
void GEOMBase_Helper::addSubshapesToStudy() void GEOMBase_Helper::addSubshapesToStudy()
{ {
//Impemented in Dialogs, called from Accept method //Impemented in Dialogs, called from Accept method
@ -1087,7 +1087,7 @@ void GEOMBase_Helper::addSubshapesToStudy()
//================================================================ //================================================================
// Function : addSubshapesToFather // Function : addSubshapesToFather
// Purpose : Method to add Father Subshapes to Study if it`s not exist // Purpose : Method to add Father Subshapes to Study if it`s not exist
//================================================================ //================================================================
void GEOMBase_Helper::addSubshapesToFather( QMap<QString, GEOM::GEOM_Object_var>& theMap ) void GEOMBase_Helper::addSubshapesToFather( QMap<QString, GEOM::GEOM_Object_var>& theMap )
{ {
//GetStudyDS //GetStudyDS
@ -1097,12 +1097,12 @@ void GEOMBase_Helper::addSubshapesToFather( QMap<QString, GEOM::GEOM_Object_var>
_PTR(Study) aDStudy = appStudy->studyDS(); _PTR(Study) aDStudy = appStudy->studyDS();
GEOM::GEOM_IGroupOperations_var anOp = getGeomEngine()->GetIGroupOperations( getStudyId() ); GEOM::GEOM_IGroupOperations_var anOp = getGeomEngine()->GetIGroupOperations( getStudyId() );
for( QMap<QString, GEOM::GEOM_Object_var>::Iterator it = theMap.begin(); it != theMap.end(); it++ ) { for( QMap<QString, GEOM::GEOM_Object_var>::Iterator it = theMap.begin(); it != theMap.end(); it++ ) {
if ( !anOp->_is_nil() ) { if ( !anOp->_is_nil() ) {
GEOM::GEOM_Object_var aFatherObj = anOp->GetMainShape( it.value() ); GEOM::GEOM_Object_var aFatherObj = anOp->GetMainShape( it.value() );
if ( !aFatherObj->_is_nil() ) { if ( !aFatherObj->_is_nil() ) {
std::string aFatherEntry = getEntry( aFatherObj ); std::string aFatherEntry = getEntry( aFatherObj );
if ( aFatherEntry != "") { // additional checking that object is valid 0020598 EDF 1191 if ( aFatherEntry != "") { // additional checking that object is valid 0020598 EDF 1191
GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key().toLatin1().data() ); GEOM::GEOM_Object_var aFindedObject = findObjectInFather(aFatherObj, it.key().toLatin1().data() );
//Add Object to study if its not exist //Add Object to study if its not exist
@ -1116,5 +1116,3 @@ void GEOMBase_Helper::addSubshapesToFather( QMap<QString, GEOM::GEOM_Object_var>
} }
} }
} }