]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
1. To implement callback mechanism for Model & VTK Actor interaction
authorapo <apo@opencascade.com>
Mon, 19 Sep 2005 06:01:33 +0000 (06:01 +0000)
committerapo <apo@opencascade.com>
Mon, 19 Sep 2005 06:01:33 +0000 (06:01 +0000)
2. To remove VISU_Actor::GetParent method

23 files changed:
src/OBJECT/Makefile.in
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_Actor.h
src/OBJECT/VISU_ActorFactory.h
src/OBJECT/VISU_MeshAct.cxx
src/OBJECT/VISU_ScalarMapAct.cxx
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Prs3dTools.h
src/VISUGUI/VisuGUI_TimeAnimation.cxx
src/VISUGUI/VisuGUI_Tools.cxx
src/VISUGUI/VisuGUI_ViewTools.h
src/VISU_I/Makefile.in
src/VISU_I/VISUConfig.hh
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_I.cxx [new file with mode: 0644]
src/VISU_I/VISU_Prs3d_i.cc
src/VISU_I/VISU_Prs3d_i.hh
src/VISU_I/VISU_ViewManager_i.cc
src/VVTK/VVTK_Renderer.cxx
src/VVTK/VVTK_ViewWindow.cxx
src/VVTK/VVTK_ViewWindow.h

index 07df18eb4d568e96ebfdb510f6d5b2b20ef5ab2d..a68549744d5d12cd3c68811ad37fca9757dbba9a 100644 (file)
@@ -56,13 +56,24 @@ LIB_CLIENT_IDL =
 BIN = 
 BIN_SRC        =
 
-CPPFLAGS+= $(OCC_INCLUDES) $(VTK_INCLUDES) \
-       -I${KERNEL_ROOT_DIR}/include/salome \
+CPPFLAGS+= \
+       $(OCC_INCLUDES) \
+       $(VTK_INCLUDES) \
+       $(BOOST_CPPFLAGS) \
        -I${MED_ROOT_DIR}/include/salome \
        -I${GUI_ROOT_DIR}/include/salome \
-       $(BOOST_CPPFLAGS)
+       -I${KERNEL_ROOT_DIR}/include/salome
 
-LDFLAGS+= $(VTK_LIBS) -lSalomeObject -lSVTK -lVisuPipeLine \
-       -L${KERNEL_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome
+LDFLAGS+= \
+       $(VTK_LIBS)  \
+       $(BOOST_LIBS) \
+       -L${GUI_ROOT_DIR}/lib/salome \
+       -L${KERNEL_ROOT_DIR}/lib/salome 
+
+LIBS+=  \
+       -lboost_signals-mt \
+       -lSalomeObject \
+       -lVisuPipeLine \
+       -lSVTK
 
 @CONCLUDE@
index eb5fee3930fd1b49cc4dc1e2260e46badff5b3a5..c0c85f0c2eb194f28cd93957a403ec600da9750f 100644 (file)
@@ -21,8 +21,8 @@
 //
 //
 //
-//  File   : VISU_Actor.cxx
-//  Author : Laurent CORNABE with help of Nicolas REJNERI
+//  File   : 
+//  Author : 
 //  Module : VISU
 //  $Header$
 
@@ -57,6 +57,8 @@
 #include <vtkGeometryFilter.h>
 #include <vtkObjectFactory.h>
 
+#include <boost/bind.hpp>
+
 #include "utilities.h"
 
 using namespace std;
@@ -74,9 +76,9 @@ static int MYDEBUG = 0;
 vtkStandardNewMacro(VISU_Actor);
 
 //----------------------------------------------------------------------------
-VISU_Actor::VISU_Actor():
+VISU_Actor
+::VISU_Actor():
   myIsVTKMapping(false),
-  myParent(this),
   myPrs3d(NULL),
   myActorFactory(NULL),
   myMapper(vtkDataSetMapper::New()),
@@ -86,6 +88,7 @@ VISU_Actor::VISU_Actor():
   myAnnotationMapper(vtkTextMapper::New()),
   myAnnotationActor(vtkTextActor::New())
 {
+  if(MYDEBUG) MESSAGE("VISU_Actor() - this = "<<this);
   SetDebug(MYVTKDEBUG);
 
   myMapper->Delete();
@@ -119,6 +122,7 @@ VISU_Actor
 VISU_Actor
 ::~VISU_Actor()
 {
+  if(MYDEBUG) MESSAGE("~VISU_Actor() - this = "<<this);
   SALOME_Actor::SetProperty(NULL);
 }
 
@@ -147,6 +151,13 @@ VISU_Actor
 }
 
 //----------------------------------------------------------------------------
+VISU::TActorFactory* 
+VISU_Actor
+::GetFactory()
+{ 
+  return myActorFactory;
+}
+
 void
 VISU_Actor
 ::SetFactory(VISU::TActorFactory* theActorFactory)
@@ -154,13 +165,22 @@ VISU_Actor
   myActorFactory = theActorFactory;
 }
 
-VISU::TActorFactory* 
+void 
 VISU_Actor
