]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Completion implementation of PAL13246
authorapo <apo@opencascade.com>
Tue, 22 May 2007 10:46:37 +0000 (10:46 +0000)
committerapo <apo@opencascade.com>
Tue, 22 May 2007 10:46:37 +0000 (10:46 +0000)
19 files changed:
src/PIPELINE/VISU_ColoredPL.cxx
src/PIPELINE/VISU_CutLinesPL.cxx
src/PIPELINE/VISU_CutPlanesPL.cxx
src/PIPELINE/VISU_IsoSurfacesPL.cxx
src/PIPELINE/VISU_Plot3DPL.cxx
src/PIPELINE/VISU_VectorsPL.cxx
src/VISUGUI/VisuGUI_ScalarMapOnDeformedShapeDlg.cxx
src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_Plot3D_i.cc
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.cc
src/VISU_I/VISU_ScalarMapOnDeformedShape_i.hh
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_Vectors_i.cc

index 2020ef0644aeca1149b843a893ad28e6729d52ac..d067added02a5b82760828db08b68dfc0c78c2be 100644 (file)
@@ -108,7 +108,7 @@ VISU_ColoredPL
     } else {
       vtkCellData *aCellData = theInput->GetCellData();
       if(!aCellData->GetAttribute(vtkDataSetAttributes::VECTORS)){
-       if(theScalarMode==0){
+       if(theScalarMode == 0){
          return;
        }
       }
@@ -133,6 +133,9 @@ void
 VISU_ColoredPL
 ::SetScalarRange(vtkFloatingPointType theRange[2])
 {
+  if(theRange[0] > theRange[1]) 
+    return;
+
   myFieldTransform->SetScalarRange(theRange);
   myBarTable->SetRange(theRange);
 }
index 7727e4c507330f0302f0612bc239ad10d56a8ee7..3bad32d187df31620c822023e025f48bab754d2a 100644 (file)
@@ -90,6 +90,11 @@ void
 VISU_CutLinesPL
 ::SetPosition(vtkFloatingPointType thePosition)
 {
+  bool anIsSameValue = VISU::CheckIsSameValue(myPosition, thePosition);
+  anIsSameValue &= (myCondition == 0);
+  if(anIsSameValue)
+    return;
+
   myPosition = thePosition;
   myCondition = 0;
   Modified();
@@ -127,6 +132,9 @@ void
 VISU_CutLinesPL
 ::SetDefault()
 {
+  if(myCondition == 1)
+    return;
+
   myCondition = 1;
   Modified();
 }
index 431080eeb0b09436c5158e861e3b474fd08289d7..caad525c063b34aee327ebbba6ee0986255cb684 100644 (file)
@@ -336,6 +336,9 @@ VISU_CutPlanesPL
 ::SetDisplacement(vtkFloatingPointType theDisp, 
                  int theNum) 
 {
+  if(VISU::CheckIsSameValue(myDisplacement[theNum], theDisp))
+    return;
+
   myDisplacement[theNum] = theDisp;
   Modified();
 }
@@ -344,12 +347,12 @@ VISU_CutPlanesPL
 //----------------------------------------------------------------------------
 void
 VISU_CutPlanesPL
-::SetNbParts(int theNb) 
+::SetNbParts(int theNbParts
 {
-  if(theNb > 0){
-    myNbParts = theNb;
-    myPartPosition.resize(myNbParts);
-    myPartCondition.resize(myNbParts, 1);
+  if(theNbParts > 0 && myNbParts != theNbParts){
+    myPartPosition.resize(theNbParts);
+    myPartCondition.resize(theNbParts, 1);
+    myNbParts = theNbParts;
     Modified();
   }
 }
@@ -364,6 +367,11 @@ VISU_CutPlanesPL
   if(thePartNumber >= myNbParts) 
     return;
 
+  bool anIsSameValue = VISU::CheckIsSameValue(myPartPosition[thePartNumber], thePartPosition);
+  anIsSameValue &= VISU::CheckIsSameValue(myPartCondition[thePartNumber], 0);
+  if(anIsSameValue)
+    return;
+
   myPartPosition[thePartNumber] = thePartPosition;
   myPartCondition[thePartNumber] = 0;
   Modified();
@@ -413,6 +421,11 @@ VISU_CutPlanesPL
   if(thePartNumber >= myNbParts) 
     return;
 
+  bool anIsSameValue = VISU::CheckIsSameValue(myPartPosition[thePartNumber], GetPartPosition(thePartNumber));
+  anIsSameValue &= VISU::CheckIsSameValue(myPartCondition[thePartNumber], 1);
+  if(anIsSameValue)
+    return;
+
   myPartPosition[thePartNumber] = GetPartPosition(thePartNumber);
   myPartCondition[thePartNumber] = 1;
   Modified();
index aaf427b7d0344ce1da49751cb5744bd1476355ee..8f92a1cbbd52de1c4afbd1c27e26dabcf537cbb8 100644 (file)
@@ -93,7 +93,6 @@ VISU_IsoSurfacesPL
 ::SetNbParts(int theNb) 
 {
   myContourFilter->SetNumberOfContours(theNb);
-  Modified();
 }
 
 
@@ -112,6 +111,9 @@ void
 VISU_IsoSurfacesPL
 ::SetRange(vtkFloatingPointType theRange[2])
 {
+  if(VISU::CheckIsSameRange(myRange, theRange))
+    return;
+
   if(theRange[0] <= theRange[1]){
     myRange[0] = theRange[0];  
     myRange[1] = theRange[1];
index 5b26e979fc4ee9865aa3d6ca0921b2aeb7988e08..602445689f467b7ef02bf91fe22199be382c6451 100644 (file)
@@ -316,6 +316,9 @@ void
 VISU_Plot3DPL::
 SetContourPrs(bool theIsContourPrs )
 {
+  if(myIsContour == theIsContourPrs)
+    return;
+
   myIsContour = theIsContourPrs;
   Modified();
 }
@@ -336,6 +339,11 @@ VISU_Plot3DPL
 ::SetPlanePosition(vtkFloatingPointType thePosition,
                   bool theIsRelative)
 {
+  bool anIsSameValue = VISU::CheckIsSameValue(myIsRelative, theIsRelative);
+  anIsSameValue &= (myPosition == thePosition);
+  if(anIsSameValue)
+    return;
+
   myIsRelative = theIsRelative;
   myPosition = thePosition;
   Modified();
@@ -394,16 +402,24 @@ SetOrientation(VISU_CutPlanesPL::PlaneOrientation theOrientation,
               vtkFloatingPointType theXAngle,
               vtkFloatingPointType theYAngle)
 {
+  bool anIsSameValue = VISU::CheckIsSameValue(GetRotateX(), theXAngle);
+  anIsSameValue &= VISU::CheckIsSameValue(GetRotateY(), theYAngle);
+  anIsSameValue &= (myOrientation == theOrientation);
+  if(anIsSameValue)
+    return;
+
   switch(theOrientation){
   case VISU_CutPlanesPL::XY: myAngle[0] = theXAngle; break;
   case VISU_CutPlanesPL::YZ: myAngle[1] = theXAngle; break;
   case VISU_CutPlanesPL::ZX: myAngle[2] = theXAngle; break;
   }
+
   switch(theOrientation){
   case VISU_CutPlanesPL::XY: myAngle[1] = theYAngle; break;
   case VISU_CutPlanesPL::YZ: myAngle[2] = theYAngle; break;
   case VISU_CutPlanesPL::ZX: myAngle[0] = theYAngle; break;
   }
+
   myOrientation = theOrientation;
   Modified();
 }
index f06301f62a2d6400e49b8cf755e3eb90ff55b925..36a3014f2c43cb7924859399177d1a7721b7e464 100644 (file)
@@ -145,6 +145,9 @@ void
 VISU_VectorsPL
 ::SetGlyphType(VISU_VectorsPL::GlyphType theType) 
 {
+  if(myTypeGlyph == theType)
+    return;
+
   myTypeGlyph = theType;
   Modified();
 }
@@ -164,6 +167,9 @@ void
 VISU_VectorsPL
 ::SetGlyphPos(VISU_VectorsPL::GlyphPos thePos) 
 {
+  if(myPosGlyph == thePos)
+    return;
+
   myPosGlyph = thePos;
   Modified();
 }
@@ -185,8 +191,8 @@ VISU_VectorsPL
 {
   Superclass::Init();
 
-  myTypeGlyph = ARROW;
-  myPosGlyph = TAIL;
+  SetGlyphType(ARROW);
+  SetGlyphPos(TAIL);
 }
 
 
index 62f99dec1ce54fd4ad712fcf627e8a6a23df9dd2..9d8d0fe77d1b3af7f58c60f7acdb796e9848553c 100644 (file)
@@ -333,8 +333,6 @@ VisuGUI_ScalarMapOnDeformedShapeDlg
   if(myUpdateScalars) 
     SetScalarField( false );
 
-  myPrsCopy->ShowColored(true);
-
   VISU::TSameAsFactory<VISU::TSCALARMAPONDEFORMEDSHAPE>().Copy(thePrs, myPrsCopy);
 
   return anIsOk;
index 3a94dd9d5b01262fe015cac2d9f9151bbde783a3..0fa7c820f7912cf4f669e4b410dd65fae2ee0e35 100644 (file)
@@ -26,8 +26,9 @@
 
 #include "VISU_ColoredPrs3d_i.hh"
 
-#include "VISU_ColoredPL.hxx"
 #include "VISU_Result_i.hh"
+#include "VISU_ColoredPL.hxx"
+#include "VISU_PipeLineUtils.hxx"
 #include "VISU_Convertor.hxx"
 
 #include "SUIT_ResourceMgr.h"
@@ -528,7 +529,8 @@ VISU::ColoredPrs3d_i
   else if(theScalarMode > aNbComp)
     theScalarMode = 0;
 
-  myColoredPL->SetScalarMode(theScalarMode);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, int>
+                  (GetSpecificPL(), &VISU_ColoredPL::SetScalarMode, theScalarMode));
 }
 
 //----------------------------------------------------------------------------
@@ -552,10 +554,10 @@ void
 VISU::ColoredPrs3d_i
 ::SetRange(CORBA::Double theMin, CORBA::Double theMax)
 {
-  if(theMin > theMax) 
-    return;
   vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
-  GetSpecificPL()->SetScalarRange(aScalarRange);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+                  (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
+
   UseFixedRange(true);
 }
 
@@ -565,12 +567,15 @@ void
 VISU::ColoredPrs3d_i
 ::SetSourceRange()
 {
-  if(IsTimeStampFixed())
+  if(IsTimeStampFixed()){
     GetSpecificPL()->SetSourceRange();
-  else{
+    ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
+                    (GetSpecificPL(), &VISU_ColoredPL::SetSourceRange));
+  }else{
     TMinMax aTMinMax = GetField()->GetMinMax(GetScalarMode());
     vtkFloatingPointType aScalarRange[2] = {aTMinMax.first, aTMinMax.second};
-    GetSpecificPL()->SetScalarRange(aScalarRange);
+    ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, vtkFloatingPointType*>
+                    (GetSpecificPL(), &VISU_ColoredPL::SetScalarRange, aScalarRange));
   }
   UseFixedRange(false);
 }
@@ -610,7 +615,8 @@ void
 VISU::ColoredPrs3d_i
 ::SetNbColors(CORBA::Long theNbColors)
 {
-  GetSpecificPL()->SetNbColors(theNbColors);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ColoredPL, int>
+                  (GetSpecificPL(), &VISU_ColoredPL::SetNbColors, theNbColors));
 }
 
 //----------------------------------------------------------------------------
@@ -643,10 +649,15 @@ VISU::ColoredPrs3d_i
 //----------------------------------------------------------------------------
 void
 VISU::ColoredPrs3d_i
-::SetPosition(CORBA::Double X, CORBA::Double Y) 
+::SetPosition(CORBA::Double theX, CORBA::Double theY) 
 { 
-  myPosition[0] = X; 
-  myPosition[1] = Y;
+  bool anIsSameValue = VISU::CheckIsSameValue(myPosition[0], theX);
+  anIsSameValue &= VISU::CheckIsSameValue(myPosition[1], theY);
+  if(anIsSameValue)
+    return;
+
+  myPosition[0] = theX; 
+  myPosition[1] = theY;
   myParamsTime.Modified();
 }
 
@@ -671,6 +682,11 @@ void
 VISU::ColoredPrs3d_i
 ::SetSize(CORBA::Double theWidth, CORBA::Double theHeight) 
 {
+  bool anIsSameValue = VISU::CheckIsSameValue(myWidth, theWidth);
+  anIsSameValue &= VISU::CheckIsSameValue(myHeight, theHeight);
+  if(anIsSameValue)
+    return;
+
   myWidth = theWidth; 
   myHeight = theHeight;
   myParamsTime.Modified();
@@ -846,6 +862,12 @@ VISU::ColoredPrs3d_i
                vtkFloatingPointType theG, 
                vtkFloatingPointType theB)
 {
+  bool anIsSameValue = VISU::CheckIsSameValue(myTitleColor[0], theR);
+  anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[1], theG);
+  anIsSameValue &= VISU::CheckIsSameValue(myTitleColor[2], theB);
+  if(anIsSameValue)
+    return;
+
   myTitleColor[0] = theR; 
   myTitleColor[1] = theG; 
   myTitleColor[2] = theB; 
@@ -947,6 +969,12 @@ VISU::ColoredPrs3d_i
                vtkFloatingPointType theG, 
                vtkFloatingPointType theB)
 {
+  bool anIsSameValue = VISU::CheckIsSameValue(myLabelColor[0], theR);
+  anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[1], theG);
+  anIsSameValue &= VISU::CheckIsSameValue(myLabelColor[2], theB);
+  if(anIsSameValue)
+    return;
+
   myLabelColor[0] = theR; 
   myLabelColor[1] = theG; 
   myLabelColor[2] = theB; 
@@ -967,7 +995,11 @@ void
 VISU::ColoredPrs3d_i
 ::UseFixedRange(bool theUseFixedRange)
 {
+  if(myIsFixedRange == theUseFixedRange)
+    return;
+
   myIsFixedRange = theUseFixedRange;
+  myParamsTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -1008,9 +1040,9 @@ VISU::ColoredPrs3d_i
   // Orientation
   int anOrientation = aResourceMgr->integerValue("VISU", "scalar_bar_orientation", 0);
   if(anOrientation == 1)
-    myOrientation = VISU::ScalarMap::HORIZONTAL;
+    SetBarOrientation(VISU::ScalarMap::HORIZONTAL);
   else
-    myOrientation = VISU::ScalarMap::VERTICAL;
+    SetBarOrientation(VISU::ScalarMap::VERTICAL);
 
   // Scalar Bar origin
   QString propertyName = QString( "scalar_bar_%1_" ).arg( anOrientation == 0 ? "vertical" : "horizontal" );
index dc066034a37c3260d35ae38b774f4c299eb80d2d..e634111b500103ff744d2fdd18beb1b4131e5bc3 100644 (file)
@@ -367,7 +367,8 @@ void
 VISU::CutLines_i
 ::SetDisplacement(CORBA::Double theDisp) 
 { 
-  myCutLinesPL->SetDisplacement(theDisp);
+  ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutLinesPL, vtkFloatingPointType, int>
+                  (GetSpecificPL(), &VISU_CutLinesPL::SetDisplacement, theDisp, 0));
 }
 
 //---------------------------------------------------------------
@@ -375,7 +376,8 @@ void
 VISU::CutLines_i
 ::SetDisplacement2(CORBA::Double theDisp) 
 { 
-  myCutLinesPL->SetDisplacement(theDisp,1);
+  ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutLinesPL, vtkFloatingPointType, int>
+                  (GetSpecificPL(), &VISU_CutLinesPL::SetDisplacement, theDisp, 1));
 }
 
 
@@ -401,7 +403,8 @@ void
 VISU::CutLines_i
 ::SetBasePlanePosition(CORBA::Double thePlanePosition)
 {
-  myCutLinesPL->SetPosition(thePlanePosition);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, vtkFloatingPointType>
+                  (GetSpecificPL(), &VISU_CutLinesPL::SetPosition, thePlanePosition));
 }
 
 //---------------------------------------------------------------
@@ -418,7 +421,8 @@ VISU::CutLines_i
 ::SetLinePosition(CORBA::Long thePlaneNumber, 
                  CORBA::Double thePlanePosition)
 {
-  myCutLinesPL->SetPartPosition(thePlaneNumber,thePlanePosition);
+  ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutLinesPL, int, vtkFloatingPointType>
+                  (GetSpecificPL(), &VISU_CutLinesPL::SetPartPosition, thePlaneNumber, thePlanePosition));
 }
 
 //---------------------------------------------------------------
@@ -435,7 +439,8 @@ void
 VISU::CutLines_i
 ::SetDefault()
 {
-  myCutLinesPL->SetDefault();
+  ProcessVoidEvent(new TVoidMemFunEvent<VISU_CutLinesPL>
+                  (GetSpecificPL(), &VISU_CutLinesPL::SetDefault));
 }
 
 //---------------------------------------------------------------
@@ -451,7 +456,8 @@ void
 VISU::CutLines_i
 ::SetDefaultPosition(CORBA::Long thePlaneNumber)
 {
-  myCutLinesPL->SetPartDefault(thePlaneNumber);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, int>
+                  (GetSpecificPL(), &VISU_CutLinesPL::SetPartDefault, thePlaneNumber));
 }
 
 //---------------------------------------------------------------
