]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Merge from V5_1_2_BR branch (14 July 2009) V5_1_main_20090716 V5_1_main_20090717 V5_1_main_20090720 mergefrom_V5_1_2_BR_14Jul09
authorvsr <vsr@opencascade.com>
Wed, 15 Jul 2009 08:13:17 +0000 (08:13 +0000)
committervsr <vsr@opencascade.com>
Wed, 15 Jul 2009 08:13:17 +0000 (08:13 +0000)
31 files changed:
src/CONVERTOR/VISU_MedConvertor.cxx
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_MeshAct.cxx
src/OBJECT/VISU_ScalarMapAct.cxx
src/PIPELINE/VISU_ColoredPL.cxx
src/PIPELINE/VISU_CutLinesPL.cxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/PIPELINE/VISU_DeformedShapeAndScalarMapPL.cxx
src/PIPELINE/VISU_OpenGLPointSpriteMapper.cxx
src/PIPELINE/VISU_PipeLineUtils.cxx
src/PIPELINE/VISU_PipeLineUtils.hxx
src/PIPELINE/VISU_Plot3DPL.cxx
src/VISUGUI/VISU_msg_en.ts
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h
src/VISUGUI/VisuGUI_BuildProgressDlg.cxx
src/VISUGUI/VisuGUI_ClippingPanel.cxx
src/VISUGUI/VisuGUI_ClippingPanel.h
src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.cxx
src/VISUGUI/VisuGUI_DeformedShapeAndScalarMapDlg.h
src/VISUGUI/VisuGUI_FeatureEdgesPanel.cxx
src/VISUGUI/VisuGUI_FeatureEdgesPanel.h
src/VISUGUI/VisuGUI_Panel.cxx
src/VISUGUI/VisuGUI_Panel.h
src/VISUGUI/VisuGUI_SelectionPanel.cxx
src/VISUGUI/VisuGUI_SelectionPanel.h
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISUGUI/VisuGUI_Tools.cxx
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_Prs3d_i.cc

index 467a4957a8b3704fc96b64eaf0ab70fbb7a30a39..2c7fdf284b4faf453ed2bc79b6a229f842c1bc22 100644 (file)
 
 #include <vtkCellType.h>
 
+#ifdef WNT
+#include <float.h>
+#define isnan _isnan
+#endif
+
 using MED::TInt;
 using MED::TFloat;
 using MED::EBooleen;
@@ -1657,8 +1662,8 @@ BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
 
         for(TInt iGauss = 0; iGauss < aNbGauss; iGauss++){
          const vtkFloatingPointType& aVal = aMValueSlice[iGauss];
-          aMin = std::min(aMin,aVal);
-          aMax = std::max(aMax,aVal);          
+          aMin = isnan(aVal) ? aVal : std::min(aMin,aVal);
+          aMax = isnan(aVal) ? aVal : std::max(aMax,aVal);          
           if(isAverageByGaussPoints){
             anAverageValue += aVal;
           }
@@ -1746,8 +1751,8 @@ BuildTimeStampMinMax(MED::SharedPtr<TimeStampValueType> theTimeStampValue,
           aValue += aVal*aVal;
         }
         aValue = sqrt(aValue);
-        aMin = std::min(aMin,aValue);
-        aMax = std::max(aMax,aValue);
+        aMin = isnan(aValue) ? aValue : std::min(aMin,aValue);
+        aMax = isnan(aValue) ? aValue : std::max(aMax,aValue);
 
        // additional calculation for each group, to which the element belongs
        VISU::TNames::const_iterator aGroupIter = aGroupNames.begin();
index 8a5ca9506adbd08391b74db8201bf4bebdb20f3e..1c29b5d7cadcfbf53387f284530d8fa82a000d25 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "VISU_PipeLine.hxx"
 
+#include "SVTK_Actor.h"
 #include "SVTK_Event.h"
 
 #include "VTKViewer_FramedTextActor.h"
@@ -548,6 +549,9 @@ VISU_Actor
 {
   Superclass::SetVisibility( theMode );
   myValLabels->SetVisibility( myIsValLabeled && theMode );
+
+  // Moved from VISU_GaussPtsAct::SetVisibility() (due to IPAL21159)
+  Highlight(isHighlighted());
 }
 //----------------------------------------------------------------------------
   //! Gets know whether the actor should be displayed or not
@@ -1087,6 +1091,11 @@ VISU_Actor
     vtkFloatingPointType aDollyWas = anInteractor->GetDolly();
     int aNumberOfFlyFramesWas = anInteractor->GetNumberOfFlyFrames();
   
+    double aPosition[3];
+    GetPosition( aPosition );
+    for( int i = 0; i < 3; i++ )
+      aFlyToCoord[i] += aPosition[i];
+
     anInteractor->SetDolly(0.0);
     anInteractor->SetNumberOfFlyFrames(aPickingSettings->GetStepNumber());
     anInteractor->FlyTo(aRenderer, aFlyToCoord);
@@ -1270,5 +1279,16 @@ VISU_Actor::GetQuadratic2DRepresentation() const
 
 void VISU_Actor::SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode )
 {
-  
+  switch(theMode) {
+  case VISU_Actor::eArcs:
+    myPreHighlightActor->SetQuadraticArcMode(true);
+    myHighlightActor->SetQuadraticArcMode(true);
+    break;
+  case VISU_Actor::eLines:
+    myPreHighlightActor->SetQuadraticArcMode(false);
+    myHighlightActor->SetQuadraticArcMode(false);
+    break;
+  default:
+    break;
+  }
 }
index 2fc5545668bdf9d854ab1a2e1b8570f8cd7a66f5..58272e97cd34d1b2031534cdedb1771e46fc1e73 100644 (file)
@@ -549,7 +549,6 @@ VISU_GaussPtsAct
   Superclass::SetVisibility(theMode);
   myDeviceActor->SetVisibility(GetVisibility()); // VSV
   myScalarBarCtrl->SetVisibility(theMode);
-  Highlight(isHighlighted());
 }
 
 int
