Salome HOME
Merge from BR_WIN_INDUS_514 branch 21/03/2011 (Windows industrialization)
[modules/visu.git] / src / VISU_I / VISU_Prs3dUtils.cc
index 60781b56423ccce1c83e27956b8c59d31ce2367b..77675648ba550e04d8ca47014677bf9a49e89571 100644 (file)
@@ -23,6 +23,8 @@
 //  Module : VISU
 //
 #include "VISU_Prs3dUtils.hh"
+#include "VISU_Prs3d_i.hh"
+#include "VISU_PointMap3d_i.hh"
 #include "SalomeApp_Study.h"
 #include "SALOME_Event.h"
 
@@ -31,8 +33,8 @@ namespace VISU
 {
   //----------------------------------------------------------------------------
   TSetModified
-  ::TSetModified(VISU::Prs3d_i* thePrs3d):
-    myPrs3d(thePrs3d)
+  ::TSetModified(VISU::PrsObject_i* thePrsObject):
+    myPrsObject(thePrsObject)
   {
     this->Modified();
   }
@@ -53,17 +55,29 @@ namespace VISU
       void
       Execute()
       {
-       VISU::Prs3d_i* aPrs3d = mySetModified->myPrs3d;
-
-       if(!aPrs3d || aPrs3d->GetActorEntry() == "")
-         return;
+       VISU::PrsObject_i* aPrsObject = mySetModified->myPrsObject;
+       if(!aPrsObject)
+               return;
+
+       VISU::Prs3d_i* aPrs3d;
+       VISU::PointMap3d_i* aPntMap;
+       SalomeApp_Study* aStudy;
+       unsigned long int time;
+       if( (aPrs3d = dynamic_cast<VISU::Prs3d_i*>(aPrsObject)) && aPrs3d->GetActorEntry() != "" ) {
+               aStudy = aPrs3d->GetGUIStudy();
+               time = aPrs3d->GetMTime();
+       } else if ( aPntMap = dynamic_cast<VISU::PointMap3d_i*>(aPrsObject) ) {
+               aStudy = aPntMap->GetGUIStudy();
+               time = aPntMap->GetMTime();
+       } else 
+               return;
        
-       if(aPrs3d->GetMTime() > mySetModified->GetMTime()){
-         if(SalomeApp_Study* aStudy = aPrs3d->GetGUIStudy())
+       if(time > mySetModified->GetMTime()){
+         if(aStudy)
            aStudy->Modified();
        }
-      }
-    };
+         }
+       };
 
     ProcessVoidEvent(new TEvent(this));
   }