@@ -471,7 +477,7 @@ void
 VISU::CutLines_i
 ::SetAllCurvesInverted(CORBA::Boolean theInvert)
 {
-  for(int i=0; i<GetNbLines(); i++)
+  for(int i=0; i < GetNbLines(); i++)
     SetCurveInverted(i, theInvert);
 }
 
@@ -495,9 +501,13 @@ VISU::CutLines_i
  */
 void
 VISU::CutLines_i
-::SetCurveInverted(CORBA::Long theCurveNumber,CORBA::Boolean theInvert)
+::SetCurveInverted(CORBA::Long theCurveNumber, CORBA::Boolean theInvert)
 {
+  if(myMapCurvesInverted[theCurveNumber] == theInvert)
+    return;
+
   myMapCurvesInverted[theCurveNumber] = theInvert;
+  myParamsTime.Modified();
 }
 
 //---------------------------------------------------------------
@@ -520,7 +530,11 @@ void
 VISU::CutLines_i
 ::SetUseAbsoluteLength(CORBA::Boolean theAbsLength)
 {
+  if(myUseAbsLength == theAbsLength)
+    return;
+
   myUseAbsLength = theAbsLength;
+  myParamsTime.Modified();
 }
 
 //---------------------------------------------------------------
@@ -536,7 +550,8 @@ void
 VISU::CutLines_i
 ::SetNbLines(CORBA::Long theNb) 
 { 
-  myCutLinesPL->SetNbParts(theNb);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutLinesPL, int>
+                  (GetSpecificPL(), &VISU_CutLinesPL::SetNbParts, theNb));
 }
 
 //---------------------------------------------------------------