index c5c87fe57f90f12874ac89acae5e00b15f8890df..410d91bf94c9c13f128b6155d0e28af4ef6f799e 100644 (file)
@@ -416,6 +416,7 @@ VISU_MeshAct::GetQuadratic2DRepresentation() const
 
 void VISU_MeshAct::SetQuadratic2DRepresentation( EQuadratic2DRepresentation theMode )
 {
+  Superclass::SetQuadratic2DRepresentation( theMode );
   switch(theMode) {
   case VISU_Actor::eArcs:
     mySurfaceActor->SetQuadraticArcMode(true);
index e68b837576224b43f4e38347de10603098e52131..51e3ed8064ed6ef2c7c6bb9a7604319fced2cc67 100644 (file)
@@ -526,7 +526,7 @@ VISU_ScalarMapAct
 {
   myBarVisibility = theMode;
   if(myScalarBar) 
-    myScalarBar->SetVisibility(myBarVisibility);
+    myScalarBar->SetVisibility(myBarVisibility && GetVisibility());
 }
 
 
@@ -667,6 +667,7 @@ VISU_ScalarMapAct
   
 void VISU_ScalarMapAct::SetQuadratic2DRepresentation( VISU_Actor::EQuadratic2DRepresentation theMode )
 {
+  Superclass::SetQuadratic2DRepresentation( theMode );
   switch(theMode) {
   case VISU_Actor::eArcs:
     mySurfaceActor->SetQuadraticArcMode(true);
index e797a1a2337ff03e845bf830258f70d6e5eb08d3..c7027903e2755055070260663e2680933f630f20 100644 (file)
@@ -170,6 +170,9 @@ void
 VISU_ColoredPL
 ::SetScalarRange( vtkFloatingPointType theRange[2] )
 {
+  if (isnan(theRange[0]) || isnan(theRange[1]))
+    throw std::runtime_error("NAN values in the presentation");
+
   if ( theRange[0] > theRange[1] ) 
     return;
   
@@ -502,7 +505,7 @@ VISU_ColoredPL
   myExtractor->GetOutput()->GetScalarRange( theRange );
   
   if (isnan(theRange[0]) || isnan(theRange[1]))
-    throw std::runtime_error("Arithmetic exception detected");
+    throw std::runtime_error("NAN values in the presentation");
 }
 
 void
index 0a0b7340bf5b0190124f7ee5d706b46ad87f292f..7fcfb1fd4d11b8308a11ece0f670a0f4351e6388 100644 (file)
@@ -160,6 +160,10 @@ void
 VISU_CutLinesPL
 ::Update()
 {
+  vtkDataSet* aMergedInput = GetMergedInput();
+  if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343
+    throw std::runtime_error("Impossible to build presentation");
+
   ClearAppendPolyData(myAppendPolyData);
 
   SetPartPosition(1);
index ca90de17199298b574eea11196a3356400ac8093..c9b541cc54fb1e3e5f427fd16039ca5f417422a7 100644 (file)
@@ -156,15 +156,19 @@ void
 VISU_CutPlanesPL
 ::Update()
 {
+  vtkDataSet* aMergedInput = GetMergedInput();
+  if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343
+    throw std::runtime_error("Impossible to build presentation");
+
   ClearAppendPolyData(myAppendPolyData);
 
 
   if(!myVectorialField || !IsDeformed()){
-    SetMergeFilterInput(GetMergedInput(),GetMergedInput());
+    SetMergeFilterInput(aMergedInput,aMergedInput);
   }
   
 
-  if(VISU::IsDataOnCells(GetMergedInput()))
+  if(VISU::IsDataOnCells(aMergedInput))
     GetMapper()->SetScalarModeToUseCellData();
   else
     GetMapper()->SetScalarModeToUsePointData();
index 34f1a8ae6232ffe10f5dcd50daa67d8a3a86f502..2da76c099d091acea9427c1654b6d5442f1892c8 100644 (file)
@@ -434,6 +434,9 @@ void
 VISU_DeformedShapeAndScalarMapPL
 ::SetScalarRange(vtkFloatingPointType theRange[2])
 {
+  if (isnan(theRange[0]) || isnan(theRange[1]))
+    throw std::runtime_error("NAN values in the presentation");
+
   if(VISU::CheckIsSameRange(theRange, GetScalarRange()))
     return;
 
@@ -466,5 +469,5 @@ VISU_DeformedShapeAndScalarMapPL
   myScalarsExtractor->GetUnstructuredGridOutput()->GetScalarRange(theRange);
 
   if (isnan(theRange[0]) || isnan(theRange[1]))
-    throw std::runtime_error("Arithmetic exception detected");
+    throw std::runtime_error("NAN values in the presentation");
 }
index fd54f6e014905a3bfdc4b6ab4331ed59de36082c..6662b6bd94d53b612fa2f2a428cae6308aa1ca36 100755 (executable)
@@ -371,6 +371,7 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteClamp( float theClamp )
     return;
 
   this->PointSpriteClamp = theClamp;
+  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -380,6 +381,7 @@ void VISU_OpenGLPointSpriteMapper::SetAverageCellSize(float theSize)
     return;
 
   this->AverageCellSize = theSize;
+  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -389,6 +391,7 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteSize( float theSize )
     return;
 
   this->PointSpriteSize = theSize;
+  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -398,6 +401,7 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMinSize( float theMinSize )
     return;
 
   this->PointSpriteMinSize = theMinSize;
+  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -407,6 +411,7 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMaxSize( float theMaxSize )
     return;
 
   this->PointSpriteMaxSize = theMaxSize;
+  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -416,6 +421,7 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteMagnification( float theMagnifi
     return;
 
   this->PointSpriteMagnification = theMagnification;
+  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
@@ -425,6 +431,7 @@ void VISU_OpenGLPointSpriteMapper::SetPointSpriteAlphaThreshold( float theAlphaT
     return;
 
   this->PointSpriteAlphaThreshold = theAlphaThreshold;
+  this->Modified();
 }
 
 //-----------------------------------------------------------------------------
index 259682e779fdb60dc777c805f6adff0a392c3ca2..2223fb868d294dbe334de3fd55c2cf8238af0520 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "VISU_OpenGLPointSpriteMapper.hxx"
 
+#include <vtkCell.h>
 #include <vtkDataSetMapper.h>
 #include <vtkPolyDataMapper.h>
 
@@ -245,5 +246,17 @@ namespace VISU
   }
 
 
+  //----------------------------------------------------------------------------
+  bool
+  IsQuadraticData(vtkDataSet* theDataSet)
+  {
+    for(int i = 0, n = theDataSet->GetNumberOfCells(); i < n; i++)
+      if(vtkCell* aCell = theDataSet->GetCell(i))
+       if(!aCell->IsLinear())
+         return true;
+    return false;
+  }
+
+
   //----------------------------------------------------------------------------
 }
index d19c466707d667789d05129810ba6e73ab8bb6b2..d9d244c86f1f73ad15930d4530fb6c4c54793aa6 100644 (file)
@@ -147,6 +147,11 @@ namespace VISU
                     vtkFloatingPointType theDirection[3], 
                     vtkFloatingPointType thePos[3], 
                     vtkFloatingPointType& theDist);
+
+
+  //----------------------------------------------------------------------------
+  bool VISU_PIPELINE_EXPORT
+  IsQuadraticData(vtkDataSet* theDataSet);
 }
 
 #endif
index 8c3d9aeac9cfb9693c3e56e537d53b88805d3f4a..adfc6ac421c20a2ab8d9decda9ccc40c707ebf0a 100644 (file)
@@ -196,18 +196,21 @@ void
 VISU_Plot3DPL
 ::Update()
 {
+  vtkDataSet* aMergedInput = GetMergedInput();
+  if(VISU::IsQuadraticData(aMergedInput)) // Bug 0020123, note 0005343
+    throw std::runtime_error("Impossible to build presentation");
+
   vtkFloatingPointType aPlaneNormal[3];
   vtkFloatingPointType anOrigin[3];
   GetBasePlane( anOrigin, aPlaneNormal );
 
   vtkPolyData* aPolyData = 0;
   vtkCutter *aCutPlane = 0;
-  vtkDataSet* aDataSet = GetMergedInput();
 
   if ( !IsPlanarInput() )
   {
     aCutPlane = vtkCutter::New();
-    aCutPlane->SetInput(aDataSet);
+    aCutPlane->SetInput(aMergedInput);
 
     vtkPlane *aPlane = vtkPlane::New();
     aPlane->SetOrigin(anOrigin);
@@ -221,7 +224,7 @@ VISU_Plot3DPL
   }
 
   if ( !aPolyData || aPolyData->GetNumberOfCells() == 0 ) {
-    myGeometryFilter->SetInput(aDataSet);
+    myGeometryFilter->SetInput(aMergedInput);
     aPolyData = myGeometryFilter->GetOutput();
     aPolyData->Update();
   }
index e7539f3dba4d7d3dd8167db52bd0ef3272590fbf..1c75f4a16a62454967087ae636f07caa242986e1 100644 (file)
@@ -134,8 +134,8 @@ number of time stamps or number of components is not the same!</translation>
             <translation>Cosinusoidal ( (1 - cos(t))/2 )</translation>
         </message>
         <message>
-            <source>VISU_CUTLINE_PREF</source>
-            <translation>CutLine preferences</translation>
+            <source>VISU_CUT_LINES_PREF</source>
+            <translation>Cut Lines preferences</translation>
         </message>
         <message>
             <source>VISU_CUT_LINES</source>
@@ -3035,6 +3035,11 @@ Please, provide non-empty resulting presentation.</translation>
             <source>DLG_TITLE</source>
             <translation>Deformed Shape and Scalar Map</translation>
         </message>
+        <message>
+            <source>ERR_SCALAR_DATA_INCONSISTENT</source>
+            <translation>Scalar data on the selected field is inconsistent.
+Please select another field.</translation>
+        </message>
         <message>
             <source>FIELD_ITEM</source>
             <translation>Scalar Field:</translation>
index 5c51442e103d3bd86bb59b2efea12842f670ade1..1101110500aa66b8661e9d1c4805686aa85bb1c7 100644 (file)
@@ -1886,7 +1886,7 @@ VisuGUI
         aStr == "VISU::TSCALARMAPONDEFORMEDSHAPE" || aStr == "VISU::TCOLOREDPRS3DHOLDER" ||
         aStr == "VISU::TTABLE" || aStr == "VISU::TCURVE" || aStr == "VISU::TCONTAINER" ||
         aStr == "VISU::POINTMAP3D" || aStr == "VISU::TVIEW3D" ||
-        aStr == "VISU::TMESH" || aStr == "VISU::TPOINTMAP3D" || aStr == "VISU::TGAUSSPOINTS")
+        aStr == "VISU::TPOINTMAP3D" || aStr == "VISU::TGAUSSPOINTS")
     {
       _PTR(GenericAttribute) anAttr;
       if (aSObject->FindAttribute(anAttr, "AttributeName")) {
@@ -2655,7 +2655,7 @@ VisuGUI
                 tr("MEN_GAUSS_POINT_SELECTION"), "", 0, aParent, true,
                 this, SLOT(OnSwitchSelectionMode()));
 
-  // Defenition of the actions for the "Navigation" tool bar
+  // Definition of the actions for the "Navigation" tool bar
   registerAction( VISU_SLIDER_PANEL, mySlider->toggleViewAction() );
   registerAction( VISU_SWEEP_PANEL, mySweep->toggleViewAction() );
 
@@ -2977,8 +2977,8 @@ VisuGUI
     " or (   (" + aTableOrContShow + orCurveInvisible + "))) ) or " + aComponent;
 
   QString aDOnlyRule = "( selcount>0 and ({true} in $canBeDisplayed) and (($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "})"
-    " or (   ((type='VISU::TTABLE' and nbChildren>0) or"
-    " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'})))) ) or" + aComponent;
+    " or (   ((type='VISU::TTABLE' and nbChildren>0) or (type='VISU::TCONTAINER' and hasCurves) or"
+    " (type='VISU::TCURVE')))) ) or" + aComponent;
 
   QString aScalarBarHideRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and (isScalarMapAct=1  or isGaussPtsAct=1 ) and " + aPrsVisible + " and isScalarBarVisible )";
   QString aScalarBarShowRule = "( selcount>0 and ($type in {'VISU::TMESH' 'VISU::TPOINTMAP3D' 'VISU::TGAUSSPOINTS'" + aPrsAll + "}) and ( isScalarMapAct=1 or isGaussPtsAct=1 ) and " + aPrsVisible + " and (not isScalarBarVisible) )";
