]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To intorduce ID's mapping
authorpkv <pkv@opencascade.com>
Fri, 26 Aug 2005 09:48:20 +0000 (09:48 +0000)
committerpkv <pkv@opencascade.com>
Fri, 26 Aug 2005 09:48:20 +0000 (09:48 +0000)
src/CONVERTOR/Makefile.in
src/CONVERTOR/VISUConvertor.cxx
src/CONVERTOR/VISU_Convertor.hxx
src/CONVERTOR/VISU_Convertor_impl.cxx
src/CONVERTOR/VISU_Convertor_impl.hxx

index fcbad7b7e36c35facb7946be3781c2c3148034da..1e204619f75bdcf82f0862d4fd0af66a441cdf46 100644 (file)
@@ -53,10 +53,10 @@ BIN_SRC =
 CPPFLAGS+= -ftemplate-depth-32 $(VTK_INCLUDES) $(HDF5_INCLUDES) $(QT_INCLUDES) \
        -I${KERNEL_ROOT_DIR}/include/salome \
        -I${MED_ROOT_DIR}/include/salome \
+       -I${GUI_ROOT_DIR}/include/salome \
        $(BOOST_CPPFLAGS)
 
-LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) -L${MED_ROOT_DIR}/lib/salome -lMEDWrapper
-
-LDFLAGSFORBIN=$(LDFLAGS) -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase
+LDFLAGS+= $(VTK_LIBS) $(QT_LIBS) -L${MED_ROOT_DIR}/lib/salome -L${GUI_ROOT_DIR}/lib/salome -lMEDWrapper -lVTKViewer
+LDFLAGSFORBIN=$(LDFLAGS) -lMEDWrapper_V2_2 -lMEDWrapper_V2_1 -lMEDWrapperBase -lVTKViewer
 
 @CONCLUDE@
index 5c95f60d296529ef181bc004b66f1084042835b7..716ab8e6a4f60de8df29919cdce337fdfb74a3ff 100644 (file)
@@ -34,6 +34,9 @@
 #include <qfileinfo.h>
 #include <qstringlist.h>
 #include <memory>      
+#include "VISU_Convertor_impl.hxx"
+
+#include <vtkUnstructuredGrid.h>
 
 using namespace std;
 
@@ -45,7 +48,10 @@ static int MYDEBUG = 0;
 
 #define _DEXCEPT_
 
-void parseFile(const char* theFileName) {
+typedef vtkUnstructuredGrid TOutput;
+
+void parseFile(const char* theFileName) 
+{
 #ifndef _DEXCEPT_
   try{
 #endif
@@ -77,7 +83,24 @@ void parseFile(const char* theFileName) {
          VISU::TValField::const_iterator aValFieldIter = aValField.begin();
          for(; aValFieldIter != aValField.end(); aValFieldIter++){
            int aTimeStamp = aValFieldIter->first;
-           aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+           //
+           vtkUnstructuredGrid *aOut;
+           //int aNbNodes, aNbCells, i;
+           //VISU::TGaussPointID aID;
+           //
+           aOut=aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+
+           //aNbNodes=aOut->GetNumberOfPoints();
+           //aNbCells=aOut->GetNumberOfCells();
+           //printf("aNbNodes =%d\n", aNbNodes);
+           //printf("aNbCells =%d\n", aNbCells);
+           //
+           //VISU::PGaussMesh pGaussMesh=aCon->GetGaussMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+           //
+           //for (i=0; i<aNbCells; ++i) {
+           //  aID=pGaussMesh->GetObjId(i);
+           // }
+           //
            //goto OK;
          }
        }
index 2426356d8340c1f346a4a7b68539de1b725f4cad..73bba7e26ee8baf4ea8812f237fc3f6ce993cba9 100644 (file)
@@ -169,7 +169,9 @@ namespace VISU
   typedef std::pair<TCellID,TLocalPntID> TGaussPointID;
 
   struct TGaussMesh: virtual TBaseStructure
-  {};
+  {
+    virtual TGaussPointID GetObjId(int theVtkI)=0;
+  };
 
 
   //---------------------------------------------------------------
@@ -345,6 +347,13 @@ public:
                       const std::string& theFieldName,
                       int theStampsNum) = 0;
    
+  virtual
+  VISU::PGaussMesh 
+  GetGaussMesh(const std::string& theMeshName, 
+              const VISU::TEntity& theEntity,
+              const std::string& theFieldName,
+              int theStampsNum) = 0; 
+
   virtual 
   float
   GetTimeStampSize(const std::string& theMeshName, 
index 4f96c751a5ec555f9778edc712daf26756af6ef0..f8b627fdaa30df23b7bb6decaac558c6f4489655 100644 (file)
@@ -48,6 +48,7 @@
 
 #include <valarray>    
 #include <memory>
+#include "VTKViewer_AppendFilter.h"
 
 using namespace std;
 using namespace VISU;
@@ -107,7 +108,7 @@ namespace VISU
   ::GetFilter() const
   {
     if(!myFilter.GetPointer()){
-      myFilter = vtkAppendFilter::New();
+      myFilter = VTKViewer_AppendFilter::New();
       myFilter->Delete();
     }
     return myFilter;
@@ -246,6 +247,21 @@ namespace VISU
   ::TGaussMeshImpl()
   {}
 
+  //---------------------------------------------------------------
+  TGaussPointID TGaussMeshImpl::GetObjId(int theVtkI)
+  {
+    TGaussPointID aRetVID;
+    int aID, anIndexDS;
+    vtkIdType aVID;//, aRetVID=-1;
+    //
+    const TVTKAppendFilter& anAppendFilter = GetFilter();
+    aID=anAppendFilter->GetElemObjId(theVtkI, anIndexDS);
+    //
+    TGaussSubMeshImpl& aSubMeshImpl=myGaussSubMeshArr[anIndexDS];
+    aVID=(vtkIdType)aID;
+    aRetVID=aSubMeshImpl.GetObjID(aVID);
+    return aRetVID;
+  }
 
   //---------------------------------------------------------------
   pair<int,int> 
@@ -1142,17 +1158,17 @@ namespace
     theGaussSubMesh->myIsVTKDone = true;
   }
   
-  
+
   //---------------------------------------------------------------
   void
-  GetGaussMesh(const PMeshImpl& theMesh,
+  BuildGaussMesh(const PMeshImpl& theMesh,
               const PMeshOnEntityImpl& theMeshOnEntity,
               const PGaussMeshImpl& theGaussMesh)
   {
     if(theGaussMesh->myIsVTKDone)
       return;
-    
-    INITMSG(MYDEBUG,"GetGaussMesh"<<endl);
+
+    INITMSG(MYDEBUG,"BuildGaussMesh"<<endl);
     const TVTKAppendFilter& anAppendFilter = theGaussMesh->GetFilter();
     const TGeom2GaussSubMesh& aGeom2GaussSubMesh = theGaussMesh->myGeom2GaussSubMesh;
     TGeom2GaussSubMesh::const_iterator anIter = aGeom2GaussSubMesh.begin();
@@ -1167,6 +1183,7 @@ namespace
                      aGaussSubMesh);
       
       const TVTKSource& aSource = aGaussSubMesh->GetSource();
+      
       anAppendFilter->AddInput(aSource.GetPointer());
     }
     anAppendFilter->Update(); // Fix on VTK
@@ -1177,8 +1194,8 @@ namespace
     
     theGaussMesh->myIsVTKDone = true;
   }
-  
-  
+
+
 }
 
 
@@ -1441,7 +1458,8 @@ VISU_Convertor_impl
       PGaussMeshImpl aGaussMesh = aValForTime->myGaussMesh;
       INITMSG(MYDEBUG,"aGaussMesh = "<<bool(aGaussMesh)<<endl);
       const TGeom2GaussSubMesh& aGeom2GaussSubMesh = aGaussMesh->myGeom2GaussSubMesh;
-      GetGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
+      BuildGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
+      //GetGaussMesh(aMesh,aVTKMeshOnEntity,aGaussMesh);
       
       const TVTKAppendFilter& anAppendFilter = aGaussMesh->GetFilter();
       aSource->ShallowCopy(anAppendFilter->GetOutput());
@@ -1478,6 +1496,24 @@ VISU_Convertor_impl
   return aSource.GetPointer();
 }
 