index f6c28f9955d4f6f1d2fd87ff77f798144ca25e42..4d9583d22f399c1651151f1712b147369e4054fb 100644 (file)
@@ -168,9 +168,37 @@ VISU::CutPlanes_i
                 CORBA::Double theXAngle, 
                 CORBA::Double theYAngle)
 {
-  myCutPlanesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                               theXAngle,
-                               theYAngle);
+  struct TEvent: public SALOME_Event 
+  {
+    VISU_CutPlanesPL* myPipeLine;
+    VISU_CutPlanesPL::PlaneOrientation myOrient;
+    CORBA::Double myXAngle;
+    CORBA::Double myYAngle;
+
+    TEvent(VISU_CutPlanesPL* thePipeLine,
+          VISU_CutPlanesPL::PlaneOrientation theOrient,
+          CORBA::Double theXAngle, 
+          CORBA::Double theYAngle):
+      myPipeLine(thePipeLine),
+      myOrient(theOrient),
+      myXAngle(theXAngle),
+      myYAngle(theYAngle)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myPipeLine->SetOrientation(myOrient,
+                                myXAngle,
+                                myYAngle);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(GetSpecificPL(),
+                             VISU_CutPlanesPL::PlaneOrientation(theOrient),
+                             theXAngle,
+                             theYAngle));
 }
 
 //----------------------------------------------------------------------------