@@ -3171,18 +3171,14 @@ VisuGUI
 
 void VisuGUI::createPanels()
 {
-  myPanels.insert( SelectionPanelId,    new VisuGUI_SelectionPanel( this ) );
-  myPanels.insert( FeatureEdgesPanelId, new VisuGUI_FeatureEdgesPanel( this ) );
-  myPanels.insert( ClippingPlanesPanelId, new VisuGUI_ClippingPanel( this ) );
-
-  QMap< PanelId, VisuGUI_Panel* >::iterator it = myPanels.begin(), itEnd = myPanels.end();
-  for( ; it != itEnd; ++it )
-  {
-    if( VisuGUI_Panel* aPanel = it.value() )
-    {
-      aPanel->hide();
-      GetDesktop(this)->addDockWidget( Qt::RightDockWidgetArea, aPanel );
-    }
+  myPanels[SelectionPanelId]      = new VisuGUI_SelectionPanel( this );
+  myPanels[FeatureEdgesPanelId]   = new VisuGUI_FeatureEdgesPanel( this );
+  myPanels[ClippingPlanesPanelId] = new VisuGUI_ClippingPanel( this );
+
+  VisuGUI_Panel* aPanel;
+  foreach( aPanel, myPanels ) {
+    getApp()->desktop()->addDockWidget( Qt::RightDockWidgetArea, aPanel );
+    aPanel->setVisible( false );
   }
 }
 
@@ -3414,13 +3410,6 @@ VisuGUI
   setMenuShown( false );
   setToolShown( false );
 
-  QMap< PanelId, VisuGUI_Panel* >::iterator it = myPanels.begin(), itEnd = myPanels.end();
-  for( ; it != itEnd; ++it )
-  {
-    if( VisuGUI_Panel* aPanel = it.value() )
-      aPanel->hide();
-  }
-
   // Unset actions accelerator keys
   action(VISU_IMPORT_FROM_FILE)->setShortcuts(QKeySequence::UnknownKey); // Import: CTRL + Key_I
 
@@ -3682,10 +3671,10 @@ void VisuGUI::createPreferences()
   setPreferenceProperty( bhh, "max", 100 );
 
   // TAB: "CutLines"
-  int cutLineTab = addPreference( tr( "CutLines" ) );
+  int cutLineTab = addPreference( tr( "VISU_CUT_LINES" ) );
 
   // group: "CutLines preferences"
-  int cutLineGr = addPreference( tr( "VISU_CUTLINE_PREF" ), cutLineTab );
+  int cutLineGr = addPreference( tr( "VISU_CUT_LINES_PREF" ), cutLineTab );
   setPreferenceProperty( cutLineGr, "columns", 1 );
   addPreference( tr( "Show preview" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "show_preview" );
   addPreference( tr( "Invert all curves" ), cutLineGr, LightApp_Preferences::Bool, "VISU", "invert_all_curves" );
index 3a955a50128d8dd7e8340c2ae8643d56305f9b51..58d8f2ce21389863bf7a1fcbf8334475f9b2702a 100644 (file)
@@ -218,12 +218,12 @@ private:
   int  addVtkFontPref( const QString& label, const int pId, const QString& param, const bool useSize );
 
 private:
-  QMap< PanelId, VisuGUI_Panel* > myPanels;
-  VisuGUI_Slider*         mySlider;
-  VisuGUI_Sweep*          mySweep; 
+  QMap<int,VisuGUI_Panel*> myPanels;
+  VisuGUI_Slider*          mySlider;
+  VisuGUI_Sweep*           mySweep; 
 
-  LightApp_Displayer*     myDisplayer;
-  VISU::TViewToPrs3d      myScalarBarsMap;
+  LightApp_Displayer*      myDisplayer;
+  VISU::TViewToPrs3d       myScalarBarsMap;
 };
 
 #endif
index 210bbcdd5d52b982555de98f82967f2edba7ea77..5a96a7058a9935ca106902c3817ac61a0716151f 100644 (file)
@@ -129,7 +129,7 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
   myBuildFieldsButton->setEnabled( false );
   myBuildFieldsButton->setFixedSize( 30, 30 );
   aPal = myBuildFieldsButton->palette();
-  aPal.setColor( myBuildFieldsButton->backgroundRole(), Qt::red );
+  aPal.setColor( myBuildFieldsButton->backgroundRole(), myBuildFieldsCheckBox->isChecked() ? Qt::red : Qt::gray );
   myBuildFieldsButton->setPalette( aPal );
 
   connect( myBuildFieldsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
@@ -140,7 +140,7 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
   myBuildMinMaxButton->setEnabled( false );
   myBuildMinMaxButton->setFixedSize( 30, 30 );
   aPal = myBuildMinMaxButton->palette();
-  aPal.setColor( myBuildMinMaxButton->backgroundRole(), Qt::red );
+  aPal.setColor( myBuildMinMaxButton->backgroundRole(), myBuildMinMaxCheckBox->isChecked() ? Qt::red : Qt::gray );
   myBuildMinMaxButton->setPalette( aPal );
   
   connect( myBuildMinMaxCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
@@ -151,7 +151,7 @@ VisuGUI_BuildProgressDlg::VisuGUI_BuildProgressDlg( QWidget* theParent ):
   myBuildGroupsButton->setEnabled( false );
   myBuildGroupsButton->setFixedSize( 30, 30 );
   aPal = myBuildGroupsButton->palette();
-  aPal.setColor( myBuildGroupsButton->backgroundRole(), Qt::red );
+  aPal.setColor( myBuildGroupsButton->backgroundRole(), myBuildGroupsCheckBox->isChecked() ? Qt::red : Qt::gray );
   myBuildGroupsButton->setPalette( aPal );
 
   connect( myBuildGroupsCheckBox, SIGNAL( clicked() ), this, SLOT( onBuildCheckBoxClicked() ) );
index 3839330d693ef0d316cdce0ada2cd9e8d8a0335a..0b1252bd31ddec04927abbd838df1920e28d635d 100644 (file)
@@ -208,13 +208,15 @@ CutPlaneFunction::~CutPlaneFunction()
 //****************************************************************
 //****************************************************************
 //****************************************************************
-VisuGUI_ClippingPanel::VisuGUI_ClippingPanel(VisuGUI* theModule)
-  : VisuGUI_Panel(tr("TITLE"), theModule, VISU::GetDesktop(theModule), ApplyBtn | HelpBtn ),
-    myModule(theModule),
+VisuGUI_ClippingPanel::VisuGUI_ClippingPanel( VisuGUI* theModule, QWidget* theParent )
+  : VisuGUI_Panel( tr( "TITLE" ), theModule, theParent, ApplyBtn | HelpBtn ),
     myPlaneDlg(0),
     myViewWindow(0),
     myIsApplied(true)
 {
+  setWindowTitle( tr( "TITLE" ) );
+  setObjectName( tr( "TITLE" ) );
+
   QVBoxLayout* aMainLayout = new QVBoxLayout(mainFrame());
 
   // List of presentations
index 1e40755b11b4e42ef99d38cf3399f4ab11bacf17..a3d6f004083144aae1fe941eab7eb9b7dae5e330 100644 (file)
@@ -115,7 +115,7 @@ class VisuGUI_ClippingPanel: public VisuGUI_Panel
 {
   Q_OBJECT
 public:
-  VisuGUI_ClippingPanel(VisuGUI* theModule);
+  VisuGUI_ClippingPanel(VisuGUI* theModule, QWidget* theParent = 0);
   ~VisuGUI_ClippingPanel();
 
   void init();
@@ -169,8 +169,6 @@ private slots:
   QStringList getPrsList(_PTR(Study) theStudy, _PTR(SObject) theObject);
   VISU::Prs3d_i* getPrs(QString theEntry);
 
-  VisuGUI*   myModule;
-
   QListWidget* myPrsList;
   QTableWidget* myPlanesList;
 
index 3d57aa320cbb31451a58c711d57205c2fdf51b12..b5415a4c88d872a19298e55204c2c1c0fb54cdd9 100644 (file)
@@ -71,6 +71,7 @@ VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (Salo
   : VisuGUI_ScalarBarBaseDlg(theModule),
     myIsAnimation(false),
     myUpdateScalars(true),
+    myIsScalarFieldValid(true),
     myVisuGUI(theModule)
 {
   setWindowTitle(tr("DLG_TITLE"));
@@ -136,15 +137,15 @@ VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (Salo
   GroupButtonsLayout->setSpacing(6);
   GroupButtonsLayout->setMargin(11);
 
-  QPushButton* buttonOk = new QPushButton (tr("&OK"), GroupButtons);
-  buttonOk->setAutoDefault(true);
-  buttonOk->setDefault(true);
+  myButtonOk = new QPushButton (tr("&OK"), GroupButtons);
+  myButtonOk->setAutoDefault(true);
+  myButtonOk->setDefault(true);
   QPushButton* buttonCancel = new QPushButton (tr("&Cancel") , GroupButtons);
   buttonCancel->setAutoDefault(true);
   QPushButton* buttonHelp = new QPushButton (tr("&Help") , GroupButtons);
   buttonHelp->setAutoDefault(true);
 
-  GroupButtonsLayout->addWidget(buttonOk);
+  GroupButtonsLayout->addWidget(myButtonOk);
   GroupButtonsLayout->addSpacing(10);
   GroupButtonsLayout->addStretch();
   GroupButtonsLayout->addWidget(buttonCancel);
@@ -155,7 +156,7 @@ VisuGUI_DeformedShapeAndScalarMapDlg::VisuGUI_DeformedShapeAndScalarMapDlg (Salo
   TopLayout->addWidget(GroupButtons);
 
   // signals and slots connections
-  connect(buttonOk,     SIGNAL(clicked()), this, SLOT(accept()));
+  connect(myButtonOk,   SIGNAL(clicked()), this, SLOT(accept()));
   connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
   connect(buttonHelp,   SIGNAL(clicked()), this, SLOT(onHelp()));
   connect(myFieldsCombo,     SIGNAL(activated(int)), this, SLOT(onFieldChanged(int)));
@@ -378,7 +379,7 @@ VisuGUI_DeformedShapeAndScalarMapDlg
 {
   QApplication::setOverrideCursor(Qt::WaitCursor);
 
-  if( save_scalar_pane )
+  if( save_scalar_pane && IsScalarFieldValid() )
     GetScalarPane()->storeToPrsObject(myPrsCopy);
 
   QString aFieldName;
@@ -390,12 +391,19 @@ VisuGUI_DeformedShapeAndScalarMapDlg
 
   VISU::Entity anEntity = getCurrentScalarEntity();
   
-  myPrsCopy->SetScalarField(anEntity,
-                           aFieldName.toLatin1().constData(),
-                           theIter);
-  
-  if( save_scalar_pane )
-    UpdateScalarField();
+  try {
+    myPrsCopy->SetScalarField(anEntity,
+                             aFieldName.toLatin1().constData(),
+                             theIter);
+    if( save_scalar_pane )
+      UpdateScalarField();
+    myIsScalarFieldValid = true;
+  } catch( std::exception& exc ) {
+    INFOS( exc.what() );
+    SUIT_MessageBox::warning( this, tr( "WRN_WARNING" ), tr( "ERR_SCALAR_DATA_INCONSISTENT" ) );
+    myIsScalarFieldValid = false;
+  }
+  updateControls();
 
   QApplication::restoreOverrideCursor();
 }
@@ -461,12 +469,12 @@ void VisuGUI_DeformedShapeAndScalarMapDlg::AddAllTimes(const QString& theFieldNa
 void VisuGUI_DeformedShapeAndScalarMapDlg::onFieldChanged(int){
   AddAllTimes(myFieldsCombo->currentText());
   SetScalarField();
-  UpdateScalarField();
+  //UpdateScalarField(); // it is called from SetScalarField() method
 }
 
 void VisuGUI_DeformedShapeAndScalarMapDlg::onTimeStampChanged(int){
   SetScalarField();
-  UpdateScalarField();
+  //UpdateScalarField(); // it is called from SetScalarField() method
 }
 
 void VisuGUI_DeformedShapeAndScalarMapDlg::UpdateScalarField(){
@@ -497,3 +505,12 @@ VisuGUI_DeformedShapeAndScalarMapDlg
   }
   return aTime;
 }
+
+void VisuGUI_DeformedShapeAndScalarMapDlg::updateControls()
+{
+  bool isScalarFieldValid = IsScalarFieldValid();
+  myTabBox->setTabEnabled( 1, isScalarFieldValid ); // "Scalar Bar" tab
+  myTabBox->setTabEnabled( 2, isScalarFieldValid ); // "Input" tab
+  myTimeStampsCombo->setEnabled( isScalarFieldValid );
+  myButtonOk->setEnabled( isScalarFieldValid );
+}
index c8d53ef3cd04d31bc0d4570559149a2d5a889cde..51dfa3f35ccc62e64843f73e2f0f8165e793f377 100644 (file)
@@ -69,6 +69,8 @@ public:
     VISU::Entity getCurrentScalarEntity();
     void SetScalarField(int theIter,QString theFieldName=QString(""), const bool = true );
 
+    bool IsScalarFieldValid() const { return myIsScalarFieldValid; }
+
 protected:
   virtual QString GetContextHelpFilePath();
 
@@ -87,6 +89,7 @@ private:
  VisuGUI_InputPane*     myInputPane;
  QComboBox *myFieldsCombo;
  QComboBox *myTimeStampsCombo;
+ QPushButton* myButtonOk;
  
  typedef std::map<int, QString> TTimeStampNumber2Time; // Times map definition (iteration time, real value of time)
  typedef std::map<QString, TTimeStampNumber2Time> TFieldName2TimeStamps; // Field name and enity to Times
@@ -101,6 +104,8 @@ private:
  _PTR(SObject) mySelectionObj;
  SALOME::GenericObjPtr<VISU::DeformedShapeAndScalarMap_i> myPrsCopy;
  SalomeApp_Module* myVisuGUI;
+
+ bool myIsScalarFieldValid;
  
 protected:
  void UpdateScalarField();
@@ -110,6 +115,7 @@ protected:
  QString GetFloatValueOfTimeStamp(VISU::Entity theEntity,
                                  const std::string& theFieldName,
                                  int theTimeStampNumber);
+ void updateControls();
 };
 
 #endif // VISUGUI_DEFORMEDSHAPEDLS_H
index fc7f1929da3114a65ac1540297aefa0d1e5553da..7162c6916d989b9e1f63d7e013ff8e651daf47d7 100644 (file)
 
 #include <LightApp_SelectionMgr.h>
 
-VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule, QWidget* theParent ) :
+VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( VisuGUI* theModule, QWidget* theParent ) :
   VisuGUI_Panel( tr( "WINDOW_TITLE" ), theModule, theParent, ApplyBtn | CloseBtn | HelpBtn ),
   myActor( 0 )
 {
+  setWindowTitle( tr( "WINDOW_TITLE" ) );
+  setObjectName( tr( "WINDOW_TITLE" ) );
+
   QVBoxLayout* aTopLayout = new QVBoxLayout( mainFrame() );
   myGrp = new QGroupBox( tr( "FEATURE_EDGES_PROPERTIES" ), mainFrame() );
 
@@ -77,10 +80,8 @@ VisuGUI_FeatureEdgesPanel::VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule,
 
   aTopLayout->addWidget( myGrp );
 
-  SalomeApp_Application* anApp =
-    dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
-  LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
-  connect( aSelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionEvent() ) );
+  connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+          this,                               SLOT( onSelectionEvent() ) );
 }
 
 VisuGUI_FeatureEdgesPanel::~VisuGUI_FeatureEdgesPanel()
@@ -148,7 +149,7 @@ void VisuGUI_FeatureEdgesPanel::onSelectionEvent()
                                 anIsManifoldEdges,
                                 anIsNonManifoldEdges );
 
-  float aColoring = myActor->GetFeatureEdgesColoring();
+  //float aColoring = myActor->GetFeatureEdgesColoring();
 
   myAngleSpinBox->setValue( anAngle );
   myFeatureEdgesCB->setChecked( anIsFeatureEdges );
@@ -176,7 +177,7 @@ void VisuGUI_FeatureEdgesPanel::onApply()
 
 void VisuGUI_FeatureEdgesPanel::onClose()
 {
-  close();
+  //  hide();
   VisuGUI_Panel::onClose();
 }
 
@@ -213,3 +214,19 @@ void VisuGUI_FeatureEdgesPanel::keyPressEvent( QKeyEvent* e )
       onHelp();
     }
 }
+
+void VisuGUI_FeatureEdgesPanel::onModuleActivated()
+{
+  disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+             this,                               SLOT( onSelectionEvent() ) );
+  connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+          this,                               SLOT( onSelectionEvent() ) );
+  VisuGUI_Panel::onModuleActivated();
+}
+
+void VisuGUI_FeatureEdgesPanel::onModuleDeactivated()
+{
+  disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+             this,                               SLOT( onSelectionEvent() ) );
+  VisuGUI_Panel::onModuleDeactivated();
+}
index 6e36dd8334a9a82373a155762813e066ceb32abe..504d24eb9ad66a233dd65573210a100fe67bbe75 100644 (file)
@@ -41,13 +41,17 @@ class VisuGUI_FeatureEdgesPanel: public VisuGUI_Panel
   Q_OBJECT
 
 public:
