]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Replace direct "Interface Applicative" usage by the function call
authorvsr <vsr@opencascade.com>
Mon, 17 Jan 2011 17:05:25 +0000 (17:05 +0000)
committervsr <vsr@opencascade.com>
Mon, 17 Jan 2011 17:05:25 +0000 (17:05 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/SalomeApp_Study.h
src/SalomeApp/SalomeApp_VisualState.cxx

index aa203c52337f7660970749f731f850a4328cff32..1525e1b1027e3f508ce3734ada59f4c9389a4de9 100644 (file)
@@ -1285,7 +1285,7 @@ void SalomeApp_Application::updateObjectBrowser( const bool updateModels )
       {
         _PTR(SComponent) aComponent ( it->Value() );
 
-        if ( aComponent->ComponentDataType() == "Interface Applicative" )
+        if ( aComponent->ComponentDataType() == study->getVisualComponentName().toLatin1().constData() )
           continue; // skip the magic "Interface Applicative" component
 
         if ( !objectBrowser() )
index bb69f84be1fc30560b0a4227429ea25df6bf3912..f1e026db2438bae30974086cf384cbc7a2a92b6c 100644 (file)
@@ -860,9 +860,9 @@ void SalomeApp_Study::components( QStringList& comps ) const
   for( _PTR(SComponentIterator) it ( studyDS()->NewComponentIterator() ); it->More(); it->Next() ) 
   {
     _PTR(SComponent) aComponent ( it->Value() );
-    if( aComponent && aComponent->ComponentDataType() == "Interface Applicative" )
-      continue; // skip the magic "Interface Applicative" component
-    comps.append( aComponent->ComponentDataType().c_str() );
+    // skip the magic "Interface Applicative" component
+    if ( aComponent && aComponent->ComponentDataType() != getVisualComponentName().toLatin1().constData() )
+      comps.append( aComponent->ComponentDataType().c_str() );
   }
 }
 
@@ -890,7 +890,7 @@ std::vector<int> SalomeApp_Study::getSavePoints()
 {
   std::vector<int> v;
 
-  _PTR(SObject) so = studyDS()->FindComponent("Interface Applicative");
+  _PTR(SObject) so = studyDS()->FindComponent( getVisualComponentName().toLatin1().constData() );
   if(!so) return v;
 
   _PTR(StudyBuilder) builder = studyDS()->NewBuilder();
@@ -911,7 +911,7 @@ std::vector<int> SalomeApp_Study::getSavePoints()
 void SalomeApp_Study::removeSavePoint(int savePoint)
 {
   if(savePoint <= 0) return;
- _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
+ _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint);
   _PTR(SObject) so = AP->GetSObject();
   _PTR(StudyBuilder) builder = studyDS()->NewBuilder();
   builder->RemoveObjectWithChildren(so);
@@ -922,7 +922,7 @@ void SalomeApp_Study::removeSavePoint(int savePoint)
 */
 QString SalomeApp_Study::getNameOfSavePoint(int savePoint)
 {
-  _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
+  _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint);
   _PTR(IParameters) ip = ClientFactory::getIParameters(AP);
   return ip->getProperty("AP_SAVEPOINT_NAME").c_str();
 }
@@ -932,19 +932,11 @@ QString SalomeApp_Study::getNameOfSavePoint(int savePoint)
 */
 void SalomeApp_Study::setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint)
 {
-  _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName(), savePoint);
+  _PTR(AttributeParameter) AP = studyDS()->GetCommonParameters(getVisualComponentName().toLatin1().constData(), savePoint);
   _PTR(IParameters) ip = ClientFactory::getIParameters(AP);
   ip->setProperty("AP_SAVEPOINT_NAME", nameOfSavePoint.toStdString());
 }
 
-/*!
-  \return a name of the component where visual parameters are stored
-*/
-std::string SalomeApp_Study::getVisualComponentName()
-{
-  return "Interface Applicative";
-}
-
 /*!
  * \brief Restores the study state
  */
index de95f130d865fa5977b0a45dd3da94961cc3fc06..59feb8085551ea5c1d0c3aa2bd94a60a6f3326da 100644 (file)
@@ -77,7 +77,6 @@ public:
   void                removeSavePoint(int savePoint);
   QString             getNameOfSavePoint(int savePoint);
   void                setNameOfSavePoint(int savePoint, const QString& nameOfSavePoint);
-  virtual std::string getVisualComponentName();
 
   virtual void        restoreState(int savePoint);
   void                markAsSavedIn(QString theFileName);
index 0c06d2fd58bf7d452de5bf74975ddc0a2a5b2330..2f330e6c136c43e27a48636488dffc96a4c170c8 100644 (file)
@@ -118,7 +118,8 @@ int SalomeApp_VisualState::storeState()
   if ( savePoints.size() > 0)
     savePoint = savePoints[savePoints.size()-1] + 1;
 
-  _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName(), savePoint );
+  _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(), 
+                                                                      savePoint );
   _PTR(IParameters) ip = ClientFactory::getIParameters( ap );
 
   ViewManagerList lst;
@@ -200,7 +201,8 @@ void SalomeApp_VisualState::restoreState(int savePoint)
   if ( !study )
     return;
 
-  _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName(), savePoint );
+  _PTR(AttributeParameter) ap = study->studyDS()->GetCommonParameters( study->getVisualComponentName().toLatin1().constData(),
+                                                                      savePoint );
   _PTR(IParameters) ip = ClientFactory::getIParameters(ap);
 
   qApp->installEventFilter( this );