@@ -203,7 +231,8 @@ void
 VISU::CutPlanes_i
 ::SetDisplacement(CORBA::Double theDisp) 
 {  
-  myCutPlanesPL->SetDisplacement(theDisp);
+  ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutPlanesPL, vtkFloatingPointType, int>
+                  (GetSpecificPL(), &VISU_CutPlanesPL::SetDisplacement, theDisp, 0));
 }
 
 //----------------------------------------------------------------------------
@@ -221,7 +250,8 @@ VISU::CutPlanes_i
 ::SetPlanePosition(CORBA::Long thePlaneNumber, 
                   CORBA::Double thePlanePosition)
 {
-  myCutPlanesPL->SetPartPosition(thePlaneNumber, thePlanePosition);
+  ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_CutPlanesPL, int, vtkFloatingPointType>
+                  (GetSpecificPL(), &VISU_CutPlanesPL::SetPartPosition, thePlaneNumber, thePlanePosition));
 }
 
 //----------------------------------------------------------------------------
@@ -238,7 +268,8 @@ void
 VISU::CutPlanes_i
 ::SetDefault(CORBA::Long thePlaneNumber)
 {
-  myCutPlanesPL->SetPartDefault(thePlaneNumber);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutPlanesPL, int>
+                  (GetSpecificPL(), &VISU_CutPlanesPL::SetPartDefault, thePlaneNumber));
 }
 
 //----------------------------------------------------------------------------