-  VisuGUI_FeatureEdgesPanel( const VisuGUI* theModule, QWidget* theParent = 0 );
+  VisuGUI_FeatureEdgesPanel( VisuGUI* theModule, QWidget* theParent = 0 );
   virtual ~VisuGUI_FeatureEdgesPanel ();
 
 protected:
   virtual void              keyPressEvent( QKeyEvent* theEvent );
   virtual void              showEvent( QShowEvent* theEvent );
 
+protected slots:
+  virtual void              onModuleActivated();
+  virtual void              onModuleDeactivated();
+
 private slots:
   virtual void              onApply();
   virtual void              onClose();
index c1be4ea03b8a0a337eb1a6dca559d260d0663115..bf02fc76075943f1fa53529b6e446e3068fcde9c 100755 (executable)
@@ -43,7 +43,7 @@
   \brief Frame inserted in viewport with redefined sizeHint method 
          in order to avoid unreasonable increasing of viewport size
 */
-class VisuGUI_Panel::MainFrame : public QFrame
+class VisuGUI_Panel::MainFrame : public QWidget
 {
 public:
   /*!
@@ -51,7 +51,7 @@ public:
     \param theParent parent widget
   */
   MainFrame( QWidget* theParent = 0 )
-  : QFrame( theParent )
+  : QWidget( theParent )
   {
   }
   
@@ -77,29 +77,33 @@ public:
 
 /*!
   \brief Constructor creates panels look and feel
-  \param theName name of the panel
+  \param theName panel title
+  \param theModule parent VISU GUI module
   \param theParent parent widget
+  \param theBtns panel buttons
 */
-VisuGUI_Panel::VisuGUI_Panel( const QString& theName, 
-                             const VisuGUI* theModule, 
-                             QWidget* theParent,
-                             const int theBtns  )
-  : QtxDockWidget( theName, theParent ),
+VisuGUI_Panel::VisuGUI_Panel( const QString& theName,
+                             VisuGUI*       theModule, 
+                             QWidget*       theParent,
+                             const int      theBtns  )
+  : QtxDockWidget( true, theParent ),
     myModule( theModule ),
     myOK( 0 ),
     myApply( 0 ),
     myClose( 0 ),
     myHelp( 0 )
 {
+  setObjectName( theName );
+
   QWidget* aGrp = new QWidget( this );
   setWidget( aGrp );
 
   // Create scroll view
   myView = new QScrollArea( aGrp );
+  myView->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
 
   // Create main frame
   myMainFrame = new MainFrame( myView );
-  myMainFrame->setFrameStyle( QFrame::Plain | QFrame::NoFrame );
   
   myView->setWidget( myMainFrame );
   myView->setAlignment( Qt::AlignCenter );
@@ -107,32 +111,32 @@ VisuGUI_Panel::VisuGUI_Panel( const QString& theName,
   myView->setMinimumWidth( myMainFrame->sizeHint().width() + 22 );
   
   // Create buttons
-  QWidget* aBtnWg = new QWidget( aGrp );
-  QHBoxLayout* aBtnWgLayout = new QHBoxLayout( aBtnWg );
+  QHBoxLayout* aBtnWgLayout = new QHBoxLayout;
+  aBtnWgLayout->setMargin( 0 );
 
   aBtnWgLayout->addStretch();
 
   if( theBtns & OKBtn )
   {
-    myOK = new QPushButton( tr( "BUT_OK" ), aBtnWg );
+    myOK = new QPushButton( tr( "BUT_OK" ), aGrp );
     aBtnWgLayout->addWidget( myOK );
     connect( myOK, SIGNAL( clicked() ), SLOT( onOK() ) );
   }
   if( theBtns & ApplyBtn )
   {
-    myApply = new QPushButton( tr( "BUT_APPLY" ), aBtnWg );
+    myApply = new QPushButton( tr( "BUT_APPLY" ), aGrp );
     aBtnWgLayout->addWidget( myApply );
     connect( myApply, SIGNAL( clicked() ), SLOT( onApply() ) );
   }
   if( theBtns & CloseBtn )
   {
-    myClose = new QPushButton( tr( "BUT_CLOSE" ), aBtnWg );
+    myClose = new QPushButton( tr( "BUT_CLOSE" ), aGrp );
     aBtnWgLayout->addWidget( myClose );
     connect( myClose, SIGNAL( clicked() ), SLOT( onClose() ) );
   }
   if( theBtns & HelpBtn )
   {
-    myHelp = new QPushButton( tr( "BUT_HELP" ), aBtnWg );
+    myHelp = new QPushButton( tr( "BUT_HELP" ), aGrp );
     aBtnWgLayout->addWidget( myHelp );
     connect( myHelp, SIGNAL( clicked() ), SLOT( onHelp() ) );
   }
@@ -141,9 +145,12 @@ VisuGUI_Panel::VisuGUI_Panel( const QString& theName,
 
   // fill layout
   QVBoxLayout* aLay = new QVBoxLayout( aGrp );
-  aLay->setContentsMargins( 0, 0, 0, 0 );
+  aLay->setMargin( 2 );
   aLay->addWidget( myView, 1 );
-  aLay->addWidget( aBtnWg );
+  aLay->addLayout( aBtnWgLayout );
+
+  connect( theModule, SIGNAL( moduleDeactivated() ), SLOT( onModuleDeactivated() ) );
+  connect( theModule, SIGNAL( moduleActivated() ),   SLOT( onModuleActivated() ) );
 }
 
 /*!
@@ -218,6 +225,7 @@ void VisuGUI_Panel::onClose()
 {
   if ( myClose )
     myClose->setFocus();
+  hide();
 }
 
 /*!
@@ -235,7 +243,17 @@ void VisuGUI_Panel::onHelp()
          panels should use it as parent
   \return QFrame* object 
 */
-QFrame* VisuGUI_Panel::mainFrame()
+QWidget* VisuGUI_Panel::mainFrame()
 {
   return myMainFrame;
 }
+
+void VisuGUI_Panel::onModuleActivated()
+{
+  widget()->setHidden( false );
+}
+
+void VisuGUI_Panel::onModuleDeactivated()
+{
+  widget()->setHidden( true );
+}
index a3336c9b80df8a488a90e56b12e1fd01e102ad35..05f33c80bc03aaa9c9a1963019e73a01208cd71b 100755 (executable)
@@ -29,7 +29,6 @@
 
 #include <QtxDockWidget.h>
 
-class QFrame;
 class QScrollArea;
 class QPushButton;
 
@@ -51,9 +50,9 @@ public:
 
 public:
   VisuGUI_Panel( const QString& theName,
-                const VisuGUI* theModule,
-                QWidget* theParent,
-                const int theBtns = AllBtn ); 
+                VisuGUI*       theModule,
+                QWidget*       theParent = 0,
+                const int      theBtns   = AllBtn ); 
   virtual ~VisuGUI_Panel();
 
   virtual bool              isValid( QString& theMessage );
@@ -65,19 +64,22 @@ protected slots:
   virtual void              onClose();
   virtual void              onHelp();
 
+  virtual void              onModuleActivated();
+  virtual void              onModuleDeactivated();
+
 protected:
-  QFrame*                   mainFrame();
+  QWidget*                  mainFrame();
 
 protected:
   QScrollArea*              myView;
-  QFrame*                   myMainFrame;
+  QWidget*                  myMainFrame;
 
   QPushButton*              myOK;
   QPushButton*              myApply;
   QPushButton*              myClose;
   QPushButton*              myHelp;
 
-  const VisuGUI*            myModule;
+  VisuGUI*                  myModule;
 };
 
 #endif
index cb8531a3ce5f4f43201c1fbed648b17e2ed1ff8d..f0dc15d240cd83fdf04c7bbf69434b5f4929b0d1 100644 (file)
@@ -122,10 +122,13 @@ public:
   }
 };
 
-VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const VisuGUI* theModule, QWidget* theParent ) :
-  VisuGUI_Panel( tr("WINDOW_TITLE" ), theModule, theParent, CloseBtn | HelpBtn ),
+VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( VisuGUI* theModule, QWidget* theParent ) :
+  VisuGUI_Panel( tr( "WINDOW_TITLE" ), theModule, theParent, CloseBtn | HelpBtn ),
   myPreferencesDlg( 0 )
 {
+  setWindowTitle( tr( "WINDOW_TITLE" ) );
+  setObjectName( tr( "WINDOW_TITLE" ) );
+
   QVBoxLayout* TopLayout = new QVBoxLayout ( mainFrame() );
 
   QWidget* aNamePane = new QWidget (mainFrame());
@@ -335,10 +338,8 @@ VisuGUI_SelectionPanel::VisuGUI_SelectionPanel( const VisuGUI* theModule, QWidge
 
   TopLayout->addWidget( aPrefBtn );
 
-  SalomeApp_Application* anApp =
-    dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
-  LightApp_SelectionMgr* aSelectionMgr = anApp->selectionMgr();
-  connect( aSelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionEvent() ) );
+  connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+          this,                               SLOT( onSelectionEvent() ) );
 
   connect( this, SIGNAL( selectionModeChanged( int ) ), myModule, SLOT( OnSwitchSelectionMode( int ) ) );
 
