X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FVISU_I%2FVISU_Gen_i.cc;h=d225b3d04f4da5be2ce56f9ee4afc0a7d68694fa;hb=3f4152dedc1ae968267cfb8a079f261ec0088ed0;hp=11ffff01971cb8f75ac337130fd868705091bf2c;hpb=22270d5d7b703fee59bd48ce61a73eaa05f124d9;p=modules%2Fvisu.git diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 11ffff01..d225b3d0 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -38,8 +38,11 @@ #include "VISU_CutLines_i.hh" #include "VISU_Vectors_i.hh" #include "VISU_StreamLines_i.hh" +#include "VISU_GaussPoints_i.hh" +#include "VISU_Plot3D_i.hh" #include "VISU_Table_i.hh" #include "VISU_TimeAnimation.h" +#include "VISU_ScalarMapOnDeformedShape_i.hh" #include "VISU_Actor.h" @@ -52,7 +55,7 @@ #include "SUIT_Session.h" #include "SalomeApp_Study.h" #include "SalomeApp_Application.h" -#include "SalomeApp_SelectionMgr.h" +#include "LightApp_SelectionMgr.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" #include "SALOME_Event.hxx" @@ -82,13 +85,15 @@ #include #include "Utils_ExceptHandlers.hxx" +#include "CASCatch.hxx" using namespace std; static QFileInfo aFileInfo; #ifdef _DEBUG_ -static int MYDEBUG = 1; +static int MYDEBUG = 0; +//#define _DEXCEPT_ #else static int MYDEBUG = 0; #endif @@ -106,7 +111,8 @@ extern "C" VISU::VISU_Gen_ptr GetImpl(CORBA::ORB_ptr theORB, return aVISU_Gen->_this(); } -namespace VISU{ +namespace VISU +{ static string VisuTmpDir; static CORBA::Boolean myIsMultiFile; @@ -185,15 +191,18 @@ namespace VISU{ Storable::Registry(Result_i::myComment.c_str(),&(Result_i::Restore)); Storable::Registry(Mesh_i::myComment.c_str(),&(Restore)); Storable::Registry(ScalarMap_i::myComment.c_str(),&(Restore)); + Storable::Registry(GaussPoints_i::myComment.c_str(),&(Restore)); Storable::Registry(DeformedShape_i::myComment.c_str(),&(Restore)); Storable::Registry(CutPlanes_i::myComment.c_str(),&(Restore)); Storable::Registry(CutLines_i::myComment.c_str(),&(Restore)); Storable::Registry(IsoSurfaces_i::myComment.c_str(),&(Restore)); Storable::Registry(StreamLines_i::myComment.c_str(),&(Restore)); + Storable::Registry(Plot3D_i::myComment.c_str(),&(Restore)); Storable::Registry(Vectors_i::myComment.c_str(),&(Restore)); Storable::Registry(Table_i::myComment.c_str(),&(Table_i::Restore)); Storable::Registry(Curve_i::myComment.c_str(),&(Curve_i::Restore)); Storable::Registry(Container_i::myComment.c_str(),&(Container_i::Restore)); + Storable::Registry(ScalarMapOnDeformedShape_i::myComment.c_str(),&(Restore)); } @@ -223,6 +232,33 @@ namespace VISU{ if(MYDEBUG) MESSAGE("VISU_Gen_i::VISU_Gen_i : there is no opened study in StudyManager !!!"); } + bool + CreatColoredPrs3d(ColoredPrs3d_i* theColoredPrs3d, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { + CASCatch_TRY{ +#ifndef _DEXCEPT_ + try{ +#endif + if(theColoredPrs3d->Create(theMeshName,theEntity,theFieldName,int(theIteration))) + return true; +#ifndef _DEXCEPT_ + }catch(std::exception& exc){ + INFOS("Follow exception was occured :\n"<GetMessageString()); + } + return false; + } + VISU_Gen_i::~VISU_Gen_i(){ if(MYDEBUG) MESSAGE("VISU_Gen_i::~VISU_Gen_i"); } @@ -235,8 +271,8 @@ namespace VISU{ Mutex mt(myMutex); SALOMEDS::Study_var aStudy = theComponent->GetStudy(); SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); - const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str(); - TCollection_AsciiString aTmpDir(const_cast(aDir)); + string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); + TCollection_AsciiString aTmpDir (const_cast(aDir.c_str())); VisuTmpDir = aTmpDir.ToCString(); SALOMEDS::ListOfFileNames_var aSeq = SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir.ToCString(),isMultiFile); @@ -269,58 +305,69 @@ namespace VISU{ //=========================================================================== SALOMEDS::TMPFile* VISU_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, const char* theURL, - bool isMultiFile) + bool theIsMultiFile) { Mutex mt(myMutex); - const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str(); - TCollection_AsciiString aTmpDir(const_cast(aDir)); + string aTmpDir = theURL; if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "<GetStudy(); + + typedef std::vector TFileNames; + TFileNames aFileNames; + TFileNames aFiles; - //CORBA::Boolean anIsValidScript; - //Engines::TMPFile_var aDump = DumpPython(aStudy,false,anIsValidScript); - - SALOMEDS::ChildIterator_var itBig = aStudy->NewChildIterator(theComponent); - for (; itBig->More(); itBig->Next()) { - SALOMEDS::SObject_var gotBranch = itBig->Value(); + SALOMEDS::Study_var aStudy = theComponent->GetStudy(); + SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent); + for (; anIter->More(); anIter->Next()) { + SALOMEDS::SObject_var gotBranch = anIter->Value(); CORBA::Object_var anObj = SObjectToObject(gotBranch); if(CORBA::is_nil(anObj)) continue; - if(Result_i* pResult = dynamic_cast(GetServant(anObj).in())){ - switch(pResult->GetCreationId()){ + if(Result_i* aResult = dynamic_cast(GetServant(anObj).in())){ + switch(aResult->GetCreationId()){ case Result_i::eImportFile: case Result_i::eCopyAndImportFile: { - const QFileInfo& aFileInfo = pResult->GetFileInfo(); - QString aPrefix(""); - if (isMultiFile) aPrefix = SALOMEDS_Tool::GetNameFromPath(aStudy->URL()).c_str(); - QString aFileName = aPrefix + "_" + (pResult->GetName()).c_str(); - static QString aCommand; - aCommand.sprintf("cp %s %s%s",aFileInfo.filePath().latin1(),aTmpDir.ToCString(),aFileName.latin1()); - - int aRes = system(aCommand); - if(aRes){ - if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - Cann't execute the command :"<URL()) + aFileName; + + std::ostringstream aStream; + aStream<<"cp "< 0){ - SALOMEDS::ListOfFileNames_var aSeq = new SALOMEDS::ListOfFileNames; - aSeq->length(aFileNames.Length()); - for(aCounter = aFileNames.Length(); aCounter > 0; aCounter--) - aSeq[aCounter-1] = CORBA::string_dup(aFileNames.Value(aCounter).ToCString()); - aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir.ToCString(), aSeq.in(), isMultiFile); - if(!isMultiFile) - SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir.ToCString(), aSeq.in(), true); + + if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<length(aFileNames.size()); + for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--) + aListOfFileNames[aCounter-1] = aFileNames[aCounter-1].c_str(); + } + + SALOMEDS::ListOfFileNames_var aListOfFiles = new SALOMEDS::ListOfFileNames; + aListOfFiles->length(aFiles.size()); + if(!aFiles.empty()){ + for(int aCounter = aFileNames.size(); aCounter > 0; aCounter--) + aListOfFiles[aCounter-1] = aFiles[aCounter-1].c_str(); } + + SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0); + if(theIsMultiFile) + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aTmpDir, aListOfFiles.in(), theIsMultiFile); + else + aStreamFile = SALOMEDS_Tool::PutFilesToStream(aListOfFiles.in(), aListOfFileNames.in()); + return aStreamFile._retn(); } @@ -329,8 +376,8 @@ namespace VISU{ bool isMultiFile) { Mutex mt(myMutex); - const char* aDir = isMultiFile? theURL: SALOMEDS_Tool::GetTmpDir().c_str(); - TCollection_AsciiString aTmpDir(const_cast(aDir)); + string aDir = isMultiFile ? theURL : SALOMEDS_Tool::GetTmpDir(); + TCollection_AsciiString aTmpDir (const_cast(aDir.c_str())); if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - "< anApplications = aSession->applications(); + QPtrListIterator anIter (anApplications); + SUIT_Application* aFirstApp = anIter.current(); + while (SUIT_Application* anApp = anIter.current()) { + ++anIter; + if (SUIT_Study* aSStudy = anApp->activeStudy()) { + if (SalomeApp_Study* aStudy = dynamic_cast(aSStudy)) { + if (_PTR(Study) aCStudy = aStudy->studyDS()) { + if(MYDEBUG) MESSAGE("There is an application with active study : StudyId = " + << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'"); + if (myStudyName == aCStudy->Name()) { + isActive = true; + break; + } + } + } + } + } + if (!isActive) { + MESSAGE("!!! anApp->onLoadDoc(myStudyName) !!!"); + // Has to be loaded in an empty or in a new application + SalomeApp_Application* anApp = dynamic_cast(aFirstApp); + anApp->onLoadDoc(myStudyName.c_str()); + } + } + }; + if (!CORBA::is_nil(theStudy)) { CORBA::String_var aName = theStudy->Name(); - QString aStudyName (aName.in()); - MESSAGE("VISU_Gen_i::SetCurrentStudy - StudyId = " << - theStudy->StudyId() << "; Name = '" << aName.in() << "'"); + std::string aStudyName (aName.in()); + if(MYDEBUG) MESSAGE("StudyId = " << theStudy->StudyId() << "; Name = '" << aName.in() << "'"); myStudyDocument = SALOMEDS::Study::_duplicate(theStudy); - MESSAGE("Find application for study : " << aName.in()); - bool isActive = false; - SUIT_Session* aSession = SUIT_Session::session(); - QPtrList anApplications = aSession->applications(); - QPtrListIterator anIter (anApplications); - SUIT_Application* aFirstApp = anIter.current(); - while (SUIT_Application* anApp = anIter.current()) { - ++anIter; - if (SUIT_Study* aSStudy = anApp->activeStudy()) { - if (SalomeApp_Study* aStudy = dynamic_cast(aSStudy)) { - MESSAGE("There is an application with active study : " << aStudy->studyName()); - if (aStudyName == aStudy->studyName()) { - isActive = true; - break; - } - } - } - } - if (!isActive) { - // Has to be loaded in an empty or in a new application - SalomeApp_Application* anApp = dynamic_cast(aFirstApp); - anApp->onLoadDoc(aName.in()); - } + ProcessVoidEvent(new TEvent(aStudyName)); } else { - MESSAGE("VISU_Gen_i::SetCurrentStudy : CORBA::is_nil(theStudy)"); + INFOS("CORBA::is_nil(theStudy)"); } } @@ -482,6 +542,23 @@ namespace VISU{ } } + Result_ptr VISU_Gen_i::CreateResult(const char* theFileName){ + if(myStudyDocument->GetProperties()->IsLocked()) + return Result::_nil(); + Mutex mt(myMutex); + aFileInfo.setFile(theFileName); + Result_i* pResult = new Result_i(myStudyDocument, + Result_i::eFile, + Result_i::eImportFile, + false); + if(pResult->Create(theFileName) != NULL) + return pResult->_this(); + else{ + pResult->_remove_ref(); + return VISU::Result::_nil(); + } + } + Result_ptr VISU_Gen_i::CopyAndImportFile(const char* theFileName){ if(myStudyDocument->GetProperties()->IsLocked()) return Result::_nil(); @@ -496,36 +573,117 @@ namespace VISU{ return aResult._retn(); } - Result_ptr VISU_Gen_i::ImportMed(SALOMEDS::SObject_ptr theMedSObject){ - if(myStudyDocument->GetProperties()->IsLocked()) + Result_ptr VISU_Gen_i::ImportMed (SALOMEDS::SObject_ptr theMedSObject) + { + if (myStudyDocument->GetProperties()->IsLocked()) return Result::_nil(); Mutex mt(myMutex); Result_i* pResult = new Result_i(myStudyDocument, Result_i::eComponent, Result_i::eImportMed); - if(pResult->Create(theMedSObject) != NULL) + if (pResult->Create(theMedSObject) != NULL) { return pResult->_this(); - else{ + } else { pResult->_remove_ref(); return VISU::Result::_nil(); } } - Result_ptr VISU_Gen_i::ImportMedField(SALOME_MED::FIELD_ptr theField){ - if(myStudyDocument->GetProperties()->IsLocked()) + Result_ptr VISU_Gen_i::ImportMedField (SALOME_MED::FIELD_ptr theField) + { + if (myStudyDocument->GetProperties()->IsLocked()) return Result::_nil(); Mutex mt(myMutex); Result_i* pResult = new Result_i(myStudyDocument, Result_i::eComponent, Result_i::eImportMedField); - if(pResult->Create(theField) != NULL) + if (pResult->Create(theField) != NULL) { return pResult->_this(); - else{ + } else { pResult->_remove_ref(); return VISU::Result::_nil(); } } + void VISU_Gen_i::RenameMeshInStudy(Result_ptr theResult, + string theMeshName, + int theEntity, // -1 for group indication + string theSubMeshName, // Family or Group name + string theNewName) + { + if (myStudyDocument->GetProperties()->IsLocked()) return; + Mutex mt(myMutex); + + Result_i* pResult = dynamic_cast(GetServant(theResult).in()); + if (!pResult) return; + + QString aComment; + VISU::VISUType aType; + if (theEntity >= 0) + if (theSubMeshName == "") + aType = VISU::TENTITY; + else + aType = VISU::TFAMILY; + else + aType = VISU::TGROUP; + + switch (aType) { + case VISU::TENTITY: + aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d", + VISU::TENTITY, theMeshName.c_str(), theEntity); + break; + case VISU::TFAMILY: + aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s", + VISU::TFAMILY, theMeshName.c_str(), theEntity, theSubMeshName.c_str()); + break; + case VISU::TGROUP: + aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s", + VISU::TGROUP, theMeshName.c_str(), theSubMeshName.c_str()); + break; + } + + string aResultEntry = pResult->GetEntry(); + string anEntry = pResult->GetEntry(aComment.latin1()); + if (anEntry == "") return; + + SALOMEDS::SObject_ptr aSObject = myStudyDocument->FindObjectID(anEntry.c_str()); + + SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder(); + aStudyBuilder->NewCommand(); // There is a transaction + + SALOMEDS::GenericAttribute_var anAttr = + aStudyBuilder->FindOrCreateAttribute(aSObject,"AttributeName"); + SALOMEDS::AttributeName_var aNameAttr = SALOMEDS::AttributeName::_narrow(anAttr); + aNameAttr->SetValue(theNewName.c_str()); + + aStudyBuilder->CommitCommand(); + } + + void VISU_Gen_i::RenameEntityInStudy(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theNewName) + { + RenameMeshInStudy(theResult, theMeshName, (int)theEntity, "", theNewName); + } + + void VISU_Gen_i::RenameFamilyInStudy(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFamilyName, + const char* theNewName) + { + RenameMeshInStudy(theResult, theMeshName, (int)theEntity, theFamilyName, theNewName); + } + + void VISU_Gen_i::RenameGroupInStudy(Result_ptr theResult, + const char* theMeshName, + const char* theGroupName, + const char* theNewName) + { + RenameMeshInStudy(theResult, theMeshName, -1, theGroupName, theNewName); + } + Mesh_ptr VISU_Gen_i::MeshOnEntity(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity) @@ -590,6 +748,15 @@ namespace VISU{ return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn(); } + GaussPoints_ptr VISU_Gen_i::GaussPointsOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { + return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration,true)._retn(); + } + DeformedShape_ptr VISU_Gen_i::DeformedShapeOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, @@ -599,6 +766,15 @@ namespace VISU{ return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); } + ScalarMapOnDeformedShape_ptr VISU_Gen_i::ScalarMapOnDeformedShapeOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { + return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); + } + Vectors_ptr VISU_Gen_i::VectorsOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, @@ -626,6 +802,15 @@ namespace VISU{ return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); } + Plot3D_ptr VISU_Gen_i::Plot3DOnField(Result_ptr theResult, + const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName, + CORBA::Double theIteration) + { + return Prs3dOnField(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn(); + } + CutPlanes_ptr VISU_Gen_i::CutPlanesOnField(Result_ptr theResult, const char* theMeshName, VISU::Entity theEntity, @@ -698,145 +883,14 @@ namespace VISU{ return VISU::Animation::_nil(); } - void DeletePrs3d (Prs3d_ptr thePrs3d) - { - Prs3d_i* aPrs3d = dynamic_cast(GetServant(thePrs3d).in()); - if (!aPrs3d) - return; - - // 1. Find appropriate application (code like in VISU_ViewManager_i.cxx) - SALOMEDS::Study_var myStudyDocument = aPrs3d->GetStudyDocument(); - SalomeApp_Application* anApp = NULL; - CORBA::String_var studyName = myStudyDocument->Name(); - std::string aStudyName = studyName.in(); - SUIT_Session* aSession = SUIT_Session::session(); - QPtrList anApplications = aSession->applications(); - QPtrListIterator anIter (anApplications); - while (SUIT_Application* aSUITApp = anIter.current()) { - ++anIter; - if (SUIT_Study* aSStudy = aSUITApp->activeStudy()) { - if (SalomeApp_Study* aStudy = dynamic_cast(aSStudy)) { - if (_PTR(Study) aCStudy = aStudy->studyDS()) { - if (aStudyName == aCStudy->Name()) { - anApp = dynamic_cast(aSUITApp); - break; - } - } - } - } - } - if (!anApp) - return; - - // 2. Remove corresponding IO from selection - SALOMEDS::SObject_var aSObject = aPrs3d->GetSObject(); - CORBA::String_var anEntry = aSObject->GetID(); - - SalomeApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr(); - SALOME_ListIO aListIO, aNewListIO; - aSelectionMgr->selectedObjects(aListIO); - - for (SALOME_ListIteratorOfListIO it (aListIO); it.More(); it.Next()) { - if (it.Value()->hasEntry()) { - std::string aCurEntry (it.Value()->getEntry()); - if (aCurEntry != anEntry) { - aNewListIO.Append(it.Value()); - } - } - } - - aSelectionMgr->setSelectedObjects(aNewListIO); - - // 3. Remove Actors - ViewManagerList aViewManagerList; - anApp->viewManagers(SVTK_Viewer::Type(), aViewManagerList); - QPtrListIterator anVMIter (aViewManagerList); - for (; anVMIter.current(); ++anVMIter) { - SUIT_ViewManager* aViewManager = anVMIter.current(); - QPtrVector aViews = aViewManager->getViews(); - for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) { - if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) { - if (SVTK_ViewWindow* vw = dynamic_cast(aViewWindow)) { - //VISU_Actor* anActor = aVISUViewManager->GetActor(aPrs3d, vw); - VISU_Actor* anActor = NULL; - vtkActorCollection *anActColl = vw->getRenderer()->GetActors(); - anActColl->InitTraversal(); - vtkActor *aVTKActor = anActColl->GetNextActor(); - for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) { - if (VISU_Actor* anVISUActor = dynamic_cast(aVTKActor)) { - if (aPrs3d == anVISUActor->GetPrs3d()) { - anActor = anVISUActor->GetParent(); - } - } - } - if (anActor) { - vw->RemoveActor(anActor); - anActor->Delete(); - } - } - } - } - } - - aPrs3d->RemoveFromStudy(); - aPrs3d->Destroy(); - - //jfa tmp:theModule->updateObjBrowser(); //update Object browser - } - void VISU_Gen_i::DeleteResult (Result_ptr theResult) { - class TEvent: public SALOME_Event { - Result_ptr myResult; - public: - TEvent(Result_ptr theResult): myResult(theResult) {} - virtual void Execute(){ - if (Result_i* aResult = dynamic_cast(GetServant(myResult).in())) { - SALOMEDS::SObject_var aSObject = aResult->GetSObject(); - SALOMEDS::Study_var aStudyDocument = aSObject->GetStudy(); - SALOMEDS::ChildIterator_var aChildIter = aStudyDocument->NewChildIterator(aSObject); - for(aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next()){ - SALOMEDS::SObject_var aChildSObject = aChildIter->Value(); - CORBA::Object_var aChildObj = VISU::SObjectToObject(aChildSObject); - if(CORBA::is_nil(aChildObj)) continue; - VISU::Prs3d_var aPrs3d = VISU::Prs3d::_narrow(aChildObj); - if(CORBA::is_nil(aPrs3d)) continue; - VISU::DeletePrs3d(aPrs3d); - } - - aResult->RemoveFromStudy(); - aResult->Destroy(); - - //jfa tmp:if (QAD_Desktop* aDesktop = QAD_Application::getDesktop()) - //jfa tmp: if (QAD_Study* aStudy = aDesktop->findStudy(aStudyDocument)) - //jfa tmp: aStudy->updateObjBrowser(); //update Object browser - } - } - }; - - if (myStudyDocument->GetProperties()->IsLocked()) - return; - Mutex mt(myMutex); // jfa ??? - - ProcessVoidEvent(new TEvent(theResult)); + theResult->RemoveFromStudy(); } void VISU_Gen_i::DeletePrs3d (Prs3d_ptr thePrs3d) { - class TEvent: public SALOME_Event { - Prs3d_ptr myPrs3d; - public: - TEvent(Prs3d_ptr thePrs3d): myPrs3d(thePrs3d) {} - virtual void Execute() { - VISU::DeletePrs3d(myPrs3d); - } - }; - - if (myStudyDocument->GetProperties()->IsLocked()) - return; - Mutex mt(myMutex); // jfa ??? - - ProcessVoidEvent(new TEvent(thePrs3d)); + thePrs3d->RemoveFromStudy(); } void VISU_Gen_i::Close(SALOMEDS::SComponent_ptr theComponent){ @@ -1031,5 +1085,4 @@ namespace VISU{ anIOR->SetValue(anIORValue); return aResultSO._retn(); } - }