From f5b332fed3e604c3b9fc6fc4ab1e7ab5ac6c34c4 Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 26 Sep 2006 09:43:12 +0000 Subject: [PATCH] PAL13474: VISU-STUDY: Error or HangUp or Crash. Wrap calls to GUI from VISU engine with SALOME_Event. --- src/VISU_I/VISU_Prs3d_i.cc | 101 +++++++++++++++++++++++++------------ 1 file changed, 68 insertions(+), 33 deletions(-) diff --git a/src/VISU_I/VISU_Prs3d_i.cc b/src/VISU_I/VISU_Prs3d_i.cc index 70d0e429..461b04f4 100644 --- a/src/VISU_I/VISU_Prs3d_i.cc +++ b/src/VISU_I/VISU_Prs3d_i.cc @@ -91,18 +91,36 @@ VISU::Prs3d_i } } +struct TRemoveActorsFromRendererEvent: public SALOME_Event +{ + typedef boost::signal0 TRemoveActorsFromRendererSignalType; + const TRemoveActorsFromRendererSignalType& myRemoveActorsFromRendererSignalVar; + + TRemoveActorsFromRendererEvent + (const TRemoveActorsFromRendererSignalType& theRemoveActorsFromRendererSignalVar): + myRemoveActorsFromRendererSignalVar(theRemoveActorsFromRendererSignalVar) + {} + + virtual + void + Execute() + { + myRemoveActorsFromRendererSignalVar(); + } +}; + VISU::Prs3d_i -::~Prs3d_i() +::~Prs3d_i() { if(MYDEBUG) MESSAGE("Prs3d_i::~Prs3d_i - this = "<Delete(); myResult->Destroy(); } //---------------------------------------------------------------------------- -VISU::Storable* +VISU::Storable* VISU::Prs3d_i ::Restore(const Storable::TRestoringMap& theMap) { @@ -125,7 +143,7 @@ VISU::Prs3d_i //---------------------------------------------------------------------------- -SALOMEDS::SObject_var +SALOMEDS::SObject_var VISU::Prs3d_i ::GetSObject() { @@ -137,25 +155,25 @@ VISU::Prs3d_i return mySObject; } -Result_i* +Result_i* VISU::Prs3d_i -::GetResult() const -{ +::GetResult() const +{ return myResult; } -const std::string& +const std::string& VISU::Prs3d_i -::GetMeshName() const -{ - return myMeshName; +::GetMeshName() const +{ + return myMeshName; } //---------------------------------------------------------------------------- void VISU::Prs3d_i -::Update() +::Update() { if(MYDEBUG) MESSAGE("Prs3d_i::Update - this = "<GetMapper(); vtkDataSet *aDataSet = aMapper->GetInput(); @@ -185,7 +203,7 @@ VISU::Prs3d_i void VISU::Prs3d_i -::RemoveFromStudy() +::RemoveFromStudy() { struct TRemoveFromStudy: public SALOME_Event { @@ -198,7 +216,7 @@ VISU::Prs3d_i myRemovable(theRemovable), myRemoveFromStudySignal(theRemoveFromStudySignal) {} - + virtual void Execute() @@ -213,21 +231,21 @@ VISU::Prs3d_i //---------------------------------------------------------------------------- -VISU_PipeLine* +VISU_PipeLine* VISU::Prs3d_i ::GetPipeLine() { return GetPL(); } -VISU_PipeLine* +VISU_PipeLine* VISU::Prs3d_i ::GetPL() { return myPipeLine; } -vtkUnstructuredGrid* +vtkUnstructuredGrid* VISU::Prs3d_i:: GetInput() { @@ -274,7 +292,7 @@ VISU::Prs3d_i void VISU::Prs3d_i -::RemoveActor(VISU_Actor* theActor) +::RemoveActor(VISU_Actor* theActor) { if(MYDEBUG) MESSAGE("Prs3d_i::RemoveActor - this = "<