@@ -255,7 +286,8 @@ void
 VISU::CutPlanes_i
 ::SetNbPlanes(CORBA::Long theNb) 
 { 
-  myCutPlanesPL->SetNbParts(theNb);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_CutPlanesPL, int>
+                  (GetSpecificPL(), &VISU_CutPlanesPL::SetNbParts, theNb));
 }
 
 //----------------------------------------------------------------------------
index 38afca523328d690d3aac3e96a08605c792d34fb..b942c81ae3a5dd0cec6b21c37ece6bdee8bd3395 100644 (file)
 
 #include "VISU_ScalarMapAct.h"
 #include "VISU_DeformedShapePL.hxx"
+#include "VISU_PipeLineUtils.hxx"
 #include "VISU_Convertor.hxx"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 #include <vtkDataSetMapper.h>
 #include <vtkProperty.h>
@@ -199,7 +201,8 @@ void
 VISU::DeformedShape_i
 ::SetScale(CORBA::Double theScale) 
 { 
-  myDeformedShapePL->SetScale(theScale);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_DeformedShapePL, vtkFloatingPointType>
+                  (GetSpecificPL(), &VISU_DeformedShapePL::SetScale, theScale));
 }
 
 //---------------------------------------------------------------
@@ -225,6 +228,9 @@ void
 VISU::DeformedShape_i
 ::ShowColored(CORBA::Boolean theColored)
 {
+  if(myIsColored == theColored)
+    return;
+
   myIsColored = theColored; 
   myParamsTime.Modified();
 }
@@ -243,6 +249,12 @@ void
 VISU::DeformedShape_i
 ::SetColor(const SALOMEDS::Color& theColor)
 {
+  bool anIsSameValue = VISU::CheckIsSameValue(myColor.R, theColor.R);
+  anIsSameValue &= VISU::CheckIsSameValue(myColor.G, theColor.G);
+  anIsSameValue &= VISU::CheckIsSameValue(myColor.B, theColor.B);
+  if(anIsSameValue)
+    return;
+
   myColor = theColor;
   myParamsTime.Modified();
 }
@@ -269,7 +281,12 @@ bool
 VISU::DeformedShape_i
 ::CheckIsPossible() 
 {
-  return IsPossible(GetCResult(),GetCMeshName(),GetEntity(),GetCFieldName(),GetTimeStampNumber(),true);
+  return IsPossible(GetCResult(),
+                   GetCMeshName(),
+                   GetEntity(),
+                   GetCFieldName(),
+                   GetTimeStampNumber(),
+                   true);
 }
 
 
index c93c179fd1d463b3a522ee5f7e68d0cd1840fa70..c152e8daf621c2e4b98ca9bd1d329598209b843d 100644 (file)
@@ -152,27 +152,8 @@ void
 VISU::IsoSurfaces_i
 ::SetNbSurfaces(CORBA::Long theNb)
 {
-
-  struct TEvent: public SALOME_Event
-  {
-    VISU_IsoSurfacesPL* myIsoSurfacesPL;
-    CORBA::Long myNb;
-
-    TEvent(VISU_IsoSurfacesPL* theIsoSurfacesPL, 
-          CORBA::Long theNb):
-      myIsoSurfacesPL(theIsoSurfacesPL), 
-      myNb(theNb)
-    {}
-
-    virtual
-    void
-    Execute()
-    {
-      myIsoSurfacesPL->SetNbParts(myNb);
-    }
-  };
-
-  ProcessVoidEvent(new TEvent(myIsoSurfacesPL, theNb));
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_IsoSurfacesPL, int>
+                  (GetSpecificPL(), &VISU_IsoSurfacesPL::SetNbParts, theNb));
 }
 
 //---------------------------------------------------------------
@@ -190,7 +171,8 @@ VISU::IsoSurfaces_i
 ::SetSubRange(CORBA::Double theMin, CORBA::Double theMax)
 { 
   vtkFloatingPointType aRange[2] = {theMin, theMax};
-  myIsoSurfacesPL->SetRange(aRange);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_IsoSurfacesPL, vtkFloatingPointType*>
+                  (GetSpecificPL(), &VISU_IsoSurfacesPL::SetRange, aRange));
 }
 
 //---------------------------------------------------------------
index 0ec0e291e0e76a1e9e7561b86b7f55b0317a3e1c..34ac5d2a03e5855532f509c24dbabb230c2e33aa 100644 (file)
 //
 
 #include "VISU_Plot3D_i.hh"
+
 #include "VISU_Result_i.hh"
 #include "VISU_Plot3DPL.hxx"
 #include "VISU_Actor.h"
+
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -158,9 +161,37 @@ VISU::Plot3D_i
                 CORBA::Double theXAngle, 
                 CORBA::Double theYAngle)
 {
-  myPlot3DPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                            theXAngle,
-                            theYAngle);
+  struct TEvent: public SALOME_Event 
+  {
+    VISU_Plot3DPL* myPipeLine;
+    VISU_CutPlanesPL::PlaneOrientation myOrient;
+    CORBA::Double myXAngle;
+    CORBA::Double myYAngle;
+
+    TEvent(VISU_Plot3DPL* thePipeLine,
+          VISU_CutPlanesPL::PlaneOrientation theOrient,
+          CORBA::Double theXAngle, 
+          CORBA::Double theYAngle):
+      myPipeLine(thePipeLine),
+      myOrient(theOrient),
+      myXAngle(theXAngle),
+      myYAngle(theYAngle)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myPipeLine->SetOrientation(myOrient,
+                                myXAngle,
+                                myYAngle);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(GetSpecificPL(),
+                             VISU_CutPlanesPL::PlaneOrientation(theOrient),
+                             theXAngle,
+                             theYAngle));
 }
 
 
