]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
13246. Wrapped the following methods by SALOME_Event's:
authorsrn <srn@opencascade.com>
Fri, 19 Jan 2007 13:24:59 +0000 (13:24 +0000)
committersrn <srn@opencascade.com>
Fri, 19 Jan 2007 13:24:59 +0000 (13:24 +0000)
VISU_ScalarMap_i
SetRange
VISU_ColoredPrs3d_i
SetNbColors
VISU_CutLines_i
SetOrientaton, SetOrienation2
VISU_IsoSurfaces_i
SetNbSurfaces
VISU_CutPlanes_i
SetNbPlanes, SetOrienation
VISU_Gen_i
CreateTable

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_Gen_i.cc
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_StreamLines_i.cc

index 08657c70532f9a2bd21659394b75e7ceb390b24c..309473f11ab124f00bfcf67aa93ca3a4597eb0ff 100644 (file)
@@ -199,7 +199,22 @@ void
 VISU::ColoredPrs3d_i
 ::SetNbColors(CORBA::Long theNbColors)
 {
-  myScalarMapPL->SetNbColors(theNbColors);
+  struct TEvent: public SALOME_Event {
+    VISU_ScalarMapPL* myMap;
+    int myNbColors;
+    TEvent( VISU_ScalarMapPL* theMap, int theNbColors)
+      :myMap(theMap), myNbColors(theNbColors)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myMap->SetNbColors(myNbColors);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myScalarMapPL, theNbColors));
 }
 
 CORBA::Long 
index d078935e3bf934381f1173d2e6fc87c3bd080be1..46132a1d989baa13238ad98f42235224770f648b 100644 (file)
@@ -33,6 +33,7 @@
 #include "VISU_PipeLineUtils.hxx"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 #include <vtkAppendPolyData.h>
 
@@ -192,14 +193,52 @@ VISU::CutLines_i::~CutLines_i(){
 void VISU::CutLines_i::SetOrientation(VISU::CutPlanes::Orientation theOrient,
                                      CORBA::Double theXAngle, CORBA::Double theYAngle)
 {
-  myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                              theXAngle,theYAngle);
+
+  struct TEvent: public SALOME_Event {
+    VISU_CutLinesPL* myCutLinesPL;
+    CORBA::Double myXAngle, myYAngle;
+    VISU::CutPlanes::Orientation myOrient;
+    TEvent( VISU_CutLinesPL* theCutLines, VISU::CutPlanes::Orientation theOrient,
+           CORBA::Double theXAngle, CORBA::Double theYAngle)
+      :myCutLinesPL(theCutLines), myOrient(theOrient), myXAngle(theXAngle), myYAngle(theYAngle)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(myOrient),
+                                 myXAngle, myYAngle);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myCutLinesPL, theOrient, theXAngle, theYAngle));
+
 }
+
 void VISU::CutLines_i::SetOrientation2(VISU::CutPlanes::Orientation theOrient,
                                       CORBA::Double theXAngle, CORBA::Double theYAngle)
 {
-  myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                              theXAngle,theYAngle,1);
+  struct TEvent: public SALOME_Event {
+    VISU_CutLinesPL* myCutLinesPL;
+    CORBA::Double myXAngle, myYAngle;
+    VISU::CutPlanes::Orientation myOrient;
+    TEvent( VISU_CutLinesPL* theCutLines, VISU::CutPlanes::Orientation theOrient,
+           CORBA::Double theXAngle, CORBA::Double theYAngle)
+      :myCutLinesPL(theCutLines), myOrient(theOrient), myXAngle(theXAngle), myYAngle(theYAngle)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myCutLinesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(myOrient),
+                                 myXAngle, myYAngle, 1);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myCutLinesPL, theOrient, theXAngle, theYAngle));
+
 }
 
 VISU::CutPlanes::Orientation VISU::CutLines_i::GetOrientationType() { 
index 300957a4af4078151c6c5a8e688ea9421af44737..a23d15bfc6da15a6dcfb7fd6cbf4a27d5ce953e2 100644 (file)
@@ -30,6 +30,7 @@
 #include "VISU_Actor.h"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 using namespace VISU;
 using namespace std;
@@ -133,8 +134,25 @@ VISU::CutPlanes_i::~CutPlanes_i(){
 void VISU::CutPlanes_i::SetOrientation(VISU::CutPlanes::Orientation theOrient,
                                       CORBA::Double theXAngle, CORBA::Double theYAngle)
 {
-  myCutPlanesPL->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(theOrient),
-                               theXAngle,theYAngle);
+  struct TEvent: public SALOME_Event {
+    VISU_CutPlanesPL* myCutPlanes;
+    CORBA::Double myXAngle, myYAngle;
+    VISU::CutPlanes::Orientation myOrient;
+    TEvent( VISU_CutPlanesPL* theCutPlanes, VISU::CutPlanes::Orientation theOrient,
+           CORBA::Double theXAngle, CORBA::Double theYAngle)
+      :myCutPlanes(theCutPlanes), myOrient(theOrient), myXAngle(theXAngle), myYAngle(theYAngle)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myCutPlanes->SetOrientation(VISU_CutPlanesPL::PlaneOrientation(myOrient),
+                                 myXAngle, myYAngle);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myCutPlanesPL, theOrient, theXAngle, theYAngle));
 }
 
 VISU::CutPlanes::Orientation VISU::CutPlanes_i::GetOrientationType() { 
@@ -173,8 +191,25 @@ CORBA::Boolean VISU::CutPlanes_i::IsDefault(CORBA::Long thePlaneNumber){
 
 
 void VISU::CutPlanes_i::SetNbPlanes(CORBA::Long theNb) { 
-  myCutPlanesPL->SetNbParts(theNb);
+
+  struct TEvent: public SALOME_Event {
+    VISU_CutPlanesPL* myCutPlanes;
+    CORBA::Long myNbPlanes;
+    TEvent( VISU_CutPlanesPL* theCutPlanes, int theNbPlanes)
+      :myCutPlanes(theCutPlanes), myNbPlanes(theNbPlanes)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myCutPlanes->SetNbParts(myNbPlanes);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myCutPlanesPL, theNb));
 }
+
 CORBA::Long VISU::CutPlanes_i::GetNbPlanes() { 
   return myCutPlanesPL->GetNbParts();
 }
index 65011443624a18b9f96754fce7d32a290b556f09..60a78ad0318a2a41f2712804868c847283d7c7bf 100644 (file)
@@ -960,17 +960,41 @@ namespace VISU
     return Prs3dOnField<VISU::CutLines_i>(theResult,theMeshName,theEntity,theFieldName,theIteration)._retn();
   }
 
