#include <qpushbutton.h>
#include <qlabel.h>
-#include "SALOMEDS_StudyManager.hxx"
-#include "SALOMEDS_SObject.hxx"
-#include "SALOMEDS_IParameters.hxx"
+#include "SALOMEDSClient_ClientFactory.hxx"
+#include "SALOMEDSClient_IParameters.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SALOME_ListIO.hxx"
_PTR(SObject) so = stdDS->FindObjectID(it.Value()->getEntry());
if ( so ) {
- SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(so.get());
-
- if ( aSO ) {
canCopy = studyMgr()->CanCopy(so);
canPaste = studyMgr()->CanPaste(so);
- }
}
}
}
QFileInfo aFileInfo(aFileName);
int savePoint;
if ( toSaveGUI ) { //SRN: Store a visual state of the study at the save point for DumpStudy method
- SALOMEDS_IParameters::setDumpPython(appStudy->studyDS());
- savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point
- //prefix = SALOMEDS_IParameters::getStudyScript(appStudy->studyDS(), appStudy->getVisualComponentName(), savePoint);
-
+ _PTR(AttributeParameter) ap;
+ _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
+ ip->setDumpPython(appStudy->studyDS());
+ savePoint = SalomeApp_VisualState( this ).storeState(); //SRN: create a temporary save point
}
bool res = aStudy->DumpStudy( aFileInfo.dirPath( true ).latin1(), aFileInfo.baseName().latin1(), toPublish);
if ( toSaveGUI )
#include <qapplication.h>
#include <qdict.h>
-#include <SALOMEDS_IParameters.hxx>
+#include <SALOMEDSClient_ClientFactory.hxx>
+#include <SALOMEDSClient_IParameters.hxx>
#include <vector>
#include <string>
savePoint = savePoints[savePoints.size()-1] + 1;
_PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName(), savePoint );
- SALOMEDS_IParameters ip( ap );
+ _PTR(IParameters) ip = ClientFactory::getIParameters( ap );
ViewManagerList lst;
myApp->viewManagers( lst );
// store active window's name
SUIT_ViewWindow* win = myApp->desktop()->activeWindow();
if ( win )
- ip.setProperty("AP_ACTIVE_VIEW", win->name() );
+ ip->setProperty("AP_ACTIVE_VIEW", win->name() );
int viewerID = 0;
SUIT_ViewManager* vm = 0;
continue; //No views is opened in the viewer
std::string viewerEntry = QString( "%1_%2" ).arg( vm->getType() ).arg( ++viewerID ).latin1();
- ip.append("AP_VIEWERS_LIST", viewerEntry);
+ ip->append("AP_VIEWERS_LIST", viewerEntry);
QPtrVector<SUIT_ViewWindow> views = vm->getViews();
for(int i = 0; i<view_count; i++) {
- ip.append( viewerEntry, views[i]->caption().latin1() );
- ip.append( viewerEntry, views[i]->getVisualParameters().latin1() );
+ ip->append( viewerEntry, views[i]->caption().latin1() );
+ ip->append( viewerEntry, views[i]->getVisualParameters().latin1() );
}
}
QtxWorkstack* workstack = ((STD_TabDesktop*)myApp->desktop())->workstack();
QString workstackInfo;
(*workstack) >> workstackInfo;
- ip.setProperty( "AP_WORKSTACK_INFO", workstackInfo.latin1() );
+ ip->setProperty( "AP_WORKSTACK_INFO", workstackInfo.latin1() );
}
//Save a name of the active module
if ( CAM_Module* activeModule = myApp->activeModule() )
- ip.setProperty( "AP_ACTIVE_MODULE", activeModule->moduleName().latin1() );
+ ip->setProperty( "AP_ACTIVE_MODULE", activeModule->moduleName().latin1() );
//Store visual parameters of the modules
QPtrList<CAM_Module> mlist;
CAM_Module* module = 0;
for ( module = mlist.first(); module; module = mlist.next() ) {
if ( SalomeApp_Module* sModule = dynamic_cast<SalomeApp_Module*>( module ) ) {
- ip.append( "AP_MODULES_LIST", sModule->moduleName().latin1() );
+ ip->append( "AP_MODULES_LIST", sModule->moduleName().latin1() );
sModule->storeVisualParameters( savePoint );
}
}
return;
_PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName(), savePoint );
- SALOMEDS_IParameters ip(ap);
+ _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
//Remove all already existent veiwers and their views
ViewManagerList lst;
myApp->viewManagers( lst );
- for ( QPtrListIterator<SUIT_ViewManager> it(lst); it.current(); ++it )
+ for ( QPtrListIterator<SUIT_ViewManager> it(lst); it.current(); ++it ) {
myApp->removeViewManager( it.current() );
-
+ qApp->processEvents();
+ }
//Restore the viewers and view windows
- int nbViewers = ip.nbValues( "AP_VIEWERS_LIST" );
+ int nbViewers = ip->nbValues( "AP_VIEWERS_LIST" );
SUIT_ViewWindow* viewWin = 0;
for ( int i = 0; i < nbViewers; i++ ) {
- std::string viewerEntry = ip.getValue( "AP_VIEWERS_LIST", i );
- std::vector<std::string> veiewerParams = ip.parseValue(viewerEntry,'_');
+ std::string viewerEntry = ip->getValue( "AP_VIEWERS_LIST", i );
+ std::vector<std::string> veiewerParams = ip->parseValue(viewerEntry,'_');
std::string type = veiewerParams[0];
std::string viewerID = veiewerParams[1];
SUIT_ViewManager* vm = myApp->newViewManager( type.c_str() );
if ( !vm )
continue; //Unknown viewer
- int nbViews = (ip.nbValues(viewerEntry))/2;
+ int nbViews = (ip->nbValues(viewerEntry))/2;
//Create nbViews-1 view (-1 because 1 view is created by createViewManager)
for ( int i = 1; i< nbViews; i++ ) {
while ( !viewWin->isVisible() )
qApp->processEvents();
- viewWin->setCaption(ip.getValue(viewerEntry, j).c_str());
- viewWin->setVisualParameters(ip.getValue(viewerEntry, j+1).c_str());
+ viewWin->setCaption(ip->getValue(viewerEntry, j).c_str());
+ viewWin->setVisualParameters(ip->getValue(viewerEntry, j+1).c_str());
}
}
// restore modules' visual parameters
- std::vector<std::string> v = ip.getValues("AP_MODULES_LIST");
+ std::vector<std::string> v = ip->getValues("AP_MODULES_LIST");
for ( int i = 0; i < v.size(); i++ ) {
myApp->activateModule( v[i].c_str() );
if ( SalomeApp_Module* module = dynamic_cast<SalomeApp_Module*>( myApp->activeModule() ) )
}
// activate module that was active on save
- QString activeModuleName( ip.getProperty("AP_ACTIVE_MODULE" ).c_str() );
+ QString activeModuleName( ip->getProperty("AP_ACTIVE_MODULE" ).c_str() );
if ( !activeModuleName.isEmpty() )
myApp->activateModule( activeModuleName );
// some modules can create their own viewers (like VISU creates GaussViewers)
if ( myApp->desktop()->inherits( "STD_TabDesktop" ) ) {
QtxWorkstack* workstack = ((STD_TabDesktop*)myApp->desktop())->workstack();
- (*workstack) << ip.getProperty( "AP_WORKSTACK_INFO" ).c_str();
+ (*workstack) << ip->getProperty( "AP_WORKSTACK_INFO" ).c_str();
}
// restore visual parameters of view windows. it must be done AFTER restoring workstack.
}
// set focus to previously saved active view window
- std::string activeViewName = ip.getProperty("AP_ACTIVE_VIEW");
+ std::string activeViewName = ip->getProperty("AP_ACTIVE_VIEW");
for ( it.toFirst(); it.current(); ++it ) {
int view_count = it.current()->getViewsCount();
QPtrVector<SUIT_ViewWindow> views = it.current()->getViews();