]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
*** empty log message ***
authorvsv <vsv@opencascade.com>
Mon, 22 Sep 2008 10:34:22 +0000 (10:34 +0000)
committervsv <vsv@opencascade.com>
Mon, 22 Sep 2008 10:34:22 +0000 (10:34 +0000)
src/VISUGUI/VisuGUI_FilterScalarsDlg.cxx

index ccca18b9675cb4250156f25e26401ed8b8901fcb..d3ff9025f5160f59c1958b4c9db7ae65ecd0ab80 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "VisuGUI_FilterScalarsDlg.h"
 #include "VISU_ColoredPrs3d_i.hh"
+#include "VISU_ColoredPrs3dHolder_i.hh"
 
 #include "VisuGUI.h"
 #include "VisuGUI_Tools.h"
@@ -105,21 +106,27 @@ VisuGUI_FilterScalarsDlg::~VisuGUI_FilterScalarsDlg()
 
 void VisuGUI_FilterScalarsDlg::onSelectionEvent()
 {
+  typedef SALOME::GenericObjPtr< VISU::ColoredPrs3d_i  > TColoredPrs3dPtr;
   VISU::TSelectionInfo aSelectionInfo = VISU::GetSelectedObjects( myVisuGUI );
+  myColoredPrs3d = TColoredPrs3dPtr();
   if ( !aSelectionInfo.empty() ) {
     VISU::TSelectionItem aSelectionItem = aSelectionInfo.front();
-    if ( VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase )
+    if ( VISU::Base_i* aBase = aSelectionItem.myObjectInfo.myBase ) {
       if ( VISU::ColoredPrs3d_i* aColoredPrs3d = dynamic_cast< VISU::ColoredPrs3d_i* >( aBase ) ) {
-       myRangeBox->setChecked( aColoredPrs3d->IsScalarFilterUsed() );
-       myMinEdit->setText( QString::number( aColoredPrs3d->GetScalarFilterMin() ) );
-       myMaxEdit->setText( QString::number( aColoredPrs3d->GetScalarFilterMax() ) );
        myColoredPrs3d = aColoredPrs3d;
+      } else if (VISU::ColoredPrs3dHolder_i* aHolder = 
+                dynamic_cast< VISU::ColoredPrs3dHolder_i* >( aBase )) {
+       myColoredPrs3d = aHolder->GetPrs3dDevice();
+      }
+      if (myColoredPrs3d.get() != NULL) {
+       myRangeBox->setChecked( myColoredPrs3d->IsScalarFilterUsed() );
+       myMinEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMin() ) );
+       myMaxEdit->setText( QString::number( myColoredPrs3d->GetScalarFilterMax() ) );
        setEnabled( true );
        return;
       }
+    }
   }
-  typedef SALOME::GenericObjPtr< VISU::ColoredPrs3d_i  > TColoredPrs3dPtr;
-  myColoredPrs3d = TColoredPrs3dPtr();
   setEnabled( false );
   return;
 }