@@ -197,7 +228,8 @@ VISU::Plot3D_i
 ::SetPlanePosition(CORBA::Double  thePlanePosition,
                   CORBA::Boolean theIsRelative)
 {
-  myPlot3DPL->SetPlanePosition(thePlanePosition, theIsRelative);
+  ProcessVoidEvent(new TVoidMemFun2ArgEvent<VISU_Plot3DPL, vtkFloatingPointType, bool>
+                  (GetSpecificPL(), &VISU_Plot3DPL::SetPlanePosition, thePlanePosition, theIsRelative));
 }
 
 
@@ -224,7 +256,8 @@ void
 VISU::Plot3D_i
 ::SetScaleFactor(CORBA::Double theScaleFactor)
 {
-  myPlot3DPL->SetScaleFactor(theScaleFactor);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_Plot3DPL, vtkFloatingPointType>
+                  (GetSpecificPL(), &VISU_Plot3DPL::SetScaleFactor, theScaleFactor));
 }
 
 
@@ -242,7 +275,8 @@ void
 VISU::Plot3D_i
 ::SetNbOfContours(CORBA::Long theNb)
 {
-  myPlot3DPL->SetNumberOfContours(theNb);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_Plot3DPL, int>
+                  (GetSpecificPL(), &VISU_Plot3DPL::SetNumberOfContours, theNb));
 }
 
 
@@ -260,7 +294,8 @@ void
 VISU::Plot3D_i
 ::SetContourPrs(CORBA::Boolean theIsContourPrs)
 {
-  myPlot3DPL->SetContourPrs( theIsContourPrs );
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_Plot3DPL, bool>
+                  (GetSpecificPL(), &VISU_Plot3DPL::SetContourPrs, theIsContourPrs));
 }
 
 
index edf465948845edb27bee8b1c811bc28e9920c8ea..afb7eee5dd0cb1e8304b27702023050167fe52b6 100644 (file)
@@ -350,7 +350,8 @@ VISU::Prs3d_i
   if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<<this);
 
   try{
-    GetPipeLine()->Update();
+    ProcessVoidEvent(new TVoidMemFunEvent<VISU_PipeLine>
+                    (GetPipeLine(), &VISU_PipeLine::Update));
     myUpdateTime.Modified();
   }catch(std::exception&){
     throw;
index f250186855ba99525109427a9f80efb734c557e9..bab79a4b35bd7b17f775eff72961f911b976c90b 100644 (file)
@@ -31,6 +31,7 @@
 #include "VISU_Result_i.hh"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 #include <vtkUnstructuredGrid.h>
 #include <vtkProperty.h>
@@ -141,9 +142,6 @@ VISU::ScalarMapOnDeformedShape_i
         const std::string& theFieldName, 
         CORBA::Long theTimeStampNumber)
 {
-  myIsColored = true;
-  myColor.R = myColor.G = myColor.B = 0.5;
-
   SetScalarField(theMeshName.c_str(),
                 theFieldName.c_str(),
                 theTimeStampNumber,
@@ -177,11 +175,7 @@ VISU::ScalarMapOnDeformedShape_i
                 anEntity);
 
   SetScale(VISU::Storable::FindValue(theMap,"myFactor").toDouble());
-  myIsColored = VISU::Storable::FindValue(theMap,"myIsColored").toInt();
-  myColor.R = VISU::Storable::FindValue(theMap,"myColor.R").toDouble();
-  myColor.G = VISU::Storable::FindValue(theMap,"myColor.G").toDouble();
-  myColor.B = VISU::Storable::FindValue(theMap,"myColor.B").toDouble();
-
+  
   return this;
 }
 
@@ -199,10 +193,6 @@ VISU::ScalarMapOnDeformedShape_i
   Storable::DataToStream( theStr, "myScalarEntity",    int(myScalarEntity));
 
   Storable::DataToStream( theStr, "myFactor", GetScale() );
-  Storable::DataToStream( theStr, "myIsColored", myIsColored );
-  Storable::DataToStream( theStr, "myColor.R", myColor.R );
-  Storable::DataToStream( theStr, "myColor.G", myColor.G );
-  Storable::DataToStream( theStr, "myColor.B", myColor.B );
 }
 
 
@@ -240,7 +230,8 @@ void
 VISU::ScalarMapOnDeformedShape_i
 ::SetScale(CORBA::Double theScale) 
 { 
-  myScalarMapOnDeformedShapePL->SetScale(theScale);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkFloatingPointType>
+                  (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScale, theScale));
 }
 
 
@@ -253,43 +244,6 @@ VISU::ScalarMapOnDeformedShape_i
 }
 
 
-//---------------------------------------------------------------
-CORBA::Boolean 
-VISU::ScalarMapOnDeformedShape_i
-::IsColored()
-{
-  return myIsColored;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::ShowColored(CORBA::Boolean theColored)
-{
-  myIsColored = theColored; 
-  myParamsTime.Modified();
-}
-
-//---------------------------------------------------------------
-SALOMEDS::Color 
-VISU::ScalarMapOnDeformedShape_i
-::GetColor()
-{
-  return myColor;
-}
-
-
-//---------------------------------------------------------------
-void
-VISU::ScalarMapOnDeformedShape_i
-::SetColor(const SALOMEDS::Color& theColor)
-{
-  myColor = theColor;
-  myParamsTime.Modified();
-}
-
-
 //---------------------------------------------------------------
 void
 VISU::ScalarMapOnDeformedShape_i
@@ -300,7 +254,7 @@ VISU::ScalarMapOnDeformedShape_i
   }else
     myScalarMapOnDeformedShapePL = dynamic_cast<VISU_ScalarMapOnDeformedShapePL*>(thePipeLine);
 
