Salome HOME
Merge multi-study removal branch.
[modules/geom.git] / src / GEOM_I / GEOM_Gen_i.hh
index 34641ec7ece1f483e477d309a265aea3d83856fd..7e2aec814cdfd5aa94850a72e32fc19ef87cff74 100644 (file)
@@ -71,7 +71,6 @@ class GEOM_I_EXPORT GEOM_GenericOperationsCreator
 public:
   // Create operations
   virtual GEOM_IOperations_i* Create (PortableServer::POA_ptr thePOA,
-                                      int                     theStudyId,
                                       GEOM::GEOM_Gen_ptr      theEngine,
                                       ::GEOMImpl_Gen*         theGenImpl) = 0;
   // return the name of IDL module
@@ -109,6 +108,9 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
   // Get Naming Service object
   SALOME_NamingService* GetNS() { return name_service; }
 
+  // Get Study
+  SALOMEDS::Study_var getStudyServant();
+
   //-----------------------------------------------------------------------//
   // Inherited methods from SALOMEDS::Driver                               //
   //-----------------------------------------------------------------------//
@@ -145,13 +147,11 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
                                CORBA::Boolean isASCII);
 
   bool CanPublishInStudy(CORBA::Object_ptr theIOR);
-  SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::Study_ptr theStudy,
-                                       SALOMEDS::SObject_ptr theSObject,
+  SALOMEDS::SObject_ptr PublishInStudy(SALOMEDS::SObject_ptr theSObject,
                                        CORBA::Object_ptr theObject,
                                        const char* theName) throw (SALOME::SALOME_Exception) ;
 
-  GEOM::ListOfGO* PublishNamedShapesInStudy(SALOMEDS::Study_ptr theStudy,
-                                            CORBA::Object_ptr theObject);
+  GEOM::ListOfGO* PublishNamedShapesInStudy(CORBA::Object_ptr theObject);
 
   CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
   SALOMEDS::TMPFile* CopyFrom(SALOMEDS::SObject_ptr theObject, CORBA::Long& theObjectID);
@@ -163,16 +163,14 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
   /*! \brief Adds theObject in the study with a name = theName, if
    *         theFather is not null the object is placed under theFather
    */
