]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
code improvement
authormpa <mpa@opencascade.com>
Thu, 2 Feb 2017 07:45:40 +0000 (10:45 +0300)
committermpa <mpa@opencascade.com>
Thu, 2 Feb 2017 07:45:40 +0000 (10:45 +0300)
16 files changed:
doc/salome/gui/GEOM/input/tui_execution_distribution.doc
src/EntityGUI/EntityGUI_FieldDlg.cxx
src/GEOMBase/GEOMBase_Skeleton.cxx
src/GEOMGUI/GEOMGUI_DimensionProperty.cxx
src/GEOMGUI/GEOMGUI_DimensionProperty.h
src/GEOMGUI/GEOMGUI_Selection.cxx
src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI.h
src/GEOM_I/GEOM_DumpPython.cc
src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_I/GEOM_Gen_i.hh
src/GEOM_SWIG/geomBuilder.py
src/MeasureGUI/MeasureGUI.cxx
src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx

index 595bce263a3d64c7991e9bee3fd348ed5593d824..fbf905c9e35b5ecf52a5a5e698c279e053206797 100644 (file)
@@ -30,7 +30,7 @@ For instance:
 from salome.geom import geomBuilder
 lcc = salome.lcc
 engineGeom = lcc.FindOrLoadComponent("myServer", "GEOM")
-geompy = geomBuilder.New(theStudy, engineGeom)
+geompy = geomBuilder.New(engineGeom)
 \endcode
 
 Or, within a Distributed Python Node of a YACS Schema, where the container
@@ -39,7 +39,7 @@ is already provided in the Python context of the node, with <em>my_container</em
 from salome.geom import geomBuilder
 my_container.load_component_Library("GEOM")
 engineGeom = my_container.create_component_instance("GEOM")
-geompy = geomBuilder.New(theStudy, engineGeom)
+geompy = geomBuilder.New(engineGeom)
 \endcode
 
 
