Salome HOME
fix problem with clearing study from GUI
[modules/kernel.git] / doc / salome / kernel_salome.dox
index d36db176a50b3a60ab0c3af3cb46b4eef125d529..72ac05c4644b96a6eb488a7c83b508f8081267fc 100644 (file)
@@ -72,46 +72,7 @@ geom = salome.lcc.FindOrLoadComponent('FactoryServer', 'GEOM')
 \b Note, that in the above example, \e "FactoryServer" is a name of the
 SALOME container, where Geometry module engine should be loaded.
 
-\li \b myStudyManager Reference to the study manager
-
-SALOMEDS Study manager is used to manipulate with the studies: create,
-open, save, close. It also can be used to find the study by its
-numerical ID or name. The code below demonstrates main
-functionalities of a study manager:
-\code
-# create new study with the name "MyStudy"
-new_study = salome.myStudyManager.NewStudy("MyStudy")
-
-# open study from file /home/user/MyStudy.hdf
-study = salome.myStudyManager.OpenStudy("/home/user/MyStudy.hdf")
-
-# save study
-salome.myStudyManager.Save(study, False) # not using multifile save mode
-
-# save study in ASCII format
-salome.myStudyManager.SaveASCII(study, True) # using multifile save mode
-
-# save study with the new file path
-salome.myStudyManager.SaveAs("/home/user/MyStudy.hdf", study, False)
-
-# save study with the new file path in ASCII format
-salome.myStudyManager.SaveAsASCII("/home/user/MyStudy.hdf", study, False)
-
-# close study
-salome.myStudyManager.Close(study)
-
-# get list of all opened studies
-studies = salome.myStudyManager.GetOpenStudies()
-
-# find study by its numerical ID (integer value starting from 1)
-study = salome.myStudyManager.GetStudyByID(studyID)
-
-# find study by its name
-study = salome.myStudyManager.GetStudyByName("/home/user/MyStudy.hdf")
-
-# ...
-\endcode
-
+\anchor salome_myStudy
 \li \b myStudy Reference to the current (active) study
 
 This variable can be used to manipulate with the date of the study:
@@ -135,8 +96,26 @@ documentation.
 # get study name
 studyName = salome.myStudy._get_Name()
 
-# get study numerical ID
-studyID = salome.myStudy._get_StudyId()
+# open study from file /home/user/MyStudy.hdf
+salome.myStudy.Open("/home/user/MyStudy.hdf")
+
+# save study
+salome.myStudy.Save(False, False) # not using multifile save mode
+
+# save study in ASCII format
+salome.myStudy.Save(True, True) # using multifile save mode
+
+# save study with the new file path
+salome.myStudy.SaveAs("/home/user/MyStudy.hdf", False, False)
+
+# save study with the new file path in ASCII format
+salome.myStudy.SaveAs("/home/user/MyStudy.hdf", False, True)
+
+# clear study
+salome.myStudy.Clear()
+
+# init study
+salome.myStudy.Init()
 
 # find SALOMEDS component by its type
 scomponent = FindComponent("MyComponent")
@@ -191,12 +170,6 @@ while iter.More():
 # ...
 \endcode
 
-\li \b myStudyId Identifier of the current (active) study
-
-This variable contains the numerical identifier of the current
-(active) study. It is an equivalent of \c
-salome.myStudy._get_StudyId() code.
-
 \li \b myStudyName Name of the current (active) study
 
 This variable contains the name of the current (active) study. It is
@@ -209,7 +182,7 @@ window. The output for each object includes its entry ID, name, IOR
 (if there is one) and referenced object ID (for references). I.e.
 this is the same data the user can see in the Object Browser columns.
 \code
-salome.DumpStudy(salome.myStudy)
+salome.DumpStudy()
 \endcode
 
 \li \b IDToSObject() Get SALOMEDS object by its entry ID.
@@ -278,15 +251,6 @@ else:
    entry = ""
 \endcode
 
-\li \b createNewStudy() Create new study
-
-This function can be used to create new SALOME study. Returns an ID of
-the created study.
-\code
-studyId = salome.createNewStudy()
-study   = salome.myStudyManager.GetStudyByID(s)
-\endcode
-
 \li \b generateName() Generate unique name
 
 This function adds random numerical suffix to the passed string
@@ -296,4 +260,37 @@ name_1 = salome.generateName() # name_1 is something like "Study682"
 name_1 = salome.generateName("Obj") # name_1 is something like "Obj32"
 \endcode
 
+\li \b GetComponentVersion() Get version of component data stored in
+the study
+
+This function allows to obtain the version of the component data
+stored in the current study.
+\note This function does not provide a current version of the
+component being used but that one initially stored in the study
+document.
+
+The first parameter specifies the name of the component. If the
+specified component data is not stored in the study, the result value
+is "no component data". If the version of data is undefined, the
+result is "unknown".
+
+The second parameter (\c False by default), when set to \c True,
+allows to retrieve all versions of the component data stored in the
+study. This is useful to check if version information is valid (the
+data might be updated and/or re-stored in %SALOME of versions different
+from initial one). 
+
+\code
+# get initial version of GEOM module data stored in the study
+geom_version = salome.GetComponentVersion('GEOM')
+# get all versions of GEOM module data stored in the study
+all_geom_versions = salome.GetComponentVersion('GEOM', True)
+\endcode
+
+This function is introduced in %SALOME 6.6.0 (it does not work with
+studies created before version 6.6.0).
+
+\note The study should be initialized before calling this function
+(see \ref salome_myStudy "salome.myStudy").
+
 */