-  myScalarMapOnDeformedShapePL->GetMapper()->SetScalarVisibility(IsColored());
+  myScalarMapOnDeformedShapePL->GetMapper()->SetScalarVisibility(1);
 
   TSuperClass::CreatePipeLine(myScalarMapOnDeformedShapePL);
 }
@@ -325,8 +279,8 @@ VISU::ScalarMapOnDeformedShape_i
   int  aDispMode = aResourceMgr->integerValue("VISU", "scalar_def_represent", 2);
   bool toShrink  = aResourceMgr->booleanValue("VISU", "scalar_def_shrink", false);
   anActor->SetRepresentation(aDispMode);
-  if (toShrink) anActor->SetShrink();
-  anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
+  if (toShrink) 
+    anActor->SetShrink();
   anActor->SetVTKMapping(false);
   return anActor;
 }
@@ -338,16 +292,10 @@ VISU::ScalarMapOnDeformedShape_i
 ::UpdateActor(VISU_Actor* theActor) 
 {
   if(VISU_ScalarMapAct* anActor = dynamic_cast<VISU_ScalarMapAct*>(theActor)){
-    if(IsColored()){
-      anActor->SetBarVisibility(true);
-      GetPipeLine()->GetMapper()->SetScalarVisibility(1);
-    }else{
-      anActor->SetBarVisibility(false);
-      GetPipeLine()->GetMapper()->SetScalarVisibility(0);
-      anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
-    }
-    TSuperClass::UpdateActor(theActor);
+    anActor->SetBarVisibility(true);
+    GetPipeLine()->GetMapper()->SetScalarVisibility(1);
   }
+  TSuperClass::UpdateActor(theActor);
 }
 
 
@@ -400,8 +348,9 @@ VISU::ScalarMapOnDeformedShape_i
 
   vtkUnstructuredGrid* anOutput = anIDMapper->GetUnstructuredGridOutput();
   if(myScalarMapOnDeformedShapePL && anOutput)
-    myScalarMapOnDeformedShapePL->SetScalars(anOutput);
-
+    ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapOnDeformedShapePL, vtkDataSet*>
+                    (GetSpecificPL(), &VISU_ScalarMapOnDeformedShapePL::SetScalars, anOutput));
+  
   myScalarMeshName = theMeshName;
   myScalarEntity = theEntity;
   myScalarFieldName = theFieldName;
@@ -409,7 +358,8 @@ VISU::ScalarMapOnDeformedShape_i
 
   SetTitle(theFieldName);
   if(!IsRangeFixed() && IsPipeLineExists())
-    GetSpecificPL()->SetSourceRange();
+    ProcessVoidEvent(new TVoidMemFunEvent<VISU_ColoredPL>
+                    (GetSpecificPL(), &VISU_ColoredPL::SetSourceRange));
 
   myParamsTime.Modified();
 }
index 2738ccdc586290b523c6587a8e9c77d4427e2400..4c36ea89eb887ef31299959c8b0c447a7fa45cc4 100644 (file)
@@ -67,22 +67,6 @@ namespace VISU
     CORBA::Double 
     GetScale();
 
-    virtual
-    CORBA::Boolean 
-    IsColored();
-
-    virtual
-    void
-    ShowColored(CORBA::Boolean theColored);
-
-    virtual
-    SALOMEDS::Color 
-    GetColor();
-
-    virtual
-    void
-    SetColor(const SALOMEDS::Color& theColor);
-
     virtual 
     void
     SameAs(const Prs3d_i* theOrigin);
@@ -195,9 +179,6 @@ namespace VISU
   private:
     VISU_ScalarMapOnDeformedShapePL *myScalarMapOnDeformedShapePL;
 
-    bool myIsColored;
-    SALOMEDS::Color myColor;
-
     PField myScalarField;
     std::string myScalarMeshName;
     std::string myScalarFieldName;
index 8d7f821688242c36bd72b48bec8c84c48533115c..9ce78f1c4cd45cdfd7dd0aa6b8ed4d05291821c7 100644 (file)
@@ -323,7 +323,8 @@ void
 VISU::ScalarMap_i
 ::SetScaling(VISU::Scaling theScaling)
 {
-  GetSpecificPL()->SetScaling(theScaling);
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_ScalarMapPL, int>
+                  (GetSpecificPL(), &VISU_ColoredPL::SetScaling, theScaling));
 }
 
 //----------------------------------------------------------------------------
index 4e13c66eebe97b3257d09bcf302d90809fcb1fa9..4010268645355d56a0abb90654c8fb4d727e4db0 100644 (file)
@@ -32,6 +32,7 @@
 #include "VISU_Convertor.hxx"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 #include <vtkDataSetMapper.h>
 #include <vtkAppendFilter.h>
