From 66463b0fcaacc0324ff4e18c07e321347275d86a Mon Sep 17 00:00:00 2001 From: asv Date: Mon, 13 Feb 2006 08:57:31 +0000 Subject: [PATCH] implementing save/restore visual parameters.. --- src/VISUGUI/VisuGUI_Module.cxx | 46 ++++++++++------------------------ 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index 46bbe5fb..aab64028 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -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 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 -- 2.39.2