Salome HOME
Fix a regression
authorapo <apo@opencascade.com>
Mon, 29 Aug 2005 08:23:31 +0000 (08:23 +0000)
committerapo <apo@opencascade.com>
Mon, 29 Aug 2005 08:23:31 +0000 (08:23 +0000)
src/VISUGUI/VisuGUI_PopupTools.cxx

index 837ba8afa79c8ed87f67f738bb821f179ec6effd..74175dffb0c8d2ba83ab84cde7e5d6b161a9a476 100644 (file)
@@ -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 );
       }
     }
   }