@@ -210,22 +211,80 @@ VISU::StreamLines_i
            CORBA::Double thePercents,
            VISU::StreamLines::Direction theDirection)
 {
-  VISU::Prs3d_i* aPrs3d = NULL;
-  vtkPointSet* aSource = NULL;
-  if (!thePrs3d->_is_nil())
-    if ((aPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(thePrs3d).in()))) {
-      myAppendFilter->RemoveAllInputs();
-      myAppendFilter->AddInput(aPrs3d->GetPipeLine()->GetMapper()->GetInput());
-      aSource = myAppendFilter->GetOutput();
+  struct TEvent: public SALOME_Event 
+  {
+    CORBA::Double myIntStep;
+    CORBA::Double myPropogationTime;
+    CORBA::Double myStepLength;
+    VISU::Prs3d_ptr myPrs3d;
+    CORBA::Double myPercents;
+    VISU::StreamLines::Direction myDirection;
+    
+    VISU_StreamLinesPL* myPipeLine;
+    VISU::Prs3d_i*& myPrs3dServant;
+    vtkAppendFilter* myAppendFilter;
+    size_t& myIsAccepted;
+    
+    TEvent(CORBA::Double theIntStep,
+          CORBA::Double thePropogationTime,
+          CORBA::Double theStepLength,
+          VISU::Prs3d_ptr thePrs3d,
+          CORBA::Double thePercents,
+          VISU::StreamLines::Direction theDirection,
+          VISU_StreamLinesPL* thePipeLine,
+          VISU::Prs3d_i*& thePrs3dServant,
+          vtkAppendFilter* theAppendFilter,
+          size_t& theIsAccepted):
+      myIntStep(myIntStep),
+      myPropogationTime(thePropogationTime),
+      myStepLength(theStepLength),
+      myPrs3d(thePrs3d),
+      myPercents(thePercents),
+      myDirection(theDirection),
+      myPipeLine(thePipeLine),
+      myPrs3dServant(thePrs3dServant),
+      myAppendFilter(theAppendFilter),
+      myIsAccepted(theIsAccepted)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myPrs3dServant = NULL;
+      vtkDataSet* aSource = NULL;
+      if (!CORBA::is_nil(myPrs3d)){
+       myPrs3dServant = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(myPrs3d).in());
+       if(myPrs3dServant){
+         myAppendFilter->RemoveAllInputs();
+         myAppendFilter->AddInput(myPrs3dServant->GetPipeLine()->GetMapper()->GetInput());
+         aSource = myAppendFilter->GetOutput();
+       }
+      }
+      myIsAccepted = myPipeLine->SetParams(myIntStep,
+                                          myPropogationTime,
+                                          myStepLength,
+                                          aSource,
+                                          myPercents,
+                                          myDirection);
     }
-  size_t anIsAccepted = myStreamLinesPL->SetParams(theIntStep,
-                                                  thePropogationTime,
-                                                  theStepLength,
-                                                  aSource,
-                                                  thePercents,
-                                                  theDirection);
-  if (anIsAccepted)
-    SetSource(aPrs3d);
+  };
+
+  size_t anIsAccepted = false;
+  VISU::Prs3d_i* aPrs3dServant = NULL;
+  ProcessVoidEvent(new TEvent(theIntStep,
+                             thePropogationTime,
+                             theStepLength,
+                             thePrs3d,
+                             thePercents,
+                             theDirection,
+                             GetSpecificPL(),
+                             aPrs3dServant,
+                             myAppendFilter,
+                             anIsAccepted));
+  if(anIsAccepted)
+    SetSource(aPrs3dServant);
+
   return anIsAccepted;
 }
 
@@ -250,6 +309,9 @@ VISU::StreamLines_i
   if(thePrs3d){
     SALOMEDS::SObject_var aSObject = thePrs3d->GetSObject();
     CORBA::String_var aString = aSObject->GetID();
+    if(mySourceEntry == aString.in())
+      return;
+
     mySourceEntry = aString.in();
     myParamsTime.Modified();
   }
index cf04e4fecda14388cc76c760164dac6a5aaf15af..caee0703274236d185ac884ff0ed9fe1f3464015 100644 (file)
 
 #include "VISU_VectorsAct.h"
 #include "VISU_VectorsPL.hxx"
+#include "VISU_PipeLineUtils.hxx"
 #include "VISU_Convertor.hxx"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 #include <vtkProperty.h>
 
@@ -198,6 +200,9 @@ void
 VISU::Vectors_i
 ::SetLineWidth(CORBA::Double theWidth) 
 { 
+  if(VISU::CheckIsSameValue(myLineWidth, theWidth))
+    return;
+
   myLineWidth = theWidth;
   myParamsTime.Modified();
 }
@@ -216,7 +221,8 @@ void
 VISU::Vectors_i
 ::SetGlyphType(VISU::Vectors::GlyphType theType) 
 { 
-  myVectorsPL->SetGlyphType(VISU_VectorsPL::GlyphType(theType));
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_VectorsPL, VISU_VectorsPL::GlyphType>
+                  (GetSpecificPL(), &VISU_VectorsPL::SetGlyphType, VISU_VectorsPL::GlyphType(theType)));
 }
 
 //---------------------------------------------------------------
@@ -233,7 +239,8 @@ void
 VISU::Vectors_i
 ::SetGlyphPos(VISU::Vectors::GlyphPos thePos) 
 { 
-  myVectorsPL->SetGlyphPos(VISU_VectorsPL::GlyphPos(thePos));
+  ProcessVoidEvent(new TVoidMemFun1ArgEvent<VISU_VectorsPL, VISU_VectorsPL::GlyphPos>
+                  (GetSpecificPL(), &VISU_VectorsPL::SetGlyphPos, VISU_VectorsPL::GlyphPos(thePos)));
 }
 
 //---------------------------------------------------------------