-  SALOMEDS::SObject_ptr AddInStudy (SALOMEDS::Study_ptr       theStudy,
-                                    GEOM::GEOM_BaseObject_ptr theObject,
+  SALOMEDS::SObject_ptr AddInStudy (GEOM::GEOM_BaseObject_ptr theObject,
                                     const char*               theName,
                                     GEOM::GEOM_BaseObject_ptr theFather);
 
   /*! \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments.
    *         To be used from python scripts out of geompy.addToStudy (non-default usage)
    */
-  GEOM::ListOfGO* RestoreSubShapesO (SALOMEDS::Study_ptr     theStudy,
-                                     GEOM::GEOM_Object_ptr   theObject,
+  GEOM::ListOfGO* RestoreSubShapesO (GEOM::GEOM_Object_ptr   theObject,
                                      const GEOM::ListOfGO&   theArgs,
                                      GEOM::find_shape_method theFindMethod,
                                      CORBA::Boolean          theInheritFirstArg,
@@ -181,8 +179,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
   /*! \brief Publish sub-shapes, standing for given in \a theArgs arguments and sub-shapes.
    *         To be used from python scripts, generated by Dump Python.
    */
-  GEOM::ListOfGO* RestoreGivenSubShapesO (SALOMEDS::Study_ptr     theStudy,
-                                          GEOM::GEOM_Object_ptr   theObject,
+  GEOM::ListOfGO* RestoreGivenSubShapesO (GEOM::GEOM_Object_ptr   theObject,
                                           const GEOM::ListOfGO&   theArgs,
                                           GEOM::find_shape_method theFindMethod,
                                           CORBA::Boolean          theInheritFirstArg,
@@ -191,86 +188,83 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
   /*! \brief Publish sub-shapes, standing for arguments and sub-shapes of arguments.
    *         To be used from GUI and from geompy.addToStudy
    */
-  GEOM::ListOfGO* RestoreSubShapesSO (SALOMEDS::Study_ptr     theStudy,
-                                      SALOMEDS::SObject_ptr   theSObject,
+  GEOM::ListOfGO* RestoreSubShapesSO (SALOMEDS::SObject_ptr   theSObject,
                                       const GEOM::ListOfGO&   theArgs,
                                       GEOM::find_shape_method theFindMethod,
                                       CORBA::Boolean          theInheritFirstArg,
                                       CORBA::Boolean          theAddPrefix);
 
   //Collects dependencies of the given objects from other ones
-  SALOMEDS::TMPFile* GetDependencyTree(SALOMEDS::Study_ptr theStudy,
-                                       const GEOM::string_array& theObjectEntries);
+  SALOMEDS::TMPFile* GetDependencyTree(const GEOM::string_array& theObjectEntries);
 
   //-----------------------------------------------------------------------//
   // Transaction methods                                                   //
   //-----------------------------------------------------------------------//
 
-  //Undos one transaction in the document associated with theStudyID
-  virtual void Undo(CORBA::Long theStudyID);
+  //Undos one transaction in the document
+  virtual void Undo();
 
-  //Redos one transaction in the document associated with theStudyID
-  virtual void Redo(CORBA::Long theStudyID);
+  //Redos one transaction in the document
+  virtual void Redo();
 
   //-----------------------------------------------------------------------//
   // Operations methods                                                    //
   //-----------------------------------------------------------------------//
 
   //Returns a pointer to BasicOperations interface
-  virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_IBasicOperations_ptr GetIBasicOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to TransformOperations interface
-  virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_ITransformOperations_ptr GetITransformOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to 3DPrimOperations interface
-  virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_I3DPrimOperations_ptr GetI3DPrimOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to ShapesOperations interface
-  virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_IShapesOperations_ptr GetIShapesOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to BlocksOperations interface
-  virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_IBlocksOperations_ptr GetIBlocksOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to BooleanOperations interface
-  virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_IBooleanOperations_ptr GetIBooleanOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to CurvesOperations interface
-  virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_ICurvesOperations_ptr GetICurvesOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to LocalOperations interface
-  virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_ILocalOperations_ptr GetILocalOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to HealingOperations interface
-  virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_IHealingOperations_ptr GetIHealingOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to InsertOperations interface
-  virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_IInsertOperations_ptr GetIInsertOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to MeasureOperations interface
-  virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_IMeasureOperations_ptr GetIMeasureOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to GroupOperations interface
-  virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_IGroupOperations_ptr GetIGroupOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to FiedlOperations interface
-  virtual GEOM::GEOM_IFieldOperations_ptr GetIFieldOperations (CORBA::Long theStudyID)
+  virtual GEOM::GEOM_IFieldOperations_ptr GetIFieldOperations()
     throw (SALOME::SALOME_Exception);
 
   //Returns a pointer to corresponding plugin operations interface
-  virtual GEOM::GEOM_IOperations_ptr GetPluginOperations (CORBA::Long theStudyID,
-                                                          const char* theLibName)
+  virtual GEOM::GEOM_IOperations_ptr GetPluginOperations (const char* theLibName)
     throw (SALOME::SALOME_Exception);
 
   //Adds a new sub-shape
@@ -283,8 +277,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
 
   virtual GEOM::GEOM_Object_ptr GetIORFromString(const char* stringIOR);
 
-  virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
-                                       CORBA::Boolean isPublished,
+  virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
                                        CORBA::Boolean isMultiFile,
                                        CORBA::Boolean& isValidScript);
 
@@ -294,7 +287,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
 
   // Object information
   virtual bool hasObjectInfo();
-  virtual char* getObjectInfo(CORBA::Long studyId, const char* entry);
+  virtual char* getObjectInfo(const char* entry);
 
   // Version information
   virtual char* getVersion();
@@ -319,8 +312,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
   /*! \brief Fills 3 lists that is used to clean study of redundant objects.
    *         To be used from GUI.
    */
-  void GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
-                               GEOM::string_array& theSelectedEntries,
+  void GetEntriesToReduceStudy(GEOM::string_array& theSelectedEntries,
                                GEOM::string_array& theParentEntries,
                                GEOM::string_array& theSubEntries,
                                GEOM::string_array& theOtherEntries);
@@ -329,35 +321,31 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
   // Internal methods                                                      //
   //-----------------------------------------------------------------------//
 
-  virtual GEOM::GEOM_BaseObject_ptr GetObject(CORBA::Long theStudyID, const char* theEntry);
+  virtual GEOM::GEOM_BaseObject_ptr GetObject(const char* theEntry);
 
  private:
-  GEOM::ListOfGO* RestoreSubShapes (SALOMEDS::Study_ptr     theStudy,
-                                    GEOM::GEOM_Object_ptr   theObject,
+  GEOM::ListOfGO* RestoreSubShapes (GEOM::GEOM_Object_ptr   theObject,
                                     SALOMEDS::SObject_ptr   theSObject,
                                     const GEOM::ListOfGO&   theArgs,
                                     GEOM::find_shape_method theFindMethod,
                                     CORBA::Boolean          theInheritFirstArg,
                                     CORBA::Boolean          theAddPrefix);
 
-  GEOM::ListOfGO* RestoreSubShapesOneLevel (SALOMEDS::Study_ptr     theStudy,
-                                            SALOMEDS::SObject_ptr   theOldSO,
+  GEOM::ListOfGO* RestoreSubShapesOneLevel (SALOMEDS::SObject_ptr   theOldSO,
                                             SALOMEDS::SObject_ptr   theNewSO,
                                             GEOM::GEOM_Object_ptr   theNewO,
                                             GEOM::ListOfGO&         theOutArgs,
                                             GEOM::find_shape_method theFindMethod,
                                             CORBA::Boolean          theAddPrefix);
 
-  GEOM::ListOfGO* RestoreGivenSubShapes (SALOMEDS::Study_ptr     theStudy,
-                                         GEOM::GEOM_Object_ptr   theObject,
+  GEOM::ListOfGO* RestoreGivenSubShapes (GEOM::GEOM_Object_ptr   theObject,
                                          SALOMEDS::SObject_ptr   theSObject,
                                          const GEOM::ListOfGO&   theArgs,
                                          GEOM::find_shape_method theFindMethod,
                                          CORBA::Boolean          theInheritFirstArg,
                                          CORBA::Boolean          theAddPrefix);
 
-  GEOM::ListOfGO* RestoreGivenSubShapesOneLevel (SALOMEDS::Study_ptr     theStudy,
-                                                 SALOMEDS::SObject_ptr   theOldSO,
+  GEOM::ListOfGO* RestoreGivenSubShapesOneLevel (SALOMEDS::SObject_ptr   theOldSO,
                                                  SALOMEDS::SObject_ptr   theNewSO,
                                                  GEOM::GEOM_Object_ptr   theNewO,
                                                  std::set<std::string>   theArgs,
@@ -365,8 +353,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
                                                  CORBA::Boolean          theAddPrefix);
 
   // auxilary for PublishNamedShapesInStudy
-  void CreateAndPublishGroup(SALOMEDS::Study_ptr theStudy,
-                             GEOM::GEOM_Object_var theMainShape,
+  void CreateAndPublishGroup(GEOM::GEOM_Object_var theMainShape,
                              const TopTools_IndexedMapOfShape& anIndices,
                              const TopTools_SequenceOfShape& SeqS,
                              const TColStd_SequenceOfAsciiString& SeqN,
@@ -389,8 +376,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
                                  std::set<std::string>& aChildren,
                                  std::set<std::string>& anOthers);
 
-  void includeSubObjects(SALOMEDS::Study_ptr theStudy,
-                         const std::string& aSelectedEntry,
+  void includeSubObjects(const std::string& aSelectedEntry,
                          std::set<std::string>& aSelected,
                          std::set<std::string>& aParents,
                          std::set<std::string>& aChildren,