-::GetFactory()
-{ 
-  return myActorFactory;
+::Connect(VISU_Actor* theActor)
+{
+  mySetVisibilitySignal.connect(boost::bind(&VISU_Actor::SetVisibility,theActor,_1));
 }
 
+void
+VISU_Actor
+::Update()
+{
+  myActorFactory->UpdateActor(this);
+  SALOME_Actor::Update();
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU_Actor
@@ -206,21 +226,6 @@ VISU_Actor
   return myPipeLine.GetPointer();
 }
 
-//----------------------------------------------------------------------------
-void
-VISU_Actor
-::SetParent(VISU_Actor* theParent)
-{ 
-  myParent = theParent;
-}
-
-VISU_Actor* 
-VISU_Actor
-::GetParent()
-{ 
-  return myParent;
-}
-
 
 //----------------------------------------------------------------------------
 void
@@ -228,6 +233,7 @@ VISU_Actor
 ::SetVisibility(int theMode)
 {
   SALOME_Actor::SetVisibility(theMode);
+  mySetVisibilitySignal(GetVisibility());
 }
 
 int
index ba04ea287cfbe65b21254c7ee05657cdf323a709..0d1a5df10e62f7e38a86859759248caefe653040 100644 (file)
@@ -21,8 +21,8 @@
 //
 //
 //
-//  File   : VISU_Actor.h
-//  Author : Laurent CORNABE with the help of Nicolas REJNERI
+//  File   : 
+//  Author : 
 //  Module : VISU
 //  $Header$
 
@@ -34,6 +34,7 @@
 
 #include <string>
 #include <vtkSmartPointer.h>
+#include <boost/signals/signal1.hpp>
 
 class vtkProp;
 class vtkProperty;
@@ -67,6 +68,7 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor
   void
   setIO(const Handle(SALOME_InteractiveObject)& theIO);
 
+  //----------------------------------------------------------------------------
   VISU::Prs3d_i* 
   GetPrs3d();
 
@@ -74,6 +76,7 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor
   void
   SetPrs3d(VISU::Prs3d_i* thePrs3d);
 
+  //----------------------------------------------------------------------------
   VISU::TActorFactory* 
   GetFactory();
 
@@ -81,6 +84,15 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor
   void
   SetFactory(VISU::TActorFactory* theActorFactory);
 
+  virtual 
+  void
+  Connect(VISU_Actor* theActor);
+
+  virtual
+  void
+  Update();
+
+  //----------------------------------------------------------------------------
   virtual
   VISU_PipeLine* 
   GetPipeLine();
@@ -89,13 +101,6 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor
   void
   SetPipeLine(VISU_PipeLine* thePipeLine) ;
 
-  VISU_Actor* 
-  GetParent();
-
-  virtual
-  void
-  SetParent(VISU_Actor* theParent);
-
   //----------------------------------------------------------------------------
   virtual
   void
@@ -210,6 +215,7 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor
 
  protected:
   VISU_Actor();
+
   virtual
   ~VISU_Actor();
  
@@ -218,15 +224,17 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor
   SetMapperInput(vtkDataSet* theDataSet);
 
   bool myIsVTKMapping;
-  VISU_Actor* myParent;
   VISU::Prs3d_i* myPrs3d;
   vtkSmartPointer<VISU_PipeLine> myPipeLine;
   vtkSmartPointer<vtkDataSetMapper> myMapper;
+
   VISU::TActorFactory* myActorFactory;
+  boost::signal1<void,int> mySetVisibilitySignal;
 
   vtkSmartPointer<VTKViewer_ShrinkFilter> myShrinkFilter;
   bool myIsShrinkable;
   bool myIsShrunk;
+
   vtkSmartPointer<vtkTextMapper> myAnnotationMapper;
   vtkSmartPointer<vtkTextActor>  myAnnotationActor;
 };
index 9a0c219812ad1619935cbd07c83f9659c3e2c2bb..a41cbfed2e4629da00c49cb5c478c861167c622e 100644 (file)
@@ -42,7 +42,11 @@ namespace VISU
   {
     virtual 
     VISU_Actor* 
-    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL) = 0;
+    CloneActor(VISU_Actor* theActor) = 0;
+
+    virtual 
+    void
+    UpdateActor(VISU_Actor* theActor) = 0;
 
     virtual 
     void 
