From 805a7990d7658e0ddcf45288a6fb4c3191abf3c1 Mon Sep 17 00:00:00 2001 From: dmv Date: Tue, 24 Feb 2009 11:41:46 +0000 Subject: [PATCH] IPAL20024 3D view is restored incorrectly after DumpStudy --- src/VISUGUI/VisuGUI_Module.cxx | 38 +++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/src/VISUGUI/VisuGUI_Module.cxx b/src/VISUGUI/VisuGUI_Module.cxx index d515cd4f..ce511b71 100644 --- a/src/VISUGUI/VisuGUI_Module.cxx +++ b/src/VISUGUI/VisuGUI_Module.cxx @@ -1759,7 +1759,43 @@ void VisuGUI_Module::storeVisualParameters(int savePoint) } } // hasIO - } // salome_actor successfull downcast + } // salome_actor successfull downcast to the VISU_Actor + else if ( VISU_PointMap3dActor* vActor = VISU_PointMap3dActor::SafeDownCast( actor ) ) { // PointMap3D + if ( vActor->hasIO() ) { // actor corresponds to existing obj + Handle(SALOME_InteractiveObject) io = vActor->getIO(); + // entry is "ecoded" = it does NOT contain component adress, since it is a + // subject to change on next component loading + std::string entry = ip->encodeEntry( io->getEntry(), componentName ); + std::string param, vtkParam = vType.toLatin1().data(); + vtkParam += gSeparator; + vtkParam += QString::number( *viewsCounter ).toLatin1().data(); + vtkParam += gSeparator; + + param = vtkParam + "Visibility"; + ip->setParameter( entry, param, "On" ); + param = vtkParam + "Name"; + ip->setParameter( entry, param, vActor->getName() ); + param = vtkParam + "RepresentationMode"; + ip->setParameter( entry, param, QString::number( vActor->GetRepresentation() ).toLatin1().data() ); + param = vtkParam + "Opacity"; + ip->setParameter( entry, param, QString::number( vActor->GetOpacity() ).toLatin1().data() ); + vtkFloatingPointType r, g, b; + vActor->GetColor(r, g, b); + QString colorStr = QString::number( r ); colorStr += gDigitsSep; + colorStr += QString::number( g ); colorStr += gDigitsSep; + colorStr += QString::number( b ); + param = vtkParam + "Color"; + ip->setParameter( entry, param, colorStr.toLatin1().data() ); + param = vtkParam + "LineWidth"; + ip->setParameter( entry, param, QString::number( vActor->GetLineWidth() ).toLatin1().data() ); + if ( vActor->IsShrunkable() && vActor->IsShrunk() ) { + param = vtkParam + "ShrinkMode"; + ip->setParameter( entry, param, "On" ); + param = vtkParam + "ShrinkFactor"; + ip->setParameter( entry, param, QString::number( vActor->GetShrinkFactor() ).toLatin1().data() ); + } + } + } // salome actor is downcasted to the VISU_PointMap3dActor } // isVisible } // end of ..while.. actors traversal } // if ( vtkView ) -- 2.39.2