@@ -450,7 +451,7 @@ void VisuGUI_SelectionPanel::showEvent( QShowEvent* theEvent )
 
 void VisuGUI_SelectionPanel::closeEvent( QCloseEvent* theEvent )
 {
-  onClose();
+  //onClose();
   VisuGUI_Panel::closeEvent(theEvent);
 }
 
@@ -518,7 +519,7 @@ void VisuGUI_SelectionPanel::onSelectionEvent() {
   case GaussPointSelection:
     break;
   default:
-    close();
+    hide();
     return;
   }
 
@@ -1091,7 +1092,7 @@ void VisuGUI_SelectionPanel::onApply()
 
 void VisuGUI_SelectionPanel::onClose()
 {
-  close();
+  //hide();
   VisuGUI_Panel::onClose();
 }
 
@@ -1128,3 +1129,19 @@ void VisuGUI_SelectionPanel::keyPressEvent( QKeyEvent* e )
       onHelp();
     }
 }
+
+void VisuGUI_SelectionPanel::onModuleActivated()
+{
+  disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+             this,                               SLOT( onSelectionEvent() ) );
+  connect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+          this,                               SLOT( onSelectionEvent() ) );
+  VisuGUI_Panel::onModuleActivated();
+}
+
+void VisuGUI_SelectionPanel::onModuleDeactivated()
+{
+  disconnect( myModule->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+             this,                               SLOT( onSelectionEvent() ) );
+  VisuGUI_Panel::onModuleDeactivated();
+}
index c903e45465f93b1d038d6a8f579ffc4e25d6a6b2..324ce09814896fc0f9a02ab0578ce998f74215b0 100644 (file)
@@ -92,12 +92,16 @@ class VisuGUI_SelectionPanel: public VisuGUI_Panel
   enum ColumnId { Cell = 0, Point, X, Y, Z, I, J, K, Scalar, Vector };
 
 public:
