From 8dab8b808988e3c3161a60b8c2b1ff54f695fef1 Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 29 Aug 2005 08:23:31 +0000 Subject: [PATCH] Fix a regression --- src/VISUGUI/VisuGUI_PopupTools.cxx | 38 ++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/src/VISUGUI/VisuGUI_PopupTools.cxx b/src/VISUGUI/VisuGUI_PopupTools.cxx index 837ba8af..74175dff 100644 --- a/src/VISUGUI/VisuGUI_PopupTools.cxx +++ b/src/VISUGUI/VisuGUI_PopupTools.cxx @@ -58,17 +58,41 @@ QtxValue VisuGUI_Selection::param( const int ind, const QString& p ) const #define ENUM2STRING( x, y ) \ case y: \ x = QString( #y ); \ - break; + break QString VisuGUI_Selection::type( const int ind ) const { QString aResStr; VISU::Storable::TRestoringMap aMap; - GetSelectedObj( study(), entry( ind ), &aMap ); + CORBA::Object_var anObject = GetSelectedObj( study(), entry( ind ), &aMap ); bool isExist; const QString& aVal = VISU::Storable::FindValue(aMap,"myComment",&isExist); if ( isExist ) aResStr = "VISU::T" + aVal; + else{ + VISU::Base_var aVisuObj = VISU::Base::_narrow( anObject ); + if ( !CORBA::is_nil( aVisuObj ) ){ + VISU::VISUType aType = aVisuObj->GetType(); + switch (aType) { + ENUM2STRING( aResStr, VISU::TVISUGEN ); + ENUM2STRING( aResStr, VISU::TRESULT ); + ENUM2STRING( aResStr, VISU::TTABLE ); + ENUM2STRING( aResStr, VISU::TCURVE ); + ENUM2STRING( aResStr, VISU::TCONTAINER ); + ENUM2STRING( aResStr, VISU::TMESH ); + ENUM2STRING( aResStr, VISU::TSCALARMAP ); + ENUM2STRING( aResStr, VISU::TISOSURFACE ); + ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE ); + ENUM2STRING( aResStr, VISU::TCUTPLANES ); + ENUM2STRING( aResStr, VISU::TCUTLINES ); + ENUM2STRING( aResStr, VISU::TVECTORS ); + ENUM2STRING( aResStr, VISU::TSTREAMLINES ); + ENUM2STRING( aResStr, VISU::TPLOT3D ); + ENUM2STRING( aResStr, VISU::TANIMATION ); + } + } + } + return aResStr; } @@ -104,11 +128,11 @@ QString VisuGUI_Selection::representation( const int ind ) const if ( VISU_Actor* anVISUActor = FindActor( aView, entry( ind ).latin1() ) ){ int aRepresent = anVISUActor->GetRepresentation(); switch ( aRepresent ){ - ENUM2STRING( aResStr, VISU::POINT ) - ENUM2STRING( aResStr, VISU::WIREFRAME ) - ENUM2STRING( aResStr, VISU::SHADED ) - ENUM2STRING( aResStr, VISU::INSIDEFRAME ) - ENUM2STRING( aResStr, VISU::SURFACEFRAME ) + ENUM2STRING( aResStr, VISU::POINT ); + ENUM2STRING( aResStr, VISU::WIREFRAME ); + ENUM2STRING( aResStr, VISU::SHADED ); + ENUM2STRING( aResStr, VISU::INSIDEFRAME ); + ENUM2STRING( aResStr, VISU::SURFACEFRAME ); } } } -- 2.39.2