with a Server name and an Engine name
salome.sg
methods:
- updateObjBrowser(bool):
+ updateObjBrowser():
getStudyName():
SelectedCount(): returns number of selected objects
- salome.sg : salome object to communicate with the graphical user interface (if any)
- methods:
- - updateObjBrowser(bool):
+ - updateObjBrowser():
- SelectedCount(): returns number of selected objects
- getSelected(i): returns entry of selected object number i
#--------------------------------------------------------------------------
-def PersistentPresentation(theStudy, theSO, theWithID):
+def PersistentPresentation(theSO, theWithID):
# put the sobject's content (with subchildren) to the string
aResult = ""
attrs = theSO.GetAllAttributes()
aResult = "sobject: " + theSO.GetID() + " nbattrs: " + str(aLen - anUncopied) + aResult + '\n'
else:
aResult = " nbattrs: " + str(aLen - anUncopied) + aResult + '\n'
- anIter = theStudy.NewChildIterator(theSO)
+ anIter = myStudy.NewChildIterator(theSO)
while anIter.More():
- aResult += PersistentPresentation(theStudy, anIter.Value(), theWithID)
+ aResult += PersistentPresentation(anIter.Value(), theWithID)
anIter.Next()
return aResult
while aRoot.GetID() != "0:":
aRoot = aRoot.GetFather()
aTree = GetTree(aRoot)
- aStudyPersist = PersistentPresentation(myStudy, aRoot, 1)
+ aStudyPersist = PersistentPresentation(aRoot, 1)
if not myStudy.CanCopy(theSO):
raise RuntimeError, "<CanCopy> for "+theInfo+" returns false"
raise RuntimeError, "<CanPaste> for "+theInfo+" returns false"
# check: before paste study is not changed check
- if aStudyPersist != PersistentPresentation(myStudy, aRoot, 1):
+ if aStudyPersist != PersistentPresentation(aRoot, 1):
raise RuntimeError, "Study is changed before Paste calling for "+theInfo
aSObj = theSO
"""Indicate if GUI is running"""
return False
- def updateObjBrowser(self, bid):
+ def updateObjBrowser(self):
"""update the GUI object browser"""
print "SalomeOutsideGUI: no objectBrowser update outside GUI"
pass
#--------------------------------------------------------------------------
-def PersistentPresentation(theStudy, theSO, theWithID):
+def PersistentPresentation(theSO, theWithID):
# put the sobject's content (with subchildren) to the string
aResult = ""
attrs = theSO.GetAllAttributes()
aResult = "sobject: " + theSO.GetID() + " nbattrs: " + str(aLen - anUncopied) + aResult + '\n'
else:
aResult = " nbattrs: " + str(aLen - anUncopied) + aResult + '\n'
- anIter = theStudy.NewChildIterator(theSO)
+ anIter = myStudy.NewChildIterator(theSO)
while anIter.More():
- aResult += PersistentPresentation(theStudy, anIter.Value(), theWithID)
+ aResult += PersistentPresentation(anIter.Value(), theWithID)
anIter.Next()
return aResult
while aRoot.GetID() != "0:":
aRoot = aRoot.GetFather()
aTree = GetTree(aRoot)
- aStudyPersist = PersistentPresentation(myStudy, aRoot, 1)
+ aStudyPersist = PersistentPresentation(aRoot, 1)
if not myStudy.CanCopy(theSO):
raise RuntimeError, "<CanCopy> for "+theInfo+" returns false"
raise RuntimeError, "<CanPaste> for "+theInfo+" returns false"
# check: before paste study is not changed check
- if aStudyPersist != PersistentPresentation(myStudy, aRoot, 1):
+ if aStudyPersist != PersistentPresentation(aRoot, 1):
raise RuntimeError, "Study is changed before Paste calling for "+theInfo
aSObj = theSO
#--------------------------------------------------------------------------
-def setCurrentStudy(theStudy):
- """
- Change current study : an existing one given by a study object.
-
- :param theStudy: the study CORBA object to set as current study
-
- Obsolete: only one study can be opened at the moment.
- This function works properly if specified theStudy parameter
- corresponds to the currently opened study.
- Kept for backward compatibility only.
- """
- global myStudy, myStudyName
- myStudy = theStudy
- myStudyName = theStudy._get_Name()
- return myStudy, myStudyName
-
- #--------------------------------------------------------------------------
-
def openStudy(theStudyPath):
global myStudy
print "openStudy"
# ---- update object browser
if salome.hasDesktop():
- salome.sg.updateObjBrowser(True);
+ salome.sg.updateObjBrowser();
print
# ---- update object browser
if salome.hasDesktop():
- salome.sg.updateObjBrowser(True);
+ salome.sg.updateObjBrowser();
print
# ---- update object browser
if salome.hasDesktop():
- salome.sg.updateObjBrowser(True);
+ salome.sg.updateObjBrowser();
void ClientFactory::createStudy(CORBA::ORB_ptr orb, PortableServer::POA_ptr poa)
{
- SALOMEDSClient_Study* study = NULL;
#ifdef WIN32
if(!_libHandle) _libHandle = ::LoadLibrary(SALOMEDS_LIB_NAME);
if(!aCreateFactory) aCreateFactory = (STUDY_CREATE_FUNCTION)::GetProcAddress(_libHandle, STUDY_CREATE);
sfp << std::endl;
sfp << "if salome.sg.hasDesktop():" << std::endl;
- sfp << "\tsalome.sg.updateObjBrowser(True)" << std::endl;
+ sfp << "\tsalome.sg.updateObjBrowser()" << std::endl;
if(isDumpVisuals) { //Output the call to Session's method restoreVisualState
sfp << "\tiparameters.getSession().restoreVisualState(1)" << std::endl;