index 68f7446a6c7e2000cd61fb7644f9004c74f5ae94..b078270e071994ef6c048524073d4ae418920eae 100644 (file)
@@ -47,14 +47,12 @@ VISU_MeshAct::VISU_MeshAct(){
   m = vtkMatrix4x4::New();
 
   mySurfaceActor = VISU_Actor::New();
-  mySurfaceActor->SetParent(this);
   mySurfaceActor->GetProperty()->FrontfaceCullingOff();
   mySurfaceActor->GetProperty()->BackfaceCullingOff();
   mySurfaceActor->SetUserMatrix(m);
   mySurfaceActor->SetRepresentation(2); //SURFACE
 
   myEdgeActor = VISU_Actor::New();
-  myEdgeActor->SetParent(this);
   myEdgeActor->PickableOff();
   myEdgeActor->GetProperty()->FrontfaceCullingOff();
   myEdgeActor->GetProperty()->BackfaceCullingOff();
@@ -62,7 +60,6 @@ VISU_MeshAct::VISU_MeshAct(){
   myEdgeActor->SetRepresentation(1); //WIREFRAME
 
   myNodeActor = VISU_Actor::New();
-  myNodeActor->SetParent(this);
   myNodeActor->PickableOff();
   myNodeActor->GetProperty()->SetPointSize(SALOME_POINT_SIZE);
   myNodeActor->GetProperty()->FrontfaceCullingOff();
@@ -98,12 +95,12 @@ void VISU_MeshAct::SetPrs3d(VISU::Prs3d_i* thePrs3d){
 
 void VISU_MeshAct::AddToRender(vtkRenderer* theRenderer){
   VISU_Actor::AddToRender(theRenderer);
-  theRenderer->AddActor(myEdgeActor);
+  //theRenderer->AddActor(myEdgeActor);
 }
 
 void VISU_MeshAct::RemoveFromRender(vtkRenderer* theRenderer){
   VISU_Actor::RemoveFromRender(theRenderer);
-  theRenderer->RemoveActor(myEdgeActor);
+  //theRenderer->RemoveActor(myEdgeActor);
 }
 
 void VISU_MeshAct::SetPipeLine(VISU_PipeLine* thePipeLine) {
@@ -316,17 +313,20 @@ void VISU_MeshAct::Render(vtkRenderer *ren, vtkMapper *vtkNotUsed(m))
     myNodeActor->GetProperty()->Render(this, ren);
     break;
   case 1: //WIREFRAME
-    //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+    //PAL5268: 
+    myEdgeActor->GetProperty()->Render(this, ren);
     break;
   case 2: //SURFACE
     mySurfaceActor->GetProperty()->Render(this, ren);
     break;
   case 3: //INSIDEFRAME
-    //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+    //PAL5268: 
+    myEdgeActor->GetProperty()->Render(this, ren);
     break;
   case 4: //SURFACEFRAME
-    //PAL5268: myEdgeActor->GetProperty()->Render(this, ren);
+    //PAL5268: 
     mySurfaceActor->GetProperty()->Render(this, ren);
+    myEdgeActor->GetProperty()->Render(this, ren);
     break;
   }
 
@@ -350,9 +350,9 @@ void VISU_MeshAct::Render(vtkRenderer *ren, vtkMapper *vtkNotUsed(m))
     matrix = myEdgeActor->GetUserMatrix();
     break;
   case 4: //SURFACEFRAME
-    matrix = myEdgeActor->GetUserMatrix();
-    this->GetMatrix(matrix);
     matrix = mySurfaceActor->GetUserMatrix();
+    this->GetMatrix(matrix);
+    matrix = myEdgeActor->GetUserMatrix();
     break;
   }
   this->GetMatrix(matrix);
@@ -362,17 +362,20 @@ void VISU_MeshAct::Render(vtkRenderer *ren, vtkMapper *vtkNotUsed(m))
     myNodeActor->Render(ren,bestMapper);
     break;
   case 1: //WIREFRAME
-    //PAL5268: myEdgeActor->Render(ren,bestMapper);
+    //PAL5268: 
+    myEdgeActor->Render(ren,bestMapper);
     break;
   case 2: //SURFACE
     mySurfaceActor->Render(ren,bestMapper);
     break;
   case 3: //INSIDEFRAME
-    //PAL5268: myEdgeActor->Render(ren,bestMapper);
+    //PAL5268: 
+    myEdgeActor->Render(ren,bestMapper);
     break;
   case 4: //SURFACEFRAME
-    //PAL5268: myEdgeActor->Render(ren,bestMapper);
+    //PAL5268: 
     mySurfaceActor->Render(ren,bestMapper);
+    myEdgeActor->Render(ren,bestMapper);
     break;
   }
 
@@ -383,7 +386,8 @@ void VISU_MeshAct::Render(vtkRenderer *ren, vtkMapper *vtkNotUsed(m))
 void VISU_MeshAct::Modified()
 {
   myNodeActor->Modified();
-  //PAL5268: myEdgeActor->Modified();
+  //PAL5268: 
+  myEdgeActor->Modified();
   mySurfaceActor->Modified();
   this->vtkActor::Modified();
 }
index 01449f79b21e3d63a93c441610c1868223ca1c8f..391ec4126e2be4d0e7babfa689c38891b0f4e0ce 100644 (file)
@@ -35,7 +35,9 @@
 
 vtkStandardNewMacro(VISU_ScalarMapAct);
 
-VISU_ScalarMapAct::VISU_ScalarMapAct(){
+VISU_ScalarMapAct
+::VISU_ScalarMapAct()
+{
   myScalarBar = VISU_ScalarBarActor::New();
 
   vtkProperty* aProperty = GetProperty();
@@ -49,32 +51,49 @@ VISU_ScalarMapAct::VISU_ScalarMapAct(){
   myProperty->DeepCopy(aProperty);
 }
 
-VISU_ScalarMapAct::~VISU_ScalarMapAct(){
+VISU_ScalarMapAct
+::~VISU_ScalarMapAct()
+{
   myScalarBar->Delete();
 }
 
-void VISU_ScalarMapAct::AddToRender(vtkRenderer* theRenderer){
-  SALOME_Actor::AddToRender(theRenderer);
+void
+VISU_ScalarMapAct
+::AddToRender(vtkRenderer* theRenderer)
+{
+  VISU_Actor::AddToRender(theRenderer);
   if(myScalarBar)
     theRenderer->AddActor2D(myScalarBar);
 }
 
-void VISU_ScalarMapAct::RemoveFromRender(vtkRenderer* theRenderer){
-  SALOME_Actor::RemoveFromRender(theRenderer);
+void
+VISU_ScalarMapAct
+::RemoveFromRender(vtkRenderer* theRenderer)
+{
+  VISU_Actor::RemoveFromRender(theRenderer);
   if(myScalarBar)
     theRenderer->RemoveActor(myScalarBar);
 }
 
-void VISU_ScalarMapAct::SetVisibility(int theMode){
-  SALOME_Actor::SetVisibility(theMode);
+void
+VISU_ScalarMapAct
+::SetVisibility(int theMode)
+{
+  VISU_Actor::SetVisibility(theMode);
   if(myScalarBar) myScalarBar->SetVisibility(myBarVisibility && theMode);
 }
 
-int VISU_ScalarMapAct::GetVisibility(){
-  return SALOME_Actor::GetVisibility();
+int 
+VISU_ScalarMapAct
+::GetVisibility()
+{
+  return VISU_Actor::GetVisibility();
 }
 
-void VISU_ScalarMapAct::SetBarVisibility(bool theMode){
+void
+VISU_ScalarMapAct
+::SetBarVisibility(bool theMode)
+{
   myBarVisibility = theMode;
   if(myScalarBar) myScalarBar->SetVisibility(myBarVisibility);
 }
index 38f90691e875a4184a98155f4af6ca938b9faae4..5d67cbe38e0b75ed551f664d57ec0afd2845f817 100644 (file)
@@ -814,7 +814,6 @@ OnEraseAll()
       for (anActColl->InitTraversal(); (anActor = anActColl->GetNextActor()) != NULL; ) {
         if (anActor->GetVisibility() > 0)
           if (VISU_Actor* anVISUActor = VISU_Actor::SafeDownCast(anActor)) {
-            anVISUActor = anVISUActor->GetParent();
             anVISUActor->VisibilityOff();
           }
       }
index 63444a9924fcedc7556df816bb30482ceb2c47a0..aef3c0a1a685613fff1cdfce0d2a351b31a3c5f1 100644 (file)
@@ -44,24 +44,24 @@ namespace VISU
   EditPrs3d(VisuGUI* theModule, 
            VISU::Prs3d_i* thePrs3d)
   {
-    if(TPrs3d_i* aPrsObject = dynamic_cast<TPrs3d_i*>(thePrs3d)){
+    if(TPrs3d_i* aPrs3d = dynamic_cast<TPrs3d_i*>(thePrs3d)){
       TDlg* aDlg = new TDlg (theModule);
-      aDlg->initFromPrsObject(aPrsObject);
+      aDlg->initFromPrsObject(aPrs3d);
       if (aDlg->exec()) {
-       if (!(aDlg->storeToPrsObject(aPrsObject))) {
+       if (!(aDlg->storeToPrsObject(aPrs3d))) {
          delete aDlg;
          return;
        }
-       RecreateActor(theModule,aPrsObject);
+       aPrs3d->UpdateActors();
        typedef typename TViewer::TViewWindow TViewWindow;
-       if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule,true)){
+       if(TViewWindow* aViewWindow = GetViewWindow<TViewer>(theModule)){
          aViewWindow->getRenderer()->ResetCameraClippingRange();
          aViewWindow->Repaint();
        }
        // Optionally, create table and curves for cut lines
        QApplication::setOverrideCursor(Qt::waitCursor);
        CreateCurves( theModule,
-                     dynamic_cast<VISU::CutLines_i*>( aPrsObject ),
+                     dynamic_cast<VISU::CutLines_i*>( aPrs3d ),
                      aDlg,
                      false ); // in edition mode
        QApplication::restoreOverrideCursor();
index 0598764e379343b0ef5915d9b230453c50914dfd..8ff2718a3da2a5307879a8a00f18c7dcc57329f2 100644 (file)
@@ -94,7 +94,7 @@ ArrangeDlg::ArrangeDlg(QWidget* theParent, SVTK_ViewWindow* theViewWindow)
     VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor);
     if (anVISUActor)
       if (anVISUActor->GetVisibility() != 0) {
-       VISU::Prs3d_i* aPrs = anVISUActor->GetParent()->GetPrs3d();
+       VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
        if (aPrs) {
          if (!myPrsMap.contains(aPrs)) {
            SALOMEDS::SObject_var aSObject = aPrs->GetSObject();
index a4f91d61cd546399d2e7d124e65c8b9ccdea5a56..85a6db882e48af453b96dec01ea7a9c561ce7ba1 100644 (file)
@@ -671,12 +671,12 @@ namespace VISU
         VISU::Prs3d_i* aPrs = anVISUActor->GetPrs3d();
         if(aPrs == NULL) continue;
         if (thePrs == aPrs) {
-          aResActor = anVISUActor->GetParent();
+          aResActor = anVISUActor;
           thePrs->UpdateActor(aResActor);
           aResActor->VisibilityOn();
 
         } else if (theDispOnly) {
-          anVISUActor->GetParent()->VisibilityOff();
+          anVISUActor->VisibilityOff();
         } else {
         }
       } else if (theDispOnly && anActor->GetVisibility()) {
@@ -726,7 +726,7 @@ namespace VISU
     if(vtkRenderer* aRenderer = theViewWindow->getRenderer()){
       if(vtkActorCollection* aCollection = aRenderer->GetActors()){
         if(VISU_Actor* anActor = Find<VISU_Actor>(aCollection,TIsSameEntry<VISU_Actor>(theEntry))){
-          return anActor->GetParent();
+          return anActor;
         }
       }
     }
index fb288f78660025178b79accbafd595fe86a5c398..8a12e3c7da03db675bc35962215a9fab2d1fd23c 100644 (file)
@@ -139,11 +139,11 @@ namespace VISU
        if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
          if(VISU::Prs3d_i* aPrs3d = anActor->GetPrs3d()){
            if(thePrs == aPrs3d){
-             aResActor = anActor->GetParent();
-             thePrs->UpdateActor(aResActor);
+             aResActor = anActor;
+             thePrs->UpdateActors();
              aResActor->VisibilityOn();
            }else if(theDispOnly){
-             anActor->GetParent()->VisibilityOff();
+             anActor->VisibilityOff();
            }
          }else if(theDispOnly && anActor->GetVisibility()){
            anActor->VisibilityOff();
@@ -178,7 +178,6 @@ namespace VISU
        while(vtkActor *anAct = aCollection->GetNextActor()){
          if(anAct->GetVisibility() > 0)
            if(VISU_Actor* anActor = dynamic_cast<VISU_Actor*>(anAct)){
-             anActor = anActor->GetParent();
              anActor->VisibilityOff();
            }
        }
@@ -208,7 +207,7 @@ namespace VISU
     if(vtkRenderer* aRenderer = theViewWindow->getRenderer()){
       if(vtkActorCollection* aCollection = aRenderer->GetActors()){
         if(VISU_Actor* anActor = Find<VISU_Actor>(aCollection,TIsSameEntry<VISU_Actor>(theEntry))){
-          return anActor->GetParent();
+          return anActor;
         }
       }
     }
index d8631a4786f71aa8ed71d52213ff6f3eba540128..af558c6fab0246d6aaf22a440b423a962b9f7eef 100644 (file)
@@ -18,53 +18,115 @@ VPATH=.:@srcdir@:@top_srcdir@/idl
 # Libraries targets
 LIB = libVISUEngineImpl.la
 
-LIB_SRC = VISUConfig.cc VISU_Gen_i.cc \
-       VISU_Result_i.cc VISU_PrsObject_i.cc VISU_Table_i.cc \
-       VISU_Prs3d_i.cc VISU_Mesh_i.cc VISU_ScalarMap_i.cc \
-       VISU_IsoSurfaces_i.cc VISU_DeformedShape_i.cc \
-       VISU_Plot3D_i.cc VISU_CutPlanes_i.cc VISU_CutLines_i.cc \
-       VISU_Vectors_i.cc VISU_StreamLines_i.cc VISU_GaussPoints_i.cc \
-       VISU_ViewManager_i.cc VISU_View_i.cc \
-       VISU_TimeAnimation.cxx VISU_CorbaMedConvertor.cxx \
+LIB_SRC = \
+       VISUConfig.cc \
+       VISU_Gen_i.cc \
+       VISU_Result_i.cc \
+       VISU_PrsObject_i.cc \
+       VISU_Table_i.cc \
+       VISU_Prs3d_i.cc \
+       VISU_Mesh_i.cc \
+       VISU_ScalarMap_i.cc \
+       VISU_IsoSurfaces_i.cc \
+       VISU_DeformedShape_i.cc \
+       VISU_Plot3D_i.cc \
+       VISU_CutPlanes_i.cc \
+       VISU_CutLines_i.cc \
+       VISU_Vectors_i.cc \
+       VISU_StreamLines_i.cc \
+       VISU_GaussPoints_i.cc \
+       VISU_ViewManager_i.cc \
+       VISU_View_i.cc \
+       VISU_TimeAnimation.cxx \
+       VISU_CorbaMedConvertor.cxx \
        VISU_DumpPython.cc
 
-LIB_MOC = VISU_TimeAnimation.h
+LIB_MOC = \
+       VISU_TimeAnimation.h
 
-LIB_SERVER_IDL = VISU_Gen.idl SALOME_Component.idl \
-                 SALOME_Exception.idl SALOME_GenericObj.idl MED.idl
+LIB_SERVER_IDL = \
+       MED.idl \
+       VISU_Gen.idl \
+       SALOME_Component.idl \
+       SALOME_Exception.idl \
+       SALOME_GenericObj.idl 
 
-LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Comm.idl
+LIB_CLIENT_IDL = \
+       SALOMEDS.idl \
+       SALOMEDS_Attributes.idl \
+       SALOME_Comm.idl
 
 # Executables targets
-BIN =
+BIN = VISU_I
 BIN_SRC =
 
 BIN_CLIENT_IDL =
 BIN_SERVER_IDL =
 
-EXPORT_HEADERS = VISUConfig.hh VISU_Gen_i.hh \
-       VISU_Result_i.hh VISU_PrsObject_i.hh VISU_Table_i.hh \
-       VISU_Prs3d_i.hh VISU_Mesh_i.hh VISU_ScalarMap_i.hh \
-       VISU_IsoSurfaces_i.hh VISU_DeformedShape_i.hh \
-       VISU_Plot3D_i.hh VISU_CutPlanes_i.hh VISU_CutLines_i.hh \
-       VISU_Vectors_i.hh VISU_StreamLines_i.hh VISU_GaussPoints_i.hh \
-       VISU_ViewManager_i.hh VISU_View_i.hh \
+EXPORT_HEADERS = \
+       VISUConfig.hh \
+       VISU_Gen_i.hh \
+       VISU_Result_i.hh \
+       VISU_PrsObject_i.hh \
+       VISU_Table_i.hh \
+       VISU_Prs3d_i.hh \
+       VISU_Mesh_i.hh \
+       VISU_ScalarMap_i.hh \
+       VISU_IsoSurfaces_i.hh \
+       VISU_DeformedShape_i.hh \
+       VISU_Plot3D_i.hh \
+       VISU_CutPlanes_i.hh \
+       VISU_CutLines_i.hh \
+       VISU_Vectors_i.hh \
+       VISU_StreamLines_i.hh \
+       VISU_GaussPoints_i.hh \
+       VISU_ViewManager_i.hh \
+       VISU_View_i.hh \
        VISU_TimeAnimation.h
 
 # additionnal information to compil and link file
-CPPFLAGS += -ftemplate-depth-32 $(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) \
-       $(HDF5_INCLUDES) $(QWT_INCLUDES) $(BOOST_CPPFLAGS)\
+CPPFLAGS += \
+       -ftemplate-depth-32 \
+       $(QT_INCLUDES) \
+       $(PYTHON_INCLUDES) \
+       $(OCC_INCLUDES) \
+       $(VTK_INCLUDES) \
+       $(HDF5_INCLUDES) \
+       $(QWT_INCLUDES) \
+       $(BOOST_CPPFLAGS)\
        -I${KERNEL_ROOT_DIR}/include/salome \
        -I${MED_ROOT_DIR}/include/salome \
        -I${GUI_ROOT_DIR}/include/salome
 
-LDFLAGS  += $(PYTHON_LIBS) $(QT_MT_LIBS) $(VTK_LIBS) $(QWT_LIBS) -lSalomeNS -lTOOLSDS \
-       -lSalomeContainer -lOpUtil -lSalomeApp -lVTKViewer -lSVTK -lSPlot2d -lSalomeHDFPersist \
-       -lSalomeGenericObj -lVisuConvertor -lVisuPipeLine -lVisuObject -lVISUGUITOOLS \
+LDFLAGS  += \
+       $(PYTHON_LIBS) \
+       $(QT_MT_LIBS) \
+       $(VTK_LIBS) \
+       $(QWT_LIBS) \
+       $(BOOST_LIBS) \
        -L${KERNEL_ROOT_DIR}/lib/salome \
-       -L${GUI_ROOT_DIR}/lib/salome -lEvent
-
-LIBS+=  -lPlot2d -L${KERNEL_ROOT_DIR}/lib/salome
+       -L${GUI_ROOT_DIR}/lib/salome 
+
+LIBS+=  -lboost_signals-mt \
+       -lSalomeHDFPersist \
+       -lSalomeGenericObj \
+       -lSalomeContainer \
+       -lSalomeNS \
+       -lTOOLSDS \
+       -lOpUtil \
+       -lEvent \
+       -lCASCatch \
+       -lSalomeApp \
+       -lSalomeSession \
+       -lVTKViewer \
+       -lSVTK \
+       -lSPlot2d \
+       -lVisuConvertor \
+       -lVisuPipeLine \
+       -lVisuObject \
+       -lVISUGUITOOLS
+
+LDFLAGSFORBIN=$(LDFLAGS) $(LIBS)
 
 # additional file to be cleaned
 MOSTLYCLEAN =
index 3224f05abd36c7ab41a0d13f706a53a69d2855bc..6ec9a2d015ba90dce00fdd20403169043f77a357 100644 (file)
@@ -39,8 +39,8 @@
 #include "Utils_CorbaException.hxx"
 #include "utilities.h"
 
-#include <SALOMEDSClient_SObject.hxx>
-#include <SALOMEDSClient_Study.hxx>
+#include "SALOMEDSClient_SObject.hxx"
+#include "SALOMEDSClient_Study.hxx"
 
 // QT headers
 #include <qstring.h>
@@ -61,8 +61,8 @@
 class SUIT_Session;
 class SUIT_ResourceMgr;
 
-
-namespace VISU{
+namespace VISU
+{
 
   SUIT_Session *GetSession();
   SUIT_ResourceMgr *GetResourceMgr();
index 198e30cd7b5f170a172e802a8901524f3f032650..0c90309742318ed58a11415326930678d2a196cf 100644 (file)
@@ -41,8 +41,12 @@ static int MYDEBUG = 0;
 //----------------------------------------------------------------------------
 int
 VISU::GaussPoints_i
-::IsPossible(Result_i* theResult, const char* theMeshName, VISU::Entity theEntity, 
-            const char* theFieldName, int theIteration, int isMemoryCheck)
+::IsPossible(Result_i* theResult, 
+            const char* theMeshName, 
+            VISU::Entity theEntity, 
+            const char* theFieldName, 
+            int theIteration, 
+            int isMemoryCheck)
 {
   try{
     if(theEntity != VISU::NODE)
@@ -110,7 +114,7 @@ VISU::GaussPoints_i
 ::Create(const char* theMeshName, VISU::Entity theEntity, 
         const char* theFieldName, int theIteration)
 {
-  return ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
+  return VISU::ScalarMap_i::Create(theMeshName,theEntity,theFieldName,theIteration);
 }
 
 
@@ -120,7 +124,7 @@ VISU::GaussPoints_i
 ::Restore(const Storable::TRestoringMap& theMap)
 {
   DoHook();
-  return ScalarMap_i::Restore(theMap);
+  return VISU::ScalarMap_i::Restore(theMap);
 }
 
 
@@ -129,7 +133,7 @@ void
 VISU::GaussPoints_i
 ::ToStream(std::ostringstream& theStr)
 {
-  ScalarMap_i::ToStream(theStr);
+  VISU::ScalarMap_i::ToStream(theStr);
 }
 
 
@@ -217,6 +221,15 @@ VISU::GaussPoints_i
 }
 
 
+//----------------------------------------------------------------------------
+VISU_Actor* 
+VISU::GaussPoints_i
+::CloneActor(VISU_Actor* theActor) 
+{
+  VISU::ScalarMap_i::CloneActor(theActor);
+}
+
+
 //----------------------------------------------------------------------------
 void 
 VISU::GaussPoints_i
index 1d12e50946046cdce435f00c35e33cf9a5f71512..81737c2a1009a664fd7724b92314c60e1363d6ab 100644 (file)
@@ -99,6 +99,7 @@ namespace VISU
     Storable* 
     Restore(const Storable::TRestoringMap& theMap);
 
+    //----------------------------------------------------------------------------
     virtual 
     VISU_Actor* 
     CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
@@ -107,6 +108,11 @@ namespace VISU
     void
     UpdateActor(VISU_Actor* theActor);
 
+    virtual 
+    VISU_Actor* 
+    CloneActor(VISU_Actor* theActor);
+
+    //----------------------------------------------------------------------------
     virtual 
     void 
     SetImplicitFunction(VISU_Actor* theActor, 
index a6f437c157e8d9560dd246253df3415d02561d17..58c7a2ddd623b7f1776ea1a66dcd8303190ba996 100644 (file)
@@ -90,7 +90,7 @@ using namespace std;
 static QFileInfo aFileInfo;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 1;
+static int MYDEBUG = 0;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -427,8 +427,8 @@ namespace VISU{
            if (SUIT_Study* aSStudy = anApp->activeStudy()) {
              if (SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>(aSStudy)) {
                 if (_PTR(Study) aCStudy = aStudy->studyDS()) {
-                 MESSAGE("There is an application with active study : StudyId = "
-                         << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'");
+                 if(MYDEBUG) MESSAGE("There is an application with active study : StudyId = "
+                                     << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'");
                  if (myStudyName == aCStudy->Name()) {
                    isActive = true;
                    break;
@@ -450,12 +450,12 @@ namespace VISU{
     {
       CORBA::String_var aName = theStudy->Name();
       std::string aStudyName (aName.in());
-      MESSAGE("StudyId = " << theStudy->StudyId() << "; Name = '" << aName.in() << "'");
+      if(MYDEBUG) MESSAGE("StudyId = " << theStudy->StudyId() << "; Name = '" << aName.in() << "'");
       myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
 
       ProcessVoidEvent(new TEvent(aStudyName));
     } else {
-      MESSAGE("CORBA::is_nil(theStudy)");
+      INFOS("CORBA::is_nil(theStudy)");
     }
   }
 
diff --git a/src/VISU_I/VISU_I.cxx b/src/VISU_I/VISU_I.cxx
new file mode 100644 (file)
index 0000000..a3a39f2
--- /dev/null
@@ -0,0 +1,54 @@
+//  SALOME VTKViewer : build VTK viewer into Salome desktop
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+//
+//
+//
+//  File   :
+//  Author :
+//  Module :
+//  $Header$
+
+#include "VISUConfig.hh"
+#include "VISU_Gen_i.hh"
+#include "VISU_Result_i.hh"
+#include "VISU_PrsObject_i.hh"
+#include "VISU_Table_i.hh"
+#include "VISU_Prs3d_i.hh"
+#include "VISU_Mesh_i.hh"
+#include "VISU_ScalarMap_i.hh"
+#include "VISU_IsoSurfaces_i.hh"
+#include "VISU_DeformedShape_i.hh"
+#include "VISU_DeformedShape_i.hh"
+#include "VISU_Plot3D_i.hh"
+#include "VISU_CutPlanes_i.hh"
+#include "VISU_CutLines_i.hh"
+#include "VISU_Vectors_i.hh"
+#include "VISU_StreamLines_i.hh"
+#include "VISU_GaussPoints_i.hh"
+#include "VISU_ViewManager_i.hh"
+#include "VISU_View_i.hh"
+#include "VISU_TimeAnimation.h"
+
+int
+main(int argc, char** argv)
+{
+  return 0;
+}
index 7f1005366f340b45ad74cef76c3899563b0b788f..f59c88d36d7b52b9893d98fc2723630fff3bb953 100644 (file)
 //  Module : VISU
 
 #include "VISU_PipeLine.hxx"
-#include "VISU_Result_i.hh"
 #include "VISU_Prs3d_i.hh"
+
+#include "VISU_Result_i.hh"
 #include "VISU_Actor.h"
 
 #include <vtkGeometryFilter.h>
 #include <vtkDataSetMapper.h>
 
+#include <boost/bind.hpp>
+
 using namespace VISU;
 using namespace std;
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -187,8 +190,10 @@ VISU::Prs3d_i
       anIO = new SALOME_InteractiveObject(mySObject->GetID(),"VISU",GetName());
       theActor->setIO(anIO);
     }
-    theActor->SetPipeLine(GetPipeLine());
     theActor->SetFactory(this);
+    myUpdateActorsSignal.connect(boost::bind(&VISU_Actor::Update,theActor));
+
+    theActor->SetPipeLine(GetPipeLine());
     theActor->SetPrs3d(this);
     theActor->SetPosition(myOffset);
   }catch(std::bad_alloc& ex){
@@ -211,6 +216,24 @@ VISU::Prs3d_i
   theActor->Modified();
 }
 
+VISU_Actor*
+VISU::Prs3d_i
+::CloneActor(VISU_Actor* theActor)
+{
+  VISU_Actor* anActor = CreateActor();
+  theActor->Connect(anActor);
+  return anActor;
+}
+
+void
+VISU::Prs3d_i
+::UpdateActors() 
+{
+  if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActors() - this = "<<this);
+  Update();
+  myUpdateActorsSignal();
+}
+
 
 //----------------------------------------------------------------------------
 void 
index 127a9a0431163f685470e25c2406858d7d2fb3aa..ca444d7e3861c41bca10f50fd9497b0fc17bb4c1 100644 (file)
@@ -28,6 +28,7 @@
 #define VISU_Prs3d_i_HeaderFile
 
 #include "VISU_PrsObject_i.hh"
+
 #include "VISU_ActorFactory.h"
 #include "VISU_ConvertorDef.hxx"
 
@@ -35,6 +36,7 @@
 #include "SALOME_InteractiveObject.hxx"
 
 #include <vtkPlaneSource.h>
+#include <boost/signals/signal0.hpp>
 
 class VISU_PipeLine;
 class VISU_Actor;
@@ -98,6 +100,8 @@ namespace VISU
     SALOMEDS::SObject_var mySObject;
     std::string myMeshName;
 
+    boost::signal0<void> myUpdateActorsSignal;
+
     void
     CreateActor(VISU_Actor* theActor, 
                const Handle(SALOME_InteractiveObject)& theIO = NULL);
@@ -138,6 +142,14 @@ namespace VISU
     void
     UpdateActor(VISU_Actor* theActor);
 
+    virtual 
+    VISU_Actor* 
+    CloneActor(VISU_Actor* theActor);
+
+    virtual 
+    void
+    UpdateActors();
+
     //----------------------------------------------------------------------------
     virtual 
     void 
index b3b88b49f5be3cdba2c5bfc62543bf309ee801fd..2db4d2a30b4b6a0873daec59052c02c86a37b90f 100644 (file)
@@ -295,7 +295,7 @@ namespace VISU {
       if(anActor->IsA("VISU_Actor")){
        anVISUActor = VISU_Actor::SafeDownCast(anActor);
        if (thePrs == anVISUActor->GetPrs3d()) {
-         aResActor = anVISUActor->GetParent();
+         aResActor = anVISUActor;
          if(theDisplaing < eErase)
            aResActor->VisibilityOn();
          else
@@ -456,7 +456,7 @@ namespace VISU {
     while (vtkActor *anActor = anActColl->GetNextActor())
       if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(anActor))
        if (thePrs3d == anVISUActor->GetPrs3d())
-         return anVISUActor->GetParent();
+         return anVISUActor;
     return NULL;
   }
 
@@ -688,7 +688,7 @@ namespace VISU {
            for (; !anActor && aVTKActor; aVTKActor = anActColl->GetNextActor()) {
               if (VISU_Actor* anVISUActor = dynamic_cast<VISU_Actor*>(aVTKActor)) {
                if (thePrs == anVISUActor->GetPrs3d()) {
-                 anActor = anVISUActor->GetParent();
+                 anActor = anVISUActor;
                 }
               }
             }
index 6cf390b7898187e3e2b871410e3927cae96f9c7e..0c8fec25477d354d7272abbb2dacb81e9eafb84d 100644 (file)
@@ -140,6 +140,12 @@ VVTK_Renderer2
   myImplicitFunctionWidget1->AddObserver(vtkCommand::EndInteractionEvent, 
                                         myEventCallbackCommand.GetPointer(), 
                                         myPriority);
+  myImplicitFunctionWidget1->AddObserver(vtkCommand::EnableEvent, 
+                                        myEventCallbackCommand.GetPointer(), 
+                                        myPriority);
+  myImplicitFunctionWidget1->AddObserver(vtkCommand::DisableEvent, 
+                                        myEventCallbackCommand.GetPointer(), 
+                                        myPriority);
   myImplicitFunction = myImplicitFunctionWidget1->ImplicitFunction();
 }
 
index 174523370c9cd12a4d824b20c287cf8a270acae6..5d1801e41d7151ea1a936da2e21aaddc9f63d1e2 100755 (executable)
@@ -94,7 +94,7 @@ VVTK_ViewWindow
   SVTK_ViewWindow::AddActor(theActor,theIsUpdate);
   if(VISU_Actor* anAct = dynamic_cast<VISU_Actor*>(theActor))
     if(VISU::TActorFactory* aFactory = anAct->GetFactory())
-      if(VISU_Actor* anActor = aFactory->CreateActor())
+      if(VISU_Actor* anActor = aFactory->CloneActor(anAct))
        myMainWindow2->AddActor(anActor,theIsUpdate);
 }
 
@@ -108,6 +108,15 @@ VVTK_ViewWindow
   myMainWindow2->RemoveActor(theActor,theIsUpdate);
 }
 
+//----------------------------------------------------------------------------
+void
+VVTK_ViewWindow
+::Repaint(bool theUpdateTrihedron)
+{
+  myMainWindow->Repaint(theUpdateTrihedron);
+  myMainWindow2->Repaint(theUpdateTrihedron);
+}
+
 //----------------------------------------------------------------------------
 void
 VVTK_ViewWindow
index 0aacd4c9d5f94d459668adcbec91ab1e309ec782..b60b095d1f754b40adc92e1f0c2bb2c1e8d9cfcb 100755 (executable)
@@ -22,6 +22,10 @@ public:
   virtual
   ~VVTK_ViewWindow();
 
+  virtual
+  void
+  Initialize(SVTK_ViewModelBase* theModel);
+
   virtual
   void
   AddActor(VTKViewer_Actor* theActor,
@@ -34,7 +38,7 @@ public:
 
   virtual
   void
-  Initialize(SVTK_ViewModelBase* theModel);
+  Repaint(bool theUpdateTrihedron = true);
 
 public slots:
   virtual