+//---------------------------------------------------------------
+VISU::PGaussMesh VISU_Convertor_impl::GetGaussMesh(const string& theMeshName, 
+                                                  const VISU::TEntity& theEntity,
+                                                  const string& theFieldName,
+                                                  int theStampsNum)
+{
+  GetTimeStampOnMesh(theMeshName, theEntity, theFieldName, theStampsNum);
+
+  TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
+                                               theEntity,
+                                               theFieldName,
+                                               theStampsNum);
+  PGaussPtsValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
+  PGaussMeshImpl aGaussMesh=aValForTime->myGaussMesh;
+  
+  return aGaussMesh;
+}
+
 
 //---------------------------------------------------------------
 VISU::PMeshImpl 
index 1bb1f44348feef67920e31791a38bf1f9fb8a6c7..df319f0f4a851e1e96ae8bb42eb4e6c67f7d70ef 100644 (file)
 
 #include <boost/tuple/tuple.hpp>
 
+
+
 class vtkPoints;
-class vtkAppendFilter;
+class VTKViewer_AppendFilter;
 class vtkUnstructuredGrid;
 
 #include "VISU_Convertor.hxx"
@@ -28,8 +30,7 @@ namespace VISU
 
   typedef vtkSmartPointer<vtkPoints> TVTKPoints;
   typedef vtkSmartPointer<vtkUnstructuredGrid> TVTKSource;
-  typedef vtkSmartPointer<vtkAppendFilter> TVTKAppendFilter;
-
+  typedef vtkSmartPointer<VTKViewer_AppendFilter> TVTKAppendFilter;
   typedef float TCoord;
 
   //---------------------------------------------------------------
@@ -210,6 +211,7 @@ namespace VISU
   struct TGaussMeshImpl: virtual TGaussMesh, virtual TAppendFilter
   {
     TGaussMeshImpl();
+    virtual TGaussPointID GetObjId(int theVtkI);
     TGaussSubMeshArr myGaussSubMeshArr;
     TGeom2GaussSubMesh myGeom2GaussSubMesh;
   };
@@ -410,6 +412,12 @@ public:
                     const VISU::TEntity& theEntity,
                     const std::string& theFieldName,
                     int theStampsNum);
+  virtual
+  VISU::PGaussMesh 
+  GetGaussMesh(const std::string& theMeshName, 
+              const VISU::TEntity& theEntity,
+              const std::string& theFieldName,
+              int theStampsNum);
 
   virtual
   TOutput*