]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
implementing save/restore visual parameters..
authorasv <asv@opencascade.com>
Mon, 13 Feb 2006 08:57:31 +0000 (08:57 +0000)
committerasv <asv@opencascade.com>
Mon, 13 Feb 2006 08:57:31 +0000 (08:57 +0000)
src/VISUGUI/VisuGUI_Module.cxx

index 46bbe5fbb9cd6e2192156af442ce4b0185d00660..aab640280448fca3b01ceb1f8174d46c17656ff5 100644 (file)
@@ -1707,38 +1707,27 @@ void VisuGUI_Module::storeVisualParameters(int savePoint)
                  Handle(SALOME_InteractiveObject) io = salomeActor->getIO();
                  const char* entry = io->getEntry();
                  const char* aName = salomeActor->getName();
+                 int repMode = salomeActor->GetRepresentation();
                  float opacity = salomeActor->GetOpacity();
                  float r, g, b;
                  salomeActor->GetColor(r, g, b);
                  QString colorStr  = QString::number( r ); colorStr += ",";
                          colorStr += QString::number( g ); colorStr += ","; 
                           colorStr += QString::number( b ); 
-                 int repMode = salomeActor->GetRepresentation();
-                 int disMode = salomeActor->getDisplayMode();
-                 bool isInf = salomeActor->IsInfinitive();
-                 bool isShrunk = ( salomeActor->IsShrunkable() && salomeActor->IsShrunk() );
-                 
-                 //  printf (" -- actor: entry=%s, name=%s, opacity=%f, color=%d,%d,%d, repMode=%d, disMode=%d... -- \n",
-                 //      entry, aName, opacity, r, g, b, repMode, disMode );
-                 
                  QString param, vtkParam = vmodel->getType(); vtkParam += gSeparator; 
                  vtkParam += QString::number( vtkViewers );   vtkParam += gSeparator; 
+
                  param = vtkParam + "Visibility";     
                  ip.setParameter( entry, param.latin1(), "true" );
-                 param = vtkParam + "Name";     
+                 param = vtkParam + "Name";
                  ip.setParameter( entry, param.latin1(), aName );
+                 param = vtkParam + "RepresentationMode";
+                 ip.setParameter( entry, param.latin1(), QString::number( repMode ).latin1() );
                  param = vtkParam + "Opacity";  
                  ip.setParameter( entry, param.latin1(), QString::number( opacity ).latin1() );
                  param = vtkParam + "Color"; 
                  ip.setParameter( entry, param.latin1(), colorStr.latin1() );
-                 param = vtkParam + "RepresentationMode";
-                 ip.setParameter( entry, param.latin1(), QString::number( repMode ).latin1() );
-                 param = vtkParam + "DisplayMode";
-                 ip.setParameter( entry, param.latin1(), QString::number( disMode ).latin1() );
-                 param = vtkParam + "IsInfinitive";
-                 ip.setParameter( entry, param.latin1(), QString::number( isInf ).latin1() );
-                 param = vtkParam + "IsShrunk";
-                 ip.setParameter( entry, param.latin1(), QString::number( isShrunk ).latin1() );
+
                } // hasIO
              } // salome_actor successfull downcast
            } // isVisible
@@ -1825,7 +1814,7 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint)
        if ( !ok ) // bad conversion of view index to integer
          continue;     
 
-       cout << "--SVTK parameter: entry = " << *entIt << ", paramName = " << paramName << endl;
+       //cout << "--SVTK parameter: entry = " << *entIt << ", paramName = " << paramName << endl;
 
        if ( paramName == "Visibility" && displayer() ) {
          QPtrList<SUIT_ViewManager> lst;
@@ -1861,29 +1850,20 @@ void VisuGUI_Module::restoreVisualParameters(int savePoint)
 
          QString val( (*valuesIt).c_str() );
          
-         if ( paramName == "Name" ) 
+         if ( paramName == "Name" )
            actor->setName( val.latin1() );
-         
+
+         else if ( paramName == "RepresentationMode" ) 
+           actor->SetRepresentation( val.toInt() );
+
          else if ( paramName == "Opacity" )
            actor->SetOpacity( val.toFloat() );
-         
+
          else if ( paramName == "Color" ) {
            QStringList colors = QStringList::split( ',', val );
            if ( colors.count() == 3 )
              actor->SetColor( colors[0].toFloat(), colors[1].toFloat(), colors[2].toFloat() );
          }
-
-         else if ( paramName == "RepresentationMode" )
-           actor->SetRepresentation( val.toInt() );
-
-         else if ( paramName == "DisplayMode" )
-           actor->setDisplayMode( val.toInt() );
-
-         else if ( paramName == "IsInfinitive" )
-           actor->SetInfinitive( (bool)val.toInt() );
-
-         else if ( paramName == "IsShrunk" )
-           actor->SetShrink();
        } // else ..
 
       } // if SVTK