index 2304c3cdff1b084d4bd9e43ea6fda0bc224625f9..a510b08e32199fe5beb9ae2769c40764f9545093 100644 (file)
@@ -1857,7 +1857,7 @@ bool EntityGUI_FieldDlg::isValid(QString& theMessage)
 //=================================================================================
 bool EntityGUI_FieldDlg::execute()
 {
-  SALOMEDS::Study_var aStudyDS = GeometryGUI::GetStudy();
+  SALOMEDS::Study_var aStudyDS = GeometryGUI::getStudyServant();
   SALOMEDS::StudyBuilder_var aBuilder = aStudyDS->NewBuilder();
 
   QString aName = getNewObjectName().trimmed();
index 7b505203c49dbe258c60e698a965d57ebfbe3c55..069fe46ae67291e11f26f0aeadef421a24c48bfc 100644 (file)
@@ -187,7 +187,7 @@ void GEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox,
 void GEOMBase_Skeleton::updateAttributes( GEOM::GEOM_Object_ptr theObj,
                                           const QStringList& theParameters)
 {
-  SALOMEDS::Study_var aStudy = GeometryGUI::GetStudy();
+  SALOMEDS::Study_var aStudy = GeometryGUI::getStudyServant();
   SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
   SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(theObj->GetStudyEntry());
   SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString");
index 95d18097d9c3e2d758ffcb72c147c43c50d5cebc..7c3ed03b1bdc9244172b1f2b77ce5589ad7c9c16 100644 (file)
@@ -30,7 +30,7 @@
 #include <Standard_ProgramError.hxx>
 #include <gp_Trsf.hxx>
 
-#include <SalomeApp_Study.h>
+#include <SalomeApp_Application.h>
 
 // Static patterns for casting value-to-string & value-from-string. The patterns are:
 //  ITEM: { name[string] : visibility : type : values[composite] };
@@ -590,9 +590,9 @@ GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty( const GEOMGUI_DimensionPro
 // function : Init constructor
 // purpose  : 
 //=================================================================================
-GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty( SalomeApp_Study* theStudy, const std::string& theEntry )
+GEOMGUI_DimensionProperty::GEOMGUI_DimensionProperty( const std::string& theEntry )
 {
-  LoadFromAttribute( theStudy, theEntry );
+  LoadFromAttribute( theEntry );
 }
 
 //=================================================================================
@@ -1018,18 +1018,17 @@ int GEOMGUI_DimensionProperty::GetType( const int theIndex ) const
 // function : LoadFromAttribute
 // purpose  : 
 //=================================================================================
-void GEOMGUI_DimensionProperty::LoadFromAttribute( SalomeApp_Study* theStudy,
-                                                   const std::string& theEntry )
+void GEOMGUI_DimensionProperty::LoadFromAttribute( const std::string& theEntry )
 {
   Clear();
 
-  _PTR(SObject) aSObj = theStudy->studyDS()->FindObjectID( theEntry );
+  _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID( theEntry );
   if ( !aSObj )
   {
     return;
   }
 
-  _PTR(StudyBuilder) aBuilder = theStudy->studyDS()->NewBuilder();
+  _PTR(StudyBuilder) aBuilder = SalomeApp_Application::getStudy()->NewBuilder();
 
   _PTR(GenericAttribute) aSeekAtt;
   _PTR(AttributeTableOfReal) aRecordsAtt;
@@ -1076,16 +1075,15 @@ void GEOMGUI_DimensionProperty::LoadFromAttribute( SalomeApp_Study* theStudy,
 // function : SaveToAttribute
 // purpose  : 
 //=================================================================================
-void GEOMGUI_DimensionProperty::SaveToAttribute( SalomeApp_Study *theStudy,
-                                                 const std::string &theEntry )
+void GEOMGUI_DimensionProperty::SaveToAttribute( const std::string &theEntry )
 {
-  _PTR(SObject) aSObj = theStudy->studyDS()->FindObjectID( theEntry );
+  _PTR(SObject) aSObj = SalomeApp_Application::getStudy()->FindObjectID( theEntry );
   if ( !aSObj )
   {
     return;
   }
 
-  _PTR(StudyBuilder) aBuilder = theStudy->studyDS()->NewBuilder();
+  _PTR(StudyBuilder) aBuilder = SalomeApp_Application::getStudy()->NewBuilder();
 
   _PTR(AttributeTableOfReal) aRecordsAtt;
 
index 3ff770055b1b31a242ef84d48ce1468020543571..c42bf998d1cafe6b09edf2c58111b82d54414856 100644 (file)
@@ -326,7 +326,7 @@ public:
    /*!
    * \brief Constructor. Inits property from attribute.
    */
-  GEOMGUI_DimensionProperty( SalomeApp_Study* theStudy, const std::string& theEntry );
+  GEOMGUI_DimensionProperty( const std::string& theEntry );
 
    /*!
    * \brief Constructor. Inits property from formatted QString.
@@ -456,17 +456,15 @@ public:
 
   /*!
    * \brief Loads properties data from attribute "AttributeTableOfReal".
-   * \param theStudy [in] the study.
    * \param theEntry [in] the entry of GEOM object to operate with.
    */
-  void LoadFromAttribute( SalomeApp_Study* theStudy, const std::string& theEntry );
+  void LoadFromAttribute( const std::string& theEntry );
 
   /*!
    * \brief Saves properties data to attribute "AttributeTableOfReal".
-   * \param theStudy [in] the study.
    * \param theEntry [in] the entry of GEOM object to operate with.
    */
-  void SaveToAttribute( SalomeApp_Study* theStudy, const std::string& theEntry );
+  void SaveToAttribute( const std::string& theEntry );
 
 private:
 
index 291be2e156d9b18d9834938d038944fde388eba1..8f1dfa44a4779e1785b589285765e0d51dcaa633 100644 (file)
@@ -799,21 +799,13 @@ bool GEOMGUI_Selection::isFolder( const int index ) const
 
 bool GEOMGUI_Selection::hasDimensions( const int theIndex, bool& theHidden, bool& theVisible ) const
 {
-  SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( study() );
-
-  if ( !appStudy )
-  {
-    return false;
-  }
-
   QString anEntry = entry( theIndex );
-  _PTR(Study) aStudy = appStudy->studyDS();
-  if ( !aStudy || anEntry.isNull() )
+  if ( anEntry.isNull() )
   {
     return false;
   }
 
-  GEOMGUI_DimensionProperty aDimensions( appStudy, anEntry.toStdString() );
+  GEOMGUI_DimensionProperty aDimensions( anEntry.toStdString() );
 
   theHidden  = false;
   theVisible = false;
index 6af17acd2617f799a252ce3d46eeef267027793a..b43d15c754f296850d56c2713bbe8bb372409623 100644 (file)
@@ -170,7 +170,7 @@ void GEOMGUI_TextTreeWdg::updateBranch( const QString& theEntry )
       QString aName = obj->GetName().c_str();
   
       GEOMGUI_DimensionProperty aProp;
-      aProp.LoadFromAttribute( myStudy, theEntry.toStdString() );
+      aProp.LoadFromAttribute( theEntry.toStdString() );
       int nbProps = aProp.GetNumber();
 
       QTreeWidgetItem* objectItem = itemFromEntry( theEntry );
@@ -237,7 +237,7 @@ void GEOMGUI_TextTreeWdg::onItemClicked( QTreeWidgetItem* theItem, int theColumn
   std::string anEntry = entryFromItem( theItem->parent() ).toStdString();
   int aDimIndex = idFromItem( theItem );
   GEOMGUI_DimensionProperty aProp;
-  aProp.LoadFromAttribute( myStudy, anEntry );
+  aProp.LoadFromAttribute( anEntry );
   if ( aProp.IsVisible( aDimIndex ) ) {
     aProp.SetVisible( aDimIndex, false );
     theItem->setIcon( 1, myInvisibleIcon );
@@ -245,7 +245,7 @@ void GEOMGUI_TextTreeWdg::onItemClicked( QTreeWidgetItem* theItem, int theColumn
     aProp.SetVisible( aDimIndex, true );
     theItem->setIcon( 1, myVisibleIcon );
   }
-  aProp.SaveToAttribute( myStudy, anEntry );
+  aProp.SaveToAttribute( anEntry );
   redisplay( anEntry.c_str() );
 }
 
@@ -303,7 +303,7 @@ void GEOMGUI_TextTreeWdg::updateVisibilityColumn( QString theEntry, Qtx::Visibil
   for ( int i=0; i < anItem->childCount(); i++ ) {
     aChildItem = anItem->child( i );
     if ( theState == Qtx::ShownState ) {
-      aProp.LoadFromAttribute( myStudy, theEntry.toStdString() );
+      aProp.LoadFromAttribute( theEntry.toStdString() );
       if ( aProp.GetNumber() == 0 )
        continue;
       aChildItem->setIcon( 1, aProp.IsVisible( idFromItem( aChildItem ) ) ? myVisibleIcon : myInvisibleIcon );
@@ -331,7 +331,7 @@ void GEOMGUI_TextTreeWdg::showContextMenu( const QPoint& pos )
     QString anEntry = entryFromItem( anItem->parent() );
     if ( !anEntry.isEmpty() ) {
       GEOMGUI_DimensionProperty aProp;
-      aProp.LoadFromAttribute( myStudy, anEntry.toStdString() );
+      aProp.LoadFromAttribute( anEntry.toStdString() );
       if ( aProp.GetNumber() == 0 )
        return;
       aMenu.clear();
@@ -401,12 +401,12 @@ void GEOMGUI_TextTreeWdg::setShapeDimensionsVisibility( QString theEntry, bool t
 void GEOMGUI_TextTreeWdg::setDimensionVisibility( QString theEntry, QTreeWidgetItem* theDimItem, bool theVisibility )
 {
   GEOMGUI_DimensionProperty aProp;
-  aProp.LoadFromAttribute( myStudy, theEntry.toStdString() );
+  aProp.LoadFromAttribute( theEntry.toStdString() );
   int aDimIndex = idFromItem( theDimItem );
   if ( aProp.GetNumber() == 0  || aProp.IsVisible( aDimIndex ) == theVisibility )
     return;;
   aProp.SetVisible( aDimIndex, theVisibility );
-  aProp.SaveToAttribute( myStudy, theEntry.toStdString() );
+  aProp.SaveToAttribute( theEntry.toStdString() );
 
   theDimItem->setIcon( 1, theVisibility ? myVisibleIcon : myInvisibleIcon );
   redisplay( theEntry );
index 5ddf00ebcb725adcf2f7d34273f0985e201dc642..0e254273daa1b5ce847406244f1e92921866d7d7 100644 (file)
@@ -1260,7 +1260,7 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t
   }
   else
   {
-    aRecords.LoadFromAttribute( getStudy(), theIO->getEntry() );
+    aRecords.LoadFromAttribute( theIO->getEntry() );
   }
   
   // create up-to-date dimension presentations
index 09ef1e3493d2818976412d570f15dd05a75c0cc2..c81f9ee068360a70eb2e6c4926dd8134dbc2987e 100644 (file)
@@ -180,7 +180,7 @@ CORBA::Object_var GeometryGUI::ClientSObjectToObject (_PTR(SObject) theSObject)
 // function : GetStudy
 // purpose  :
 //=======================================================================
-SALOMEDS::Study_var GeometryGUI::GetStudy()
+SALOMEDS::Study_var GeometryGUI::getStudyServant()
 {
   SALOME_NamingService *aNamingService = SalomeApp_Application::namingService();
   CORBA::Object_var aStudyObject = aNamingService->Resolve("/Study");
@@ -2934,7 +2934,7 @@ void GeometryGUI::storeVisualParameters (int savePoint)
     std::string aStudyEntry = (*aEntryIt).toLatin1().data();
     std::string aStoreEntry = ip->encodeEntry( aStudyEntry, componentName);
 
-    GEOMGUI_DimensionProperty aDimensions( appStudy, aStudyEntry );
+    GEOMGUI_DimensionProperty aDimensions( aStudyEntry );
 
     if ( aDimensions.GetNumber() == 0 )
     {
@@ -3022,7 +3022,7 @@ void GeometryGUI::restoreVisualParameters (int savePoint)
         if ( aParamNameStr == GEOM::propertyName( GEOM::Dimensions ) )
         {
           GEOMGUI_DimensionProperty aDimensionProp( aValuesStr );
-          aDimensionProp.SaveToAttribute( appStudy, entry.toLatin1().data() );
+          aDimensionProp.SaveToAttribute( entry.toLatin1().data() );
         }
 
         continue;
index 5c7718cc51bd7f5cef632f187ae087be0f147f77..3d40f1611c411f28f2d918bfe2e5e835275bfb74 100644 (file)
@@ -92,7 +92,7 @@ public:
   static  GEOM::GEOM_Gen_var  GetGeomGen();
 
   static CORBA::Object_var    ClientSObjectToObject (_PTR(SObject) theSObject);
-  static SALOMEDS::Study_var  GetStudy();
+  static SALOMEDS::Study_var  getStudyServant();
 
   static void                 Modified( bool = true );
 
index 15f4ea8f9170cac1aba0caf1e5f8584640f9e6ac..d948bc9662cf052725297812d7cc555989bf34bf 100644 (file)
@@ -87,7 +87,7 @@ Engines::TMPFile* GEOM_Gen_i::DumpPython(CORBA::Boolean isPublished,
                                          CORBA::Boolean isMultiFile,
                                          CORBA::Boolean& isValidScript)
 {
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   if(CORBA::is_nil(aStudy))
     return new Engines::TMPFile(0);   
 
index 92dd756e4c0b0c2dc091936d9d392d84a234c731..ea80779749eb07f4896508bc7eb32426f33cf0ac 100644 (file)
@@ -215,7 +215,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::SObject_ptr theSObjec
 {
   Unexpect aCatch(SALOME_SalomeException);
   SALOMEDS::SObject_var aResultSO;
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   if(CORBA::is_nil(theObject) || aStudy->_is_nil()) return aResultSO;
   GEOM::GEOM_BaseObject_var aBaseObj = GEOM::GEOM_BaseObject::_narrow(theObject);
   GEOM::GEOM_Object_var       aShape = GEOM::GEOM_Object::_narrow(theObject);
@@ -595,7 +595,7 @@ SALOMEDS::TMPFile* GEOM_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent,
   TCollection_AsciiString aNameWithExt("");
   if (isMultiFile)
     aNameWithExt = TCollection_AsciiString((char*)(SALOMEDS_Tool::GetNameFromPath
-                                                   (GetStudy()->URL())).c_str());
+                                                   (getStudyServant()->URL())).c_str());
 #if OCC_VERSION_MAJOR > 6
   aNameWithExt += TCollection_AsciiString("_GEOM.cbf");
 #else
@@ -661,7 +661,7 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
 
   // Prepare a file name to open
   TCollection_AsciiString aNameWithExt("");
-  SALOMEDS::Study_var study = GetStudy();
+  SALOMEDS::Study_var study = getStudyServant();
 
 #if OCC_VERSION_MAJOR > 6
   // Get the file name.
@@ -800,7 +800,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PasteInto(const SALOMEDS::TMPFile& theStream,
                                             CORBA::Long theObjectID,
                                             SALOMEDS::SObject_ptr theObject) {
   // Find the current Study and StudyBuilder
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
   SALOMEDS::UseCaseBuilder_var anUseCaseBuilder = aStudy->GetUseCaseBuilder();
   SALOMEDS::SObject_var aNewSO;
@@ -865,7 +865,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::AddInStudy (GEOM::GEOM_BaseObject_ptr theObjec
                                               GEOM::GEOM_BaseObject_ptr theFather)
 {
   SALOMEDS::SObject_var aResultSO;
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   if(theObject->_is_nil() || aStudy->_is_nil()) return aResultSO;
 
   SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
@@ -917,7 +917,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesO (GEOM::GEOM_Object_ptr   theObject
                                                CORBA::Boolean          theAddPrefix)
 {
   GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   if (CORBA::is_nil(aStudy) || CORBA::is_nil(theObject))
     return aParts._retn();
 
@@ -947,12 +947,12 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesO (GEOM::GEOM_Object_ptr   theO
                                                     CORBA::Boolean          theAddPrefix)
 {
   GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
-  if (CORBA::is_nil(GetStudy()) || CORBA::is_nil(theObject))
+  if (CORBA::is_nil(getStudyServant()) || CORBA::is_nil(theObject))
     return aParts._retn();
 
   // find SObject in the study if it is already published
   CORBA::String_var anIORo = _orb->object_to_string(theObject);
-  SALOMEDS::SObject_var aSO = GetStudy()->FindObjectIOR(anIORo.in());
+  SALOMEDS::SObject_var aSO = getStudyServant()->FindObjectIOR(anIORo.in());
   //PTv, IMP 0020001, The salome object <aSO>
   // is not obligatory in case of invokation from script
   // if (CORBA::is_nil(aSO))
@@ -976,7 +976,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesSO (SALOMEDS::SObject_ptr   theSObje
                                                 CORBA::Boolean          theAddPrefix)
 {
   GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
-  if (CORBA::is_nil(GetStudy()) || CORBA::is_nil(theSObject))
+  if (CORBA::is_nil(getStudyServant()) || CORBA::is_nil(theSObject))
     return aParts._retn();
 
   SALOMEDS::GenericAttribute_var anAttr;
@@ -1035,7 +1035,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapes(GEOM::GEOM_Object_ptr   theObject,
                                              CORBA::Boolean          theAddPrefix)
 {
   GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   //PTv, IMP 0020001, The salome object <theSObject>
   //     is not obligatory in case of invokation from script
   if (CORBA::is_nil(aStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/)
@@ -1408,7 +1408,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreSubShapesOneLevel (SALOMEDS::SObject_ptr   th
                                                       CORBA::Boolean          theAddPrefix)
 {
   int i = 0;
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
   GEOM::ListOfGO_var aNewParts = new GEOM::ListOfGO;
   if (CORBA::is_nil(aStudy) || CORBA::is_nil(theOldSO) ||
@@ -1628,7 +1628,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapes(GEOM::GEOM_Object_ptr   theObj
                                                   CORBA::Boolean          theAddPrefix)
 {
   GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   //PTv, IMP 0020001, The salome object <theSObject>
   //     is not obligatory in case of invokation from script
   if (CORBA::is_nil(aStudy) || CORBA::is_nil(theObject) /*|| CORBA::is_nil(theSObject)*/)
@@ -1952,7 +1952,7 @@ GEOM::ListOfGO* GEOM_Gen_i::RestoreGivenSubShapesOneLevel (SALOMEDS::SObject_ptr
                                                            CORBA::Boolean          theAddPrefix)
 {
   int i = 0;
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   GEOM::ListOfGO_var aParts = new GEOM::ListOfGO;
   GEOM::ListOfGO_var aNewParts = new GEOM::ListOfGO;
   if (CORBA::is_nil(aStudy) || CORBA::is_nil(theOldSO) ||
@@ -2170,10 +2170,10 @@ void GEOM_Gen_i::register_name(char * name)
 }
 
 //============================================================================
-// function : GetStudy()
+// function : getStudyServant()
 // purpose  : Get Study
 //============================================================================
-SALOMEDS::Study_var GEOM_Gen_i::GetStudy()
+SALOMEDS::Study_var GEOM_Gen_i::getStudyServant()
 {
   static SALOMEDS::Study_var aStudy;
   if(CORBA::is_nil(aStudy)){
@@ -2684,7 +2684,7 @@ char* GEOM_Gen_i::getObjectInfo(const char* entry)
 {
   GEOM::GEOM_Object_var aGeomObject;
 
-  SALOMEDS::SObject_var aSObj = GetStudy()->FindObjectID( entry );
+  SALOMEDS::SObject_var aSObj = getStudyServant()->FindObjectID( entry );
   SALOMEDS::SObject_var aResultSObj;
   if (aSObj->ReferencedObject(aResultSObj))
     aSObj = aResultSObj;
@@ -2694,7 +2694,7 @@ char* GEOM_Gen_i::getObjectInfo(const char* entry)
     SALOMEDS::AttributeIOR_var anIOR = SALOMEDS::AttributeIOR::_narrow(anAttr);
     CORBA::String_var aVal = anIOR->Value();
     anIOR->UnRegister();
-    CORBA::Object_var anObject = GetStudy()->ConvertIORToObject(aVal);
+    CORBA::Object_var anObject = getStudyServant()->ConvertIORToObject(aVal);
     aGeomObject = GEOM::GEOM_Object::_narrow(anObject);
   }
   if (!aSObj->_is_nil() )
@@ -2858,7 +2858,7 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::CreateFolder(const char* theName,
     aLocalID->UnRegister();
   }
 
-  SALOMEDS::Study_var aStudy = GetStudy();
+  SALOMEDS::Study_var aStudy = getStudyServant();
   SALOMEDS::StudyBuilder_var aStudyBuilder( aStudy->NewBuilder() );
   aFolderSO = aStudyBuilder->NewObject( theFather );
 
@@ -2893,7 +2893,7 @@ void GEOM_Gen_i::MoveToFolder(GEOM::GEOM_Object_ptr theObject,
                               SALOMEDS::SObject_ptr theFolder) {
   GEOM::object_list_var objects = new GEOM::object_list();
   objects->length( 1 );
-  SALOMEDS::SObject_var aSO = GetStudy()->FindObjectID( theObject->GetStudyEntry() );
+  SALOMEDS::SObject_var aSO = getStudyServant()->FindObjectID( theObject->GetStudyEntry() );
   objects[0] = aSO;
   Move( objects, theFolder, -1 );
 }
@@ -2911,7 +2911,7 @@ void GEOM_Gen_i::MoveListToFolder (const GEOM::ListOfGO& theListOfGO,
   SALOMEDS::SObject_var aSO;
   for (int i = 0; i < aLen; i++) {
     aGO = GEOM::GEOM_Object::_duplicate( theListOfGO[i] );
-    aSO = GetStudy()->FindObjectID( aGO->GetStudyEntry() );
+    aSO = getStudyServant()->FindObjectID( aGO->GetStudyEntry() );
     objects[i] = aSO;
   }
   if ( objects->length() > 0 )
@@ -2929,7 +2929,7 @@ void GEOM_Gen_i::Move( const GEOM::object_list& what,
 {
   if ( CORBA::is_nil( where ) ) return;
 
-  SALOMEDS::Study_var study = GetStudy();
+  SALOMEDS::Study_var study = getStudyServant();
   SALOMEDS::StudyBuilder_var studyBuilder = study->NewBuilder();
   SALOMEDS::UseCaseBuilder_var useCaseBuilder = study->GetUseCaseBuilder();
   SALOMEDS::SComponent_var father = where->GetFatherComponent();
index 6ffba33e8ecc23e278229d7869de09008d34cb00..7e2aec814cdfd5aa94850a72e32fc19ef87cff74 100644 (file)
@@ -109,7 +109,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
   SALOME_NamingService* GetNS() { return name_service; }
 
   // Get Study
-  SALOMEDS::Study_var GetStudy();
+  SALOMEDS::Study_var getStudyServant();
 
   //-----------------------------------------------------------------------//
   // Inherited methods from SALOMEDS::Driver                               //
index 69bbe46b0531b9ab717dbecc059226c4096f4c03..b7fa036dd77735de9ca0ab68346be2fe56e581a7 100644 (file)
@@ -752,11 +752,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
         ## @addtogroup l1_geomBuilder_auxiliary
         ## @{
-        def init_geom(self,theStudy):
-            self.myStudy = theStudy
+        def init_geom(self):
+            self.myStudy = salome.myStudy
             self.myBuilder = self.myStudy.NewBuilder()
             self.father = self.myStudy.FindComponent("GEOM")
-            notebook.myStudy = theStudy
+            notebook.myStudy = salome.myStudy
             if self.father is None:
                 self.father = self.myBuilder.NewComponent("GEOM")
                 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
index 7547b4266b62f9d185375869ee27a6e19d62c018..4a5e476ebd15e6e47bef0f2ce7a00fb60e1de715 100644 (file)
@@ -178,12 +178,6 @@ void MeasureGUI::ChangeDimensionsVisibility( const bool theIsVisible )
     return;
   }
 
-  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( anApp->activeStudy() );
-  if ( !aStudy )
-  {
-    return;
-  }
-
   LightApp_SelectionMgr* aSelMgr = anApp->selectionMgr();
   if ( !aSelMgr )
   {
@@ -205,14 +199,15 @@ void MeasureGUI::ChangeDimensionsVisibility( const bool theIsVisible )
 
   SUIT_OverrideCursor wc;
 
-  GEOMGUI_DimensionProperty aDimensions( aStudy, anIObject->getEntry() );
+  std::string anEntry(anIObject->getEntry());
+  GEOMGUI_DimensionProperty aDimensions( anEntry );
 
   for ( int anIt = 0; anIt < aDimensions.GetNumber(); ++anIt )
   {
     aDimensions.SetVisible( anIt, theIsVisible );
   }
 
-  aDimensions.SaveToAttribute( aStudy, anIObject->getEntry() );
+  aDimensions.SaveToAttribute( anIObject->getEntry() );
 
   GEOM_Displayer().Redisplay( anIObject, true );
 }
index b0e199d3de7ec112deef897f676119888f65676f..94c7d08d4897860e8d8fe8bc58cfe8e2969df99b 100644 (file)
@@ -770,7 +770,7 @@ bool MeasureGUI_ManageDimensionsDlg::ClickOnApply()
                                QVariant() )
                                .value<GEOMGUI_DimensionProperty>();
 
-  mySavedPropertyState.SaveToAttribute( aStudy, myEditObject->GetStudyEntry() );
+  mySavedPropertyState.SaveToAttribute( myEditObject->GetStudyEntry() );
 
   myGeomGUI->emitDimensionsUpdated( QString( myEditObject->GetStudyEntry() ) );
 
@@ -919,7 +919,7 @@ void MeasureGUI_ManageDimensionsDlg::SetEditObject( const GEOM::GeomObjPtr& theO
     return;
   }
 
-  mySavedPropertyState.LoadFromAttribute( getStudy(), myEditObject->GetStudyEntry() );
+  mySavedPropertyState.LoadFromAttribute( myEditObject->GetStudyEntry() );
 
   // set property state for preview
   aStudy->setObjectProperty( GEOM::sharedPropertiesId(),