Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/visu.git] / src / VISU_I / VISU_Result_i.hh
index 68625ca1927abbab43d1ec0b65f590a5f45f591c..b04fc0d5c85809b58eb3c68fabcb807562159daf 100644 (file)
@@ -17,7 +17,7 @@
 //  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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //  File   : VISU_Result_i.hh
 #define __VISU_RESULT_I_H__
 
 #include "VISUConfig.hh"
+#include "VISU_BoostSignals.h"
 #include "SALOME_GenericObj_i.hh"
 
-#include <gp_Dir.hxx>
+#include "VTKViewer.h"
 
+#include <gp_Dir.hxx>
 #include <vector>
 
 class VISU_Convertor;
 
-namespace VISU{
+namespace VISU
+{
+  //----------------------------------------------------------------------------
+  class MinMaxCunsomer: public virtual boost::signalslib::trackable
+  {
+  protected:
+    bool myMinMaxIsInitilized;
+    MinMaxCunsomer();
+
+  public:
+    virtual
+    bool
+    IsMinMaxInitilized();
+
+    virtual
+    void
+    UpdateMinMax();
+  };
+
+
+  //----------------------------------------------------------------------------
   class Result_i : public virtual POA_VISU::Result,
                    public virtual RemovableObject_i,
                   public virtual SALOME::GenericObj_i
@@ -50,7 +72,11 @@ namespace VISU{
 
     Result_i(SALOMEDS::Study_ptr theStudy,
             const ESourceId& theSourceId,
-            const ECreationId& theCreationId);
+            const ECreationId& theCreationId,
+            CORBA::Boolean theIsBuildImmediately = true,
+            CORBA::Boolean theIsBuildFields = true,
+            CORBA::Boolean theIsBuildMinMax = true,
+            CORBA::Boolean theIsBuildGroups = true);
 
     virtual ~Result_i();
     virtual void RemoveFromStudy();
@@ -58,6 +84,27 @@ namespace VISU{
     virtual VISU::VISUType GetType() { return VISU::TRESULT;}
     virtual CORBA::Boolean BuildAll();
 
+    virtual CORBA::Boolean Build(CORBA::Boolean theIsBuildAll,
+                                CORBA::Boolean theIsAtOnce);
+    virtual CORBA::Boolean IsDone();
+
+    virtual CORBA::Boolean IsEntitiesDone();
+
+    virtual void SetBuildFields(CORBA::Boolean theIsBuildFields, 
+                               CORBA::Boolean theIsCalculateMinMax);
+    virtual CORBA::Boolean IsFieldsDone();
+
+    virtual void SetBuildGroups(CORBA::Boolean theIsBuildGroups);
+    virtual CORBA::Boolean IsGroupsDone();
+
+    virtual CORBA::Boolean IsMinMaxDone();
+
+    virtual 
+    void
+    MinMaxConnect(MinMaxCunsomer* theMinMaxCunsomer);
+
+    typedef boost::signal0<void> TUpdateMinMaxSignal;
+
     typedef VISU_Convertor TInput;
 
   private:
@@ -65,12 +112,29 @@ namespace VISU{
     ECreationId myCreationId;
 
     TInput *myInput;
-    CORBA::Boolean myIsDone;
     std::string myName, myInitFileName;
     QFileInfo myFileInfo;
 
   protected:
-    virtual Storable* Build(SALOMEDS::SObject_ptr theSObject = SALOMEDS::SObject::_nil()) ;
+    virtual Storable* Build(SALOMEDS::SObject_ptr theSObject,
+                           CORBA::Boolean theIsAtOnce = true) ;
+    virtual Storable* BuildAll(SALOMEDS::SObject_ptr theSObject) ;
+
+    _PTR(Study) myStudy;
+    CORBA::Boolean myIsBuildImmediately;
+
+    CORBA::Boolean myIsEntitiesDone;
+    CORBA::Boolean myIsFieldsDone;
+    CORBA::Boolean myIsGroupsDone;
+    CORBA::Boolean myIsMinMaxDone;
+
+    CORBA::Boolean myIsBuildFields;
+    CORBA::Boolean myIsBuildGroups;
+
+    CORBA::Boolean myIsBuildMinMax;
+    TUpdateMinMaxSignal myUpdateMinMaxSignal;
+
+    CORBA::Boolean myIsAllDone;
 
   public:
     virtual int IsPossible();
@@ -113,23 +177,21 @@ namespace VISU{
     // Info on structured mesh contained in TInput
   public:
     typedef enum { AXIS_X = 0, AXIS_Y, AXIS_Z } TAxis;
-    const std::vector< float >* GetAxisInfo(const std::string& theMeshName,
-                                            TAxis              theAxis,
-                                            gp_Dir&            thePlaneNormal);
+    typedef std::vector< vtkFloatingPointType > TAxisInfo;
+    const TAxisInfo* GetAxisInfo(const std::string& theMeshName,
+                                TAxis              theAxis,
+                                gp_Dir&            thePlaneNormal);
     // Return i,j or k values and cutting plane normal for theAxis.
     // In the case of any problems, return NULL pointer
   private:
     struct TGridInfo {
-      std::vector< float > myComponets[ 3 ];
-      gp_Dir               myAxis     [ 3 ];
+      TAxisInfo myComponets[ 3 ];
+      gp_Dir    myAxis     [ 3 ];
     };
-    map< string, TGridInfo > myMeshName2GridInfoMap;
+    std::map< std::string, TGridInfo > myMeshName2GridInfoMap;
   };
 
   Result_var FindResult(SALOMEDS::SObject_ptr theSObject);
-  void RemoveFromStudy(SALOMEDS::SObject_ptr theSObject,
-                      bool theIsAttrOnly = true,
-                      bool theDestroySubObjects = false);
 }
 
 #endif