-  Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry){
+  struct CreateTableEvent: public SALOME_Event
+  {
+    SALOMEDS::Study_var myStudyDocument;
+    const char* myTableEntry;
+    typedef Table_ptr TResult;
+    TResult myResult;
+    
+    CreateTableEvent(const SALOMEDS::Study_var& theStudy, const char* theTableEntry)
+    {
+      myStudyDocument = theStudy;
+      myTableEntry = theTableEntry;
+      myResult = Table::_nil();
+    }
+    
+    virtual
+    void
+    Execute()
+    {
+      Table_i* pPresent = new Table_i(myStudyDocument,myTableEntry);
+      if(pPresent->Create() != NULL)
+       myResult = pPresent->_this();
+      else{
+       pPresent->_remove_ref();
+       myResult = VISU::Table::_nil();
+      }
+    }
+  };
+
+
+  Table_ptr VISU_Gen_i::CreateTable(const char* theTableEntry)
+  {
     if(myStudyDocument->GetProperties()->IsLocked())
       return Table::_nil();
     Mutex mt(myMutex);
-    Table_i* pPresent = new Table_i(myStudyDocument,theTableEntry);
-    if(pPresent->Create() != NULL)
-      return pPresent->_this();
-    else{
-      pPresent->_remove_ref();
-      return VISU::Table::_nil();
-    }
+    return ProcessEvent(new CreateTableEvent(myStudyDocument, theTableEntry));
   }
 
   Curve_ptr VISU_Gen_i::CreateCurve(Table_ptr theTable,
index 03559ba3e75ea02604117a7e9b34e7375dd6abd0..0f8b392b75229e067cda2649e03c18d15292ca76 100644 (file)
@@ -30,6 +30,7 @@
 #include "VISU_Actor.h"
 
 #include "SUIT_ResourceMgr.h"
+#include "SALOME_Event.hxx"
 
 using namespace VISU;
 using namespace std;
@@ -112,8 +113,25 @@ VISU::IsoSurfaces_i::~IsoSurfaces_i(){
 
 
 void VISU::IsoSurfaces_i::SetNbSurfaces(CORBA::Long theNb){
-  myIsoSurfacesPL->SetNbParts(theNb);
+
+  struct TEvent: public SALOME_Event {
+    VISU_IsoSurfacesPL* myIsoSurfacesPL;
+    CORBA::Long myNb;
+    TEvent( VISU_IsoSurfacesPL* theIsoSurfacesPL, int theNb)
+      :myIsoSurfacesPL(theIsoSurfacesPL), myNb(theNb)
+    {}
+
+    virtual
+    void
+    Execute()
+    {
+      myIsoSurfacesPL->SetNbParts(myNb);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myIsoSurfacesPL, theNb));
 }
+
 CORBA::Long VISU::IsoSurfaces_i::GetNbSurfaces(){
   return myIsoSurfacesPL->GetNbParts();
 }
index 5e1f83c6b72d2eb66afb9908f9bc21fb634acf37..27e98bc2bcb4f2a16b0e11d5f96c7543168a4356 100644 (file)
@@ -38,6 +38,8 @@
 #include <vtkDataSetMapper.h>
 #include <vtkTextProperty.h>
 
+#include "SALOME_Event.hxx"
+
 using namespace VISU;
 using namespace std;
 
@@ -240,8 +242,26 @@ VISU::ScalarMap_i
 {
   if(theMin > theMax) 
     return;
-  vtkFloatingPointType aScalarRange[2] = {theMin, theMax};
-  myScalarMapPL->SetScalarRange(aScalarRange);
+
+  struct TEvent: public SALOME_Event {
+    VISU_ScalarMapPL* myMap;
+    vtkFloatingPointType myRange[2];
+    TEvent( VISU_ScalarMapPL* theMap, const vtkFloatingPointType&  theMin , const vtkFloatingPointType& theMax)
+      :myMap(theMap)
+    {
+      myRange[0] = theMin;
+      myRange[1] = theMax;
+    }
+
+    virtual
+    void
+    Execute()
+    {
+      myMap->SetScalarRange(myRange);
+    }
+  };
+
+  ProcessVoidEvent(new TEvent(myScalarMapPL, theMin, theMax));
   myIsFixedRange = true;
 }
 
index ba959d3ae53c7480e6bc2a450afe214fdc7fdc11..e3b8565bedd66965a3bb2b30c8d7d75e9f264960 100644 (file)
@@ -190,7 +190,8 @@ VISU::StreamLines_i::SetParams(CORBA::Double theIntStep,
                                              thePercents,
                                              theDirection,
                                              1);
-  if(isAccepted == 1) SetSource(aPrs3di);
+  if(isAccepted == 1) 
+    SetSource(aPrs3di);
   return isAccepted == 1;
 }