-  VisuGUI_SelectionPanel( const VisuGUI* theModule, QWidget* theParent = 0 );
+  VisuGUI_SelectionPanel( VisuGUI* theModule, QWidget* theParent = 0 );
   virtual ~VisuGUI_SelectionPanel ();
 
 public:
   void                      setSelectionMode( int theId );
 
+protected slots:
+  virtual void              onModuleActivated();
+  virtual void              onModuleDeactivated();
+
 protected:
   virtual void              keyPressEvent( QKeyEvent* theEvent );
   virtual void              showEvent( QShowEvent* theEvent );
index 326bac71e9792039da1189b0e2c6e83d917857a7..68bd2e2bca32753cd1dc2b717db5387a5da589fb 100644 (file)
@@ -1927,25 +1927,28 @@ void VisuGUI_TimeAnimationDlg::onPlayPressed()
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::onBackPressed()
 {
-  //stopAnimation();
+  stopAnimation();
   myAnimator->prevFrame();
 }
 
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::onForvardPressed()
 {
+  stopAnimation();
   myAnimator->nextFrame();
 }
 
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::onLastPressed()
 {
+  stopAnimation();
   myAnimator->lastFrame();
 }
 
 //------------------------------------------------------------------------
 void VisuGUI_TimeAnimationDlg::onFirstPressed()
 {
+  stopAnimation();
   myAnimator->firstFrame();
 }
 
index 9d150f1b38bf0f51a6c6cd4f8841bfcc55b54314..0060ee78e9d92296ed9a9ddf5668c900fd64eb4f 100644 (file)
@@ -86,38 +86,36 @@ namespace VISU
   SUIT_Desktop*
   GetDesktop(const CAM_Module* theModule)
   {
-    return theModule->application()->desktop();
+    return theModule && theModule->application() ? theModule->application()->desktop() : 0;
   }
 
   //------------------------------------------------------------
   LightApp_SelectionMgr*
   GetSelectionMgr(const SalomeApp_Module* theModule)
   {
-    return theModule->getApp()->selectionMgr();
+    return theModule && theModule->getApp() ? theModule->getApp()->selectionMgr() : 0;
   }
 
   //------------------------------------------------------------
   SalomeApp_Study*
   GetAppStudy(const CAM_Module* theModule)
   {
-    return
-      dynamic_cast<SalomeApp_Study*>(theModule->application()->activeStudy());
+    return theModule && theModule->application() ? 
+      dynamic_cast<SalomeApp_Study*>(theModule->application()->activeStudy()) : 0;
   }
 
   //------------------------------------------------------------
   _PTR(Study)
   GetCStudy(const SalomeApp_Study* theStudy)
   {
-    return theStudy->studyDS();
+    return theStudy ? theStudy->studyDS() : _PTR(Study)();
   }
 
   //------------------------------------------------------------
   bool
   IsStudyLocked( _PTR(Study) theStudy )
   {
-    if( theStudy )
-      return theStudy->GetProperties()->IsLocked();
-    return true;
+    return theStudy ? theStudy->GetProperties()->IsLocked() : true;
   }
 
   //------------------------------------------------------------
@@ -256,23 +254,25 @@ namespace VISU
     TSelectionInfo aSelectionInfo;
     const SalomeApp_Study* aStudy = GetAppStudy(theModule);
     LightApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(theModule);
-    SALOME_ListIO aListIO;
-    aSelectionMgr->selectedObjects(aListIO);
-    SALOME_ListIteratorOfListIO anIter(aListIO);
-    while(anIter.More())
-    {
-      Handle(SALOME_InteractiveObject) anIO = anIter.Value();
-      if(anIO->hasEntry())
+    if ( aStudy && aSelectionMgr ) {
+      SALOME_ListIO aListIO;
+      aSelectionMgr->selectedObjects(aListIO);
+      SALOME_ListIteratorOfListIO anIter(aListIO);
+      while(anIter.More())
       {
-        TObjectInfo anObjectInfo = GetObjectByEntry(aStudy, anIO->getEntry());
-       if(anObjectInfo.mySObject){
-         TSelectionItem aSelectionItem;
-         aSelectionItem.myObjectInfo = anObjectInfo;
-         aSelectionItem.myIO = anIO;
-         aSelectionInfo.push_back(aSelectionItem);
+       Handle(SALOME_InteractiveObject) anIO = anIter.Value();
+       if(anIO->hasEntry())
+       {
+         TObjectInfo anObjectInfo = GetObjectByEntry(aStudy, anIO->getEntry());
+         if(anObjectInfo.mySObject){
+           TSelectionItem aSelectionItem;
+           aSelectionItem.myObjectInfo = anObjectInfo;
+           aSelectionItem.myIO = anIO;
+           aSelectionInfo.push_back(aSelectionItem);
+         }
        }
+       anIter.Next(); // MULTIPR fixed
       }
-      anIter.Next(); // MULTIPR fixed
     }
     return aSelectionInfo;
   }
index 050e768d78356a6e4635f567d62ae04fd40fa3a0..675982f381125b6c6910a4492a5edd5466cffc1e 100644 (file)
@@ -1012,7 +1012,7 @@ VISU::GaussPoints_i
                                       myColor.blue() / 255.0);
     }
     
-    anActor->SetBarVisibility(myShowBar); 
+    anActor->SetBarVisibility(myShowBar && GetIsColored()); 
 
     if( GetSpecificPL()->GetPrimitiveType() != VISU_OpenGLPointSpriteMapper::GeomSphere )
       theActor->SetRepresentation( VTK_POINTS );
index 3ec20db4328e6cf4dab98590b1cd9df54c54ab9c..7b010add6eeace9baee2e2e835c97c43ad6eda2d 100644 (file)
@@ -545,6 +545,7 @@ VISU::Prs3d_i
     if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor - this = "<<this<<"; theActor = "<<anActor);
     anActor->SetPosition(myOffset[0],myOffset[1],myOffset[2]);
     anActor->ShallowCopyPL(GetPipeLine());
+    anActor->highlight(anActor->isHighlighted());
   }
 }