]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To unify ID's mapping
authorapo <apo@opencascade.com>
Fri, 2 Sep 2005 05:20:27 +0000 (05:20 +0000)
committerapo <apo@opencascade.com>
Fri, 2 Sep 2005 05:20:27 +0000 (05:20 +0000)
32 files changed:
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
src/CONVERTOR/VISU_IDMapper.hxx [new file with mode: 0644]
src/CONVERTOR/VISU_MedConvertor.cxx
src/OBJECT/VISU_Actor.cxx
src/OBJECT/VISU_Actor.h
src/PIPELINE/VISUPipeLine.cxx
src/PIPELINE/VISU_PipeLine.cxx
src/PIPELINE/VISU_PipeLine.hxx
src/VISU_I/VISU_CutLines_i.cc
src/VISU_I/VISU_CutLines_i.hh
src/VISU_I/VISU_CutPlanes_i.cc
src/VISU_I/VISU_CutPlanes_i.hh
src/VISU_I/VISU_DeformedShape_i.cc
src/VISU_I/VISU_DeformedShape_i.hh
src/VISU_I/VISU_GaussPoints_i.cc
src/VISU_I/VISU_GaussPoints_i.hh
src/VISU_I/VISU_IsoSurfaces_i.cc
src/VISU_I/VISU_IsoSurfaces_i.hh
src/VISU_I/VISU_Mesh_i.cc
src/VISU_I/VISU_Plot3D_i.cc
src/VISU_I/VISU_Plot3D_i.hh
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_ScalarMap_i.cc
src/VISU_I/VISU_ScalarMap_i.hh
src/VISU_I/VISU_StreamLines_i.cc
src/VISU_I/VISU_StreamLines_i.hh
src/VISU_I/VISU_Vectors_i.cc
src/VISU_I/VISU_Vectors_i.hh

index 1e204619f75bdcf82f0862d4fd0af66a441cdf46..c58487cbe069ec1364e15d3ba7436118a8851444 100644 (file)
@@ -32,7 +32,9 @@ VPATH=.:@srcdir@
 
 @COMMENCE@
 
-EXPORT_HEADERS = VISU_Convertor.hxx  \
+EXPORT_HEADERS = \
+       VISU_IDMapper.hxx \
+       VISU_Convertor.hxx  \
        VISU_Convertor_impl.hxx  \
        VISU_ConvertorUtils.hxx  \
        VISU_ExtractUnstructuredGrid.hxx
index e17c9149f5d71f6c6e0482114fabd398547010d1..a45cbf73e04ab9e9c5b4c56ca23c5c03bbfe671b 100644 (file)
@@ -69,6 +69,16 @@ void parseFile(const char* theFileName)
       const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap;
       VISU::TMeshOnEntityMap::const_iterator aMeshOnEntityMapIter;
 
+      //Importing groups
+      const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
+      VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
+      for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
+       const string& aGroupName = aGroupMapIter->first;
+       aCon->GetMeshOnGroup(aMeshName,aGroupName);
+      }
+
+      continue;
+
       //Import fields
       aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
@@ -84,23 +94,23 @@ void parseFile(const char* theFileName)
          for(; aValFieldIter != aValField.end(); aValFieldIter++){
            int aTimeStamp = aValFieldIter->first;
 
-           VISU_Convertor::TOutput* aDataSet = 
+           VISU::PIDMapper anIDMapper = 
              aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+           VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
            
-           VISU::PIDMapper aPIDMapper =
-             aCon->GetTimeStampOnMeshIDMapper(aMeshName,anEntity,aFieldName,aTimeStamp);
            int aNbCells = aDataSet->GetNumberOfCells();
            for(int anCellId = 0; anCellId < aNbCells; anCellId++){
-             int anObjID = aPIDMapper->GetElemObjID(anCellId);
-             int aVTKID  = aPIDMapper->GetElemVTKID(anObjID);
+             int anObjID = anIDMapper->GetElemObjID(anCellId);
+             int aVTKID  = anIDMapper->GetElemVTKID(anObjID);
              cout<<anObjID<<"; "<<aVTKID<<endl;
            }
            
            //goto OK;
            if(anEntity != VISU::NODE_ENTITY)
              aCon->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
-           else
+           else{
              aCon->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+           }
          }
        }
       }
@@ -110,24 +120,19 @@ void parseFile(const char* theFileName)
       aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
        const VISU::TEntity& anEntity = aMeshOnEntityMapIter->first;
-       VISU_Convertor::TOutput* aDataSet = aCon->GetMeshOnEntity(aMeshName,anEntity);
-       //pkv f
+       VISU::PIDMapper anIDMapper = aCon->GetMeshOnEntity(aMeshName,anEntity);
+       VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
        {
          int aNbCells, anCellId, anObjID, aVTKID;
-         //
-         VISU::PIDMapper aPIDMapper=aCon->GetMeshOnEntityIDMapper(aMeshName,anEntity);
          aNbCells = aDataSet->GetNumberOfCells();
          for(anCellId = 0; anCellId < aNbCells; anCellId++){
-           anObjID = aPIDMapper->GetElemObjID(anCellId);
-           aVTKID  = aPIDMapper->GetElemVTKID(anObjID);
+           anObjID = anIDMapper->GetElemObjID(anCellId);
+           aVTKID  = anIDMapper->GetElemVTKID(anObjID);
            cout<<anObjID<<"; "<<aVTKID<<endl;
          }
        }
-       //pkv t
       }
 
-      //continue;
-
       //Import families
       aMeshOnEntityMapIter = aMeshOnEntityMap.begin();
       for(; aMeshOnEntityMapIter != aMeshOnEntityMap.end(); aMeshOnEntityMapIter++){
@@ -141,15 +146,6 @@ void parseFile(const char* theFileName)
          aCon->GetFamilyOnEntity(aMeshName,anEntity,aFamilyName);
        }
       }
-
-      //Importing groups
-      const VISU::TGroupMap& aGroupMap = aMesh->myGroupMap;
-      VISU::TGroupMap::const_iterator aGroupMapIter = aGroupMap.begin();
-      for(; aGroupMapIter != aGroupMap.end(); aGroupMapIter++){
-       const string& aGroupName = aGroupMapIter->first;
-       aCon->GetMeshOnGroup(aMeshName,aGroupName);
-      }
-
     }
   OK:
     MSG(MYDEBUG,"OK");
index 91002c1eb56079b11e97533ac8e77c70840d6494..0240fb08449135cf86b7677cfd53d8cf4a637105 100644 (file)
 #include <string>
 #include <stdexcept>
 
-#include "MED_SharedPtr.hxx"
 #include "MED_Vector.hxx"
-
-#include <vtkSystemIncludes.h>
-
-class vtkUnstructuredGrid;
-class vtkCell;
+#include "VISU_IDMapper.hxx"
 
 namespace VISU
 {
-  using MED::SharedPtr;
   using MED::TVector;
 
   //---------------------------------------------------------------
@@ -67,10 +61,7 @@ namespace VISU
 
   struct TProfile;
   typedef SharedPtr<TProfile> PProfile;
-  //pkv f
-  struct TIDMapper;
-  typedef SharedPtr<TIDMapper> PIDMapper;
-  // pkv t
+
   struct TMeshOnEntity;
   typedef SharedPtr<TMeshOnEntity> PMeshOnEntity;
 
@@ -94,18 +85,10 @@ namespace VISU
   typedef TVector<TName> TNames;
 
 
-  //---------------------------------------------------------------
-  struct TBaseStructure
-  {
-    virtual ~TBaseStructure()
-    {}
-  };
-
-
   //---------------------------------------------------------------
   struct TIntId: virtual TBaseStructure
   {
-    int myId;
+    vtkIdType myId;
 
     TIntId(): myId(0)
     {}
@@ -135,69 +118,10 @@ namespace VISU
   struct TSubProfile: virtual TBaseStructure
   {};
 
-  //pkv f
-  //---------------------------------------------------------------
-  // TIDMapper
-  //
-  struct TIDMapper: virtual TBaseStructure
-  {
-    virtual 
-    vtkIdType 
-    GetNodeObjID(vtkIdType theID) const = 0;
-
-    virtual 
-    vtkIdType 
-    GetNodeVTKID(vtkIdType theID) const = 0;
-
-    virtual
-    float* 
-    GetNodeCoord(vtkIdType theObjID) = 0;
-
-    virtual 
-    vtkIdType 
-    GetElemObjID(vtkIdType theID) const = 0;
 
-    virtual 
-    vtkIdType 
-    GetElemVTKID(vtkIdType theID) const = 0;
-
-    virtual
-    vtkCell* 
-    GetElemCell(vtkIdType theObjID) = 0;
-  };
-  //pkv t
-  
   //---------------------------------------------------------------
-  struct TProfile: virtual TBaseStructure, virtual TIDMapper
-  {
-    //pkv f
-    /* 
-    virtual 
-    vtkIdType 
-    GetNodeObjID(vtkIdType theID) const = 0;
-
-    virtual 
-    vtkIdType 
-    GetNodeVTKID(vtkIdType theID) const = 0;
-
-    virtual
-    float* 
-    GetNodeCoord(vtkIdType theObjID) = 0;
-
-    virtual 
-    vtkIdType 
-    GetElemObjID(vtkIdType theID) const = 0;
-
-    virtual 
-    vtkIdType 
-    GetElemVTKID(vtkIdType theID) const = 0;
-
-    virtual
-    vtkCell* 
-    GetElemCell(vtkIdType theObjID) = 0;
-    */
-    //pkv t
-  };
+  struct TProfile: virtual TIDMapper
+  {};
 
 
   //---------------------------------------------------------------
@@ -246,8 +170,7 @@ namespace VISU
   typedef std::map<TName,PFamily> TFamilyMap;
   typedef std::map<TName,PField> TFieldMap;
 
-  struct TMeshOnEntity: virtual TBaseStructure,
-                       virtual TIDMapper //pkv ft
+  struct TMeshOnEntity: virtual TIDMapper
   {
     TGaussMeshMap myGaussMeshMap;
     TProfileMap myProfileMap;
@@ -262,7 +185,7 @@ namespace VISU
 
   //---------------------------------------------------------------
   struct TFamily: virtual TIntId,
-                 virtual TIDMapper //pkv ft
+                 virtual TIDMapper
   {
     TEntity myEntity;
     TName myName;
@@ -272,8 +195,7 @@ namespace VISU
   //---------------------------------------------------------------
   typedef std::set<PFamily> TFamilySet;
 
-  struct TGroup: virtual TBaseStructure,
-                virtual TIDMapper //pkv ft
+  struct TGroup: virtual TIDMapper
   {
     TFamilySet myFamilySet;
   };
@@ -349,7 +271,7 @@ public:
   int
   IsDone() const { return myIsDone; }
 
-  typedef vtkUnstructuredGrid TOutput;
+  typedef VISU::TVTKOutput TOutput;
 
   virtual
   VISU_Convertor* 
@@ -364,27 +286,27 @@ public:
   GetSize() = 0;
 
   virtual
-  TOutput* 
+  VISU::PIDMapper 
   GetMeshOnEntity(const std::string& theMeshName, 
                  const VISU::TEntity& theEntity) = 0;
   
-  virtual 
-  TOutput* 
-  GetFamilyOnEntity(const std::string& theMeshName, 
-                   const VISU::TEntity& theEntity,
-                   const std::string& theFamilyName) = 0;
   virtual
   float
   GetMeshOnEntitySize(const std::string& theMeshName, 
                      const VISU::TEntity& theEntity) = 0;
   
   virtual 
+  VISU::PIDMapper 
+  GetFamilyOnEntity(const std::string& theMeshName, 
+                   const VISU::TEntity& theEntity,
+                   const std::string& theFamilyName) = 0;
+  virtual 
   float 
   GetFamilyOnEntitySize(const std::string& theMeshName, 
                        const VISU::TEntity& theEntity,
                        const std::string& theFamilyName) = 0;
   virtual
-  TOutput*
+  VISU::PIDMapper
   GetMeshOnGroup(const std::string& theMeshName, 
                 const std::string& theGroupName) = 0;
   
@@ -394,39 +316,12 @@ public:
                     const std::string& theGroupName) = 0;
   
   virtual
-  TOutput* 
+  VISU::PIDMapper 
   GetTimeStampOnMesh(const std::string& theMeshName, 
                     const VISU::TEntity& theEntity,
                     const std::string& theFieldName,
                     int theStampsNum) = 0;
 
-  virtual
-  //pkv f
-  //VISU::PProfile 
-  VISU::PIDMapper
-  //pkv t
-  GetTimeStampOnMeshIDMapper(const std::string& theMeshName, 
-                            const VISU::TEntity& theEntity,
-                            const std::string& theFieldName,
-                            int theStampsNum) = 0;
-  //pkv f
-  virtual 
-  VISU::PIDMapper
-  GetFamilyOnEntityIDMapper(const std::string& theMeshName, 
-                           const VISU::TEntity& theEntity,
-                           const std::string& theFamilyName) = 0;
-
-  virtual
-  VISU::PIDMapper
-  GetMeshOnEntityIDMapper(const std::string& theMeshName, 
-                         const VISU::TEntity& theEntity) = 0;
-  
-  virtual
-  VISU::PIDMapper
-  GetMeshOnGroupIDMapper(const std::string& theMeshName, 
-                        const std::string& theGroupName)=0;
-  //pkv t
-
   virtual
   TOutput* 
   GetTimeStampOnGaussPts(const std::string& theMeshName, 
index 2a689908f55e1d22c3776d8dcb297a3924291737..abd08dc06c6fbcb08a38b5f456831bb2fb4f0d44 100644 (file)
@@ -58,14 +58,13 @@ static int MYVTKDEBUG = 0;
 
 #ifdef _DEBUG_
 static int MYDEBUG = 1;
-static int MYDEBUGWITHFILES = 1;
+static int MYDEBUGWITHFILES = 0;
+//#define _DEXCEPT_
 #else
 static int MYDEBUG = 0;
 static int MYDEBUGWITHFILES = 0;
 #endif
 
-//#define _DEXCEPT_
-
 namespace VISU
 {
   //---------------------------------------------------------------
@@ -97,6 +96,13 @@ namespace VISU
     return mySource;
   }
 
+  TVTKOutput* 
+  TSource
+  ::GetVTKOutput()
+  {
+    return GetSource().GetPointer();
+  }
+
 
   //---------------------------------------------------------------
   TAppendFilter::TAppendFilter()
@@ -114,9 +120,9 @@ namespace VISU
     return myFilter;
   }
 
-  TDataSet* 
+  TVTKOutput* 
   TAppendFilter
-  ::GetDataSet() const
+  ::GetVTKOutput()
   {
     return GetFilter()->GetOutput();
   }
@@ -499,7 +505,7 @@ namespace VISU
   {
     vtkIdType aNbCells = 0, aCellsSize = 0;
     TFamilySet::const_iterator anIter = myFamilySet.begin();
-    for(; anIter == myFamilySet.end(); anIter++){
+    for(; anIter != myFamilySet.end(); anIter++){
       PFamilyImpl aFamily = *anIter; 
       aNbCells += aFamily->myNbCells;
       aCellsSize += aFamily->myCellsSize;
@@ -1201,7 +1207,7 @@ namespace
     anAppendFilter->SetPoints(GetPoints(theMesh));
 
     if(theProfile->myIsAll){
-      TDataSet* aDataSet = theMeshOnEntity->GetDataSet();
+      TVTKOutput* aDataSet = theMeshOnEntity->GetVTKOutput();
       anAppendFilter->AddInput(aDataSet);
       theProfile->myMeshOnEntity = theMeshOnEntity.get();
     }else{
@@ -1503,7 +1509,7 @@ VISU_Convertor_impl
 
 
 //---------------------------------------------------------------
-VISU_Convertor::TOutput* 
+VISU::PIDMapper 
 VISU_Convertor_impl
 ::GetMeshOnEntity(const string& theMeshName, 
                  const VISU::TEntity& theEntity)
@@ -1521,11 +1527,11 @@ VISU_Convertor_impl
   PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindMeshOnEntity);
   
   //Main part of code
-  const TVTKAppendFilter& anAppendFilter = aMeshOnEntity->GetFilter();
 #ifndef _DEXCEPT_
   try{
 #endif
     if(!aMeshOnEntity->myIsVTKDone){
+      const TVTKAppendFilter& anAppendFilter = aMeshOnEntity->GetFilter();
       if(MYVTKDEBUG) anAppendFilter->DebugOn();
 
       LoadMeshOnEntity(aMesh,aMeshOnEntity);
@@ -1562,11 +1568,11 @@ VISU_Convertor_impl
        aFileName += aMeshName + dtos("-%d-",int(theEntity)) + "-Conv.vtk";
        VISU::WriteToFile(anAppendFilter->GetOutput(),aFileName);
       }
-    }
 
-    if(MYVTKDEBUG){
-      GetMeshOnEntitySize(theMeshName,theEntity);
-      PrintMemorySize(anAppendFilter->GetOutput());
+      if(MYVTKDEBUG){
+       GetMeshOnEntitySize(theMeshName,theEntity);
+       PrintMemorySize(anAppendFilter->GetOutput());
+      }
     }
 
 #ifndef _DEXCEPT_
@@ -1575,12 +1581,12 @@ VISU_Convertor_impl
   }
 #endif
 
-  return anAppendFilter->GetOutput();
+  return aMeshOnEntity;
 }
 
 
 //---------------------------------------------------------------
-VISU_Convertor::TOutput* 
+VISU::PIDMapper 
 VISU_Convertor_impl
 ::GetFamilyOnEntity(const std::string& theMeshName, 
                    const VISU::TEntity& theEntity,
@@ -1601,11 +1607,11 @@ VISU_Convertor_impl
   PFamilyImpl aFamily = boost::get<2>(aFindFamilyOnEntity);
 
   //Main part of code
-  const TVTKSource& aSource = aFamily->GetSource();
 #ifndef _DEXCEPT_
   try{
 #endif
     if(!aFamily->myIsVTKDone){
+      const TVTKSource& aSource = aFamily->GetSource();
       if(MYVTKDEBUG) aSource->DebugOn();
 
       GetMeshOnEntity(theMeshName,theEntity);
@@ -1625,11 +1631,11 @@ VISU_Convertor_impl
        aFileName += aMeshName + dtos("-%d-",int(theEntity)) + aFamilyName + "-Conv.vtk";
        VISU::WriteToFile(aSource.GetPointer(),aFileName);
       }
-    }
 
-    if(MYVTKDEBUG){
-      GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
-      PrintMemorySize(aSource.GetPointer());
+      if(MYVTKDEBUG){
+       GetFamilyOnEntitySize(theMeshName,theEntity,theFamilyName);
+       PrintMemorySize(aSource.GetPointer());
+      }
     }
 
 #ifndef _DEXCEPT_
@@ -1638,12 +1644,12 @@ VISU_Convertor_impl
   }
 #endif
 
-  return aSource.GetPointer();
+  return aFamily;
 }
 
 
 //---------------------------------------------------------------
-VISU_Convertor::TOutput* 
+VISU::PIDMapper 
 VISU_Convertor_impl
 ::GetMeshOnGroup(const string& theMeshName, 
                 const string& theGroupName)
@@ -1660,12 +1666,13 @@ VISU_Convertor_impl
   PGroupImpl aGroup = boost::get<1>(aFindMeshOnGroup);
 
   //Main part of code
-  const TVTKAppendFilter& anAppendFilter = aGroup->GetFilter();
 #ifndef _DEXCEPT_
   try{
 #endif
     if(!aGroup->myIsVTKDone){
+      const TVTKAppendFilter& anAppendFilter = aGroup->GetFilter();
       const VISU::TFamilySet& aFamilySet = aGroup->myFamilySet;
+
       LoadMeshOnGroup(aMesh,aFamilySet);
       anAppendFilter->SetPoints(GetPoints(aMesh));
 
@@ -1679,7 +1686,9 @@ VISU_Convertor_impl
        PFamilyImpl aFamily = *anIter;
        const std::string& aFamilyName = aFamily->myName;
        const VISU::TEntity& anEntity = aFamily->myEntity;
-       TOutput* anOutput = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName);
+
+       VISU::PIDMapper anIDMapper = GetFamilyOnEntity(theMeshName,anEntity,aFamilyName);
+       VISU::TVTKOutput* anOutput = anIDMapper->GetVTKOutput();
        anAppendFilter->AddInput(anOutput);
 
        vtkIdType aNbCells = anOutput->GetNumberOfCells();
@@ -1706,12 +1715,12 @@ VISU_Convertor_impl
   }
 #endif
 
-  return anAppendFilter->GetOutput();
+  return aGroup;
 }
 
 
 //---------------------------------------------------------------
-VISU_Convertor::TOutput* 
+VISU::PIDMapper 
 VISU_Convertor_impl
 ::GetTimeStampOnMesh(const string& theMeshName, 
                     const VISU::TEntity& theEntity,
@@ -1738,12 +1747,12 @@ VISU_Convertor_impl
   PFieldImpl aField = boost::get<3>(aFindTimeStamp);
 
   //Main part of code
-  TSource& aMeshSource = aValForTime->myMeshSource;
-  const TVTKSource& aSource = aMeshSource.GetSource();
+  PProfileImpl aProfile = aValForTime->myProfile;
+  TSource& aProfileSource = aProfile->mySource;
 #ifndef _DEXCEPT_
   try{
 #endif
-    if(!aMeshSource.myIsVTKDone){
+    if(!aProfileSource.myIsVTKDone){
       LoadValForTimeOnMesh(aMesh,aMeshOnEntity,aField,aValForTime);
 
       try{
@@ -1756,16 +1765,15 @@ VISU_Convertor_impl
        MSG(MYDEBUG,"Unknown exception was occured!");
       }
 
-      GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity);
-      
-      PProfileImpl aProfile = aValForTime->myProfile;
+      GetMeshOnEntity(aVTKMeshOnEntity->myMeshName,aVTKMeshOnEntity->myEntity);     
       GetMeshOnProfile(aMesh,aVTKMeshOnEntity,aProfile);
       
       const TVTKAppendFilter& anAppendFilter = aProfile->GetFilter();
+      const TVTKSource& aSource = aProfile->mySource.GetSource();
       aSource->ShallowCopy(anAppendFilter->GetOutput());
       GetTimeStampOnProfile(aSource,aField,aValForTime);
 
-      aMeshSource.myIsVTKDone = true;
+      aProfileSource.myIsVTKDone = true;
 
       if(MYDEBUGWITHFILES){
        string aMeshName = QString(theMeshName.c_str()).simplifyWhiteSpace().latin1();
@@ -1793,70 +1801,10 @@ VISU_Convertor_impl
   }
 #endif
 
-  return aSource.GetPointer();
+  return aValForTime->myProfile;
 }
 
 
-//---------------------------------------------------------------
-//pkv f
-//VISU::PProfile 
-VISU::PIDMapper
-//pkv t
-VISU_Convertor_impl::GetTimeStampOnMeshIDMapper(const std::string& theMeshName, 
-                                               const VISU::TEntity& theEntity,
-                                               const std::string& theFieldName,
-                                               int theStampsNum)
-{
-  GetTimeStampOnMesh(theMeshName, theEntity, theFieldName, theStampsNum);
-  TFindTimeStamp aFindTimeStamp = FindTimeStamp(theMeshName,
-                                               theEntity,
-                                               theFieldName,
-                                               theStampsNum);
-  PValForTimeImpl aValForTime = boost::get<4>(aFindTimeStamp);
-  PProfileImpl aProfile = aValForTime->myProfile;
-  return aProfile;
-}
-//modified by NIZNHY-PKV Thu Sep  1 15:38:49 2005f
-//---------------------------------------------------------------
-VISU::PIDMapper 
-VISU_Convertor_impl::
-GetMeshOnGroupIDMapper(const std::string& theMeshName, 
-                      const std::string& theGroupName)
-{
-  TFindMeshOnGroup aFindMeshOnGroup = FindMeshOnGroup(theMeshName,theGroupName);
-  PMeshImpl aMesh = boost::get<0>(aFindMeshOnGroup);
-  PGroupImpl aGroup = boost::get<1>(aFindMeshOnGroup);
-  return aGroup;
-}
-//---------------------------------------------------------------
-VISU::PIDMapper  
-VISU_Convertor_impl::
-GetMeshOnEntityIDMapper(const string& theMeshName, 
-                       const VISU::TEntity& theEntity)
-{
-  TFindMeshOnEntity aFindMeshOnEntity = 
-    FindMeshOnEntity(theMeshName,theEntity);
-  
-  PMeshImpl aMesh = boost::get<0>(aFindMeshOnEntity);;
-  PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindMeshOnEntity);
-  return aMeshOnEntity;
-}
-//---------------------------------------------------------------
-VISU::PIDMapper
-VISU_Convertor_impl::
-GetFamilyOnEntityIDMapper(const std::string& theMeshName, 
-                         const VISU::TEntity& theEntity,
-                         const std::string& theFamilyName)
-{
-  TFindFamilyOnEntity aFindFamilyOnEntity = 
-    FindFamilyOnEntity(theMeshName,theEntity,theFamilyName);
-
-  PMeshImpl aMesh = boost::get<0>(aFindFamilyOnEntity);;
-  PMeshOnEntityImpl aMeshOnEntity = boost::get<1>(aFindFamilyOnEntity);
-  PFamilyImpl aFamily = boost::get<2>(aFindFamilyOnEntity);
-  return aFamily;
-}
-//modified by NIZNHY-PKV Thu Sep  1 15:38:54 2005t
 //---------------------------------------------------------------
 VISU_Convertor::TOutput* 
 VISU_Convertor_impl
index 237b18dfa98c00e59bbf9b5f81794b8aea8f871d..44ff27695cf5901b3259408da0a53eff65d54307 100644 (file)
@@ -61,11 +61,14 @@ namespace VISU
 
     const TVTKSource& 
     GetSource() const;
+
+    TVTKOutput* 
+    GetVTKOutput();
   };
 
 
   //---------------------------------------------------------------
-  struct TAppendFilter: public virtual TIsVTKDone
+  class TAppendFilter: public virtual TIsVTKDone
   {
     mutable TVTKAppendFilter myFilter;
   public:
@@ -74,8 +77,9 @@ namespace VISU
     const TVTKAppendFilter& 
     GetFilter() const;
 
-    TDataSet* 
-    GetDataSet() const;
+    virtual
+    TVTKOutput* 
+    GetVTKOutput();
   };
 
 
@@ -225,11 +229,19 @@ namespace VISU
     vtkCell* 
     GetElemCell(vtkIdType theObjID);
     
+    virtual
+    TVTKOutput* 
+    GetVTKOutput()
+    {
+      return mySource.GetVTKOutput();
+    }
+
     TID2ID myElemObj2VTKID;
     TSubProfileArr mySubProfileArr;
     PNamedPointCoords myNamedPointCoords;
     TMeshOnEntityImpl* myMeshOnEntity;
 
+    TSource mySource;
     TGeom2SubProfile myGeom2SubProfile;
   };
   typedef SharedPtr<TProfileImpl> PProfileImpl;
@@ -324,6 +336,13 @@ namespace VISU
     vtkIdType 
     GetElemObjID(vtkIdType theID) const;
 
+    virtual
+    TVTKOutput* 
+    GetVTKOutput()
+    {
+      return TAppendFilter::GetVTKOutput();
+    }
+
     TID2ID myElemObj2VTKID;
     TSubMeshArr mySubMeshArr;
     PNamedPointCoords myNamedPointCoords;
@@ -361,6 +380,13 @@ namespace VISU
     vtkIdType 
     GetElemObjID(vtkIdType theID) const;
 
+    virtual
+    TVTKOutput* 
+    GetVTKOutput()
+    {
+      return TSource::GetVTKOutput();
+    }
+
     PNamedPointCoords myNamedPointCoords;
     TID2ID myElemObj2VTKID;
     TSubMeshID myMeshID;
@@ -403,6 +429,13 @@ namespace VISU
     float* 
     GetNodeCoord(vtkIdType theObjID);
     
+    virtual
+    TVTKOutput* 
+    GetVTKOutput()
+    {
+      return TAppendFilter::GetVTKOutput();
+    }
+
     TID2ID myElemObj2VTKID;
     TFamilyArr myFamilyArr;
     PNamedPointCoords myNamedPointCoords;
@@ -491,26 +524,61 @@ namespace VISU
 class VISU_Convertor_impl: public VISU_Convertor
 {
 public:
+  VISU_Convertor_impl();
+
+  virtual
+  ~VISU_Convertor_impl();
+
+  virtual
+  VISU_Convertor* 
+  Build() 
+  { 
+    return this;
+  }
+
   virtual 
   float
   GetSize();
 
+  virtual 
+  VISU::PIDMapper 
+  GetMeshOnEntity(const std::string& theMeshName, 
+                 const VISU::TEntity& theEntity);
+
   virtual 
   float 
   GetMeshOnEntitySize(const std::string& theMeshName, 
                       const VISU::TEntity& theEntity);
 
+  virtual 
+  VISU::PIDMapper 
+  GetFamilyOnEntity(const std::string& theMeshName, 
+                   const VISU::TEntity& theEntity,
+                   const std::string& theFamilyName);
+
   virtual 
   float 
   GetFamilyOnEntitySize(const std::string& theMeshName, 
                        const VISU::TEntity& theEntity,
                        const std::string& theFamilyName);
 
+  virtual 
+  VISU::PIDMapper 
+  GetMeshOnGroup(const std::string& theMeshName, 
+                const std::string& theGroupName);
+  
   virtual 
   float 
   GetMeshOnGroupSize(const std::string& theMeshName, 
                     const std::string& theGroupName);
 
+  virtual
+  VISU::PIDMapper 
+  GetTimeStampOnMesh(const std::string& theMeshName, 
+                    const VISU::TEntity& theEntity,
+                    const std::string& theFieldName,
+                    int theStampsNum);
+
   virtual 
   float 
   GetTimeStampSize(const std::string& theMeshName, 
@@ -518,6 +586,20 @@ public:
                   const std::string& theFieldName,
                   int theStampsNum);
 
+  virtual
+  TOutput* 
+  GetTimeStampOnGaussPts(const std::string& theMeshName, 
+                        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 
   float 
   GetFieldOnMeshSize(const std::string& theMeshName, 
@@ -537,76 +619,6 @@ public:
               const std::string& theFieldName,
               int theStampsNum);
 
-public:
-  VISU_Convertor_impl();
-
-  virtual
-  ~VISU_Convertor_impl();
-
-  virtual
-  VISU_Convertor* Build()  { return this;};
-
-  virtual 
-  TOutput* 
-  GetMeshOnEntity(const std::string& theMeshName, 
-                 const VISU::TEntity& theEntity);
-
-  virtual 
-  TOutput* 
-  GetFamilyOnEntity(const std::string& theMeshName, 
-                   const VISU::TEntity& theEntity,
-                   const std::string& theFamilyName);
-
-  virtual 
-  TOutput* 
-  GetMeshOnGroup(const std::string& theMeshName, 
-                const std::string& theGroupName);
-  
-  virtual
-  TOutput* 
-  GetTimeStampOnMesh(const std::string& theMeshName, 
-                    const VISU::TEntity& theEntity,
-                    const std::string& theFieldName,
-                    int theStampsNum);
-  virtual
-  //pkv f
-  //VISU::PProfile 
-  VISU::PIDMapper
-  //pkv t
-  GetTimeStampOnMeshIDMapper(const std::string& theMeshName, 
-                            const VISU::TEntity& theEntity,
-                            const std::string& theFieldName,
-                            int theStampsNum);
-  //pkv f
-  virtual 
-  VISU::PIDMapper
-  GetFamilyOnEntityIDMapper(const std::string& theMeshName, 
-                           const VISU::TEntity& theEntity,
-                           const std::string& theFamilyName);
-  virtual
-  VISU::PIDMapper
-  GetMeshOnEntityIDMapper(const std::string& theMeshName, 
-                         const VISU::TEntity& theEntity);
-  virtual
-  VISU::PIDMapper
-  GetMeshOnGroupIDMapper(const std::string& theMeshName, 
-                        const std::string& theGroupName);
-  //pkv t
-
-  virtual
-  TOutput* 
-  GetTimeStampOnGaussPts(const std::string& theMeshName, 
-                        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);
-
 protected:
   VISU::PMeshImpl 
   FindMesh(const std::string& theMeshName);
diff --git a/src/CONVERTOR/VISU_IDMapper.hxx b/src/CONVERTOR/VISU_IDMapper.hxx
new file mode 100644 (file)
index 0000000..6bc0e1b
--- /dev/null
@@ -0,0 +1,86 @@
+//  VISU CONVERTOR :
+//
+//  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   : VISU_Convertor.hxx
+//  Author : Alexey PETROV
+//  Module : VISU
+
+#ifndef VISU_IDMapper_HeaderFile
+#define VISU_IDMapper_HeaderFile
+
+#include "MED_SharedPtr.hxx"
+
+#include <vtkSystemIncludes.h>
+
+class vtkUnstructuredGrid;
+class vtkCell;
+
+namespace VISU
+{
+  using MED::SharedPtr;
+
+  //---------------------------------------------------------------
+  struct TBaseStructure
+  {
+    virtual ~TBaseStructure()
+    {}
+  };
+  typedef SharedPtr<TBaseStructure> PBaseStructure;
+
+  //---------------------------------------------------------------
+  typedef vtkUnstructuredGrid TVTKOutput;
+
+  struct TIDMapper: virtual TBaseStructure
+  {
+    virtual 
+    vtkIdType 
+    GetNodeObjID(vtkIdType theID) const = 0;
+
+    virtual 
+    vtkIdType 
+    GetNodeVTKID(vtkIdType theID) const = 0;
+
+    virtual
+    float* 
+    GetNodeCoord(vtkIdType theObjID) = 0;
+
+    virtual 
+    vtkIdType 
+    GetElemObjID(vtkIdType theID) const = 0;
+
+    virtual 
+    vtkIdType 
+    GetElemVTKID(vtkIdType theID) const = 0;
+
+    virtual
+    vtkCell* 
+    GetElemCell(vtkIdType theObjID) = 0;
+
+    virtual
+    TVTKOutput*
+    GetVTKOutput() = 0;
+  };
+  typedef SharedPtr<TIDMapper> PIDMapper;
+  
+}
+
+#endif
index abed38835f1da3fa4a9821fc38d11dff24c6b13b..6d53a6d385d32d0d8f7e42ff67e82c84c155ba76 100644 (file)
@@ -36,9 +36,6 @@
 
 #include <vtkCellType.h>
 
-#define _EDF_NODE_IDS_
-//#define _DEXCEPT_
-
 using namespace std;
 using namespace VISU;
 
@@ -51,6 +48,7 @@ static int MYDEBUG = 0;
 static int MYVALUEDEBUG = 0;
 static int MY_FAMILY_DEBUG = 0;
 static int MY_GROUP_DEBUG = 0;
+//#define _DEXCEPT_
 #else
 static int MYDEBUG = 0;
 static int MYVALUEDEBUG = 0;
@@ -59,6 +57,7 @@ static int MY_GROUP_DEBUG = 0;
 #endif
 
 #define _LOAD_FAMILIES_
+#define _EDF_NODE_IDS_
 
 namespace
 {
index 338da63168975a0dc9b8aeaf7854d9067e8bc07f..2814e57cd0fdc6c282eb167824a3c0288a3ac88f 100644 (file)
@@ -64,36 +64,32 @@ static int MYDEBUG = 0;
 
 vtkStandardNewMacro(VISU_Actor);
 
-VISU_Actor::VISU_Actor(){
+VISU_Actor::VISU_Actor():
+  myIsVTKMapping(false),
+  myParent(this),
+  myPrs3d(NULL),
+  myPipeLine(NULL),
+  myMapper(vtkDataSetMapper::New()),
+  myIsShrunk(false),
+  myIsShrinkable(false),
+  myShrinkFilter(VTKViewer_ShrinkFilter::New())
+{
   SetDebug(MYVTKDEBUG);
-  myParent = this;
-  myPipeLine = NULL;
-  myPrs3d = NULL;
 
   myStoreMapping = true;
 
-  myIsShrunk = false;
-  myIsShrinkable = false;
-  myShrinkFilter = VTKViewer_ShrinkFilter::New();
   myShrinkFilter->SetStoreMapping(true);
-  SetShrinkFactor();
-  
-  myMapper = vtkDataSetMapper::New();
-
-  myIO = NULL;
-  myName = "";
+  SetShrinkFactor();  
 }
 
 VISU_Actor::~VISU_Actor(){
   SALOME_Actor::SetProperty(NULL);
 
-  myMapper->RemoveAllInputs();
   myMapper->Delete();
 
   if(myPipeLine) 
     myPipeLine->UnRegister(this);
 
-  myShrinkFilter->UnRegisterAllOutputs();
   myShrinkFilter->Delete();
 }
 
@@ -212,11 +208,22 @@ void VISU_Actor::ShallowCopy(vtkProp *prop){
   SALOME_Actor::ShallowCopy(prop);
 }
 
+//----------------------------------------------------------------------------
+void 
+VISU_Actor
+::SetVTKMapping(bool theIsVTKMapping)
+{
+  myIsVTKMapping = theIsVTKMapping;
+}
+
 //----------------------------------------------------------------------------
 vtkDataSet* 
 VISU_Actor
 ::GetInput()
 {
+  if(myIsVTKMapping)
+    return Superclass::GetInput();
+
   return myPipeLine->GetInput();
 }
 
@@ -225,6 +232,9 @@ vtkIdType
 VISU_Actor
 ::GetNodeObjId(vtkIdType theID)
 {
+  if(myIsVTKMapping)
+    return Superclass::GetNodeObjId(theID);
+
   vtkIdType anID = myGeomFilter->GetNodeObjId(theID);
 
   if(myIsShrunk)
@@ -237,6 +247,9 @@ vtkIdType
 VISU_Actor
 ::GetNodeVTKID(vtkIdType theID)
 {
+  if(myIsVTKMapping)
+    return theID;
+
   return myPipeLine->GetNodeVTKID(theID);
 }
 
@@ -244,6 +257,9 @@ float*
 VISU_Actor
 ::GetNodeCoord(int theObjID)
 {
+  if(myIsVTKMapping)
+    return Superclass::GetNodeCoord(theObjID);
+
   return myPipeLine->GetNodeCoord(theObjID);
 }
 
@@ -253,6 +269,9 @@ vtkIdType
 VISU_Actor
 ::GetElemObjId(vtkIdType theID)
 {
+  if(myIsVTKMapping)
+    return Superclass::GetElemObjId(theID);
+
   vtkIdType anID = myGeomFilter->GetElemObjId(theID);
 
   if(myIsShrunk)
@@ -265,6 +284,9 @@ vtkIdType
 VISU_Actor
 ::GetElemVTKID(vtkIdType theID)
 {
+  if(myIsVTKMapping)
+    return theID;
+
   return myPipeLine->GetElemVTKID(theID);
 }
 
@@ -272,5 +294,8 @@ vtkCell*
 VISU_Actor
 ::GetElemCell(vtkIdType theObjID)
 {
+  if(myIsVTKMapping)
+    return Superclass::GetElemCell(theObjID);
+
   return myPipeLine->GetElemCell(theObjID);
 }
index d6523570a89434a62173eb00c3edb5dbeb6d1c46..478a6c0713a729f4e5156973ce24e613e2d616da 100644 (file)
@@ -50,7 +50,8 @@ namespace VISU {
 #define VTKOCC_EXPORT VTK_EXPORT
 #endif
 
-class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
+class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor 
+{
  public:
   vtkTypeMacro(VISU_Actor,SALOME_Actor);
   void ShallowCopy(vtkProp *prop);
@@ -88,6 +89,17 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
   virtual void SetLineWidth(float theLineWidth);
   virtual float GetLineWidth();
  
+  virtual
+  void 
+  SetVTKMapping(bool theIsVTKMapping); 
+
+  virtual
+  bool 
+  IsVTKMapping() const
+  {
+    return myIsVTKMapping;
+  }
+
   virtual
   vtkDataSet* 
   GetInput(); 
@@ -119,6 +131,7 @@ class VTKOCC_EXPORT VISU_Actor : public SALOME_Actor {
  protected:
   VISU_Actor();
  
+  bool myIsVTKMapping;
   VISU_Actor* myParent;
   VISU::Prs3d_i* myPrs3d;
   VISU_PipeLine* myPipeLine;
index cf8c455da449752d7d28658f3017a0b8133f562e..5424a08b491908fdbd92f4955f530e6b2de1c58f 100644 (file)
@@ -36,7 +36,7 @@
 #include "VISU_GaussPointsPL.hxx"
 #include "VISU_Plot3DPL.hxx"
 
-typedef VISU_GaussPointsPL TPresent;
+typedef VISU_ScalarMapPL TPresent;
 
 #include <vtkUnstructuredGrid.h>
 #include <vtkDataSetMapper.h>
@@ -75,7 +75,10 @@ int main(int argc, char** argv){
       if(isOnlyMesh){
        const VISU::TEntity& anEntity = VISU::CELL_ENTITY;
        aMeshOnEntityMapIter = aMeshOnEntityMap.find(anEntity);
-       vtkUnstructuredGrid* aDataSet = aConvertor->GetMeshOnEntity(aMeshName,anEntity);
+
+       VISU::PIDMapper anIDMapper = 
+         aConvertor->GetMeshOnEntity(aMeshName,anEntity);
+       VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
 
        VISU_MeshPL* aPresent = VISU_MeshPL::New();
        aPresent->SetInput(aDataSet);
@@ -110,12 +113,15 @@ int main(int argc, char** argv){
          VISU::TValField::const_iterator aValFieldIter = aValField.begin();
          if(aValFieldIter == aValField.end()) return 0;
          int aTimeStamp = aValFieldIter->first;
-         vtkUnstructuredGrid* aDataSet;
+
+         VISU::PIDMapper anIDMapper;
+         VISU::TVTKOutput* aDataSet;
          if(anEntity != VISU::NODE_ENTITY)
            aDataSet = aConvertor->GetTimeStampOnGaussPts(aMeshName,anEntity,aFieldName,aTimeStamp);
          else{
-           continue;
-           aDataSet = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+           //continue;
+           anIDMapper = aConvertor->GetTimeStampOnMesh(aMeshName,anEntity,aFieldName,aTimeStamp);
+           aDataSet = anIDMapper->GetVTKOutput();
          }
 
          TPresent* aPresent = TPresent::New();
index c00f14c74399e9067c682d73508e95a5ae974b57..e2367b04775d4b6ad5737e94968f5d0db62c9ee7 100644 (file)
@@ -313,6 +313,7 @@ bool VISU_PipeLine::IsPlanarInput() const
   return false;
 }
 
+//=======================================================================
 vtkIdType 
 VISU_PipeLine
 ::GetNodeObjID(vtkIdType theID)
@@ -334,46 +335,42 @@ VISU_PipeLine
 {
   return myIDMapper->GetNodeCoord(theObjID);
 }
-//modified by NIZNHY-PKV Thu Sep  1 18:15:13 2005f
-//=======================================================================
-//function :  VISU_PipeLine::GetElemObjID
-//purpose  :
+
 //=======================================================================
-vtkIdType VISU_PipeLine::GetElemObjID(vtkIdType theID)
+vtkIdType 
+VISU_PipeLine
+::GetElemObjID(vtkIdType theID)
 {
   vtkIdType anID=myExtractGeometry->GetElemObjId(theID);
   return myIDMapper->GetElemObjID(anID);
 }
-//=======================================================================
-//function :  VISU_PipeLine::GetElemVTKID
-//purpose  :
-//=======================================================================
-vtkIdType VISU_PipeLine::GetElemVTKID(vtkIdType theID)
+
+vtkIdType
+VISU_PipeLine
+::GetElemVTKID(vtkIdType theID)
 {
   return myIDMapper->GetElemVTKID(theID);
 }
-//=======================================================================
-//function :  VISU_PipeLine::GetElemCell
-//purpose  :
-//=======================================================================
-vtkCell* VISU_PipeLine::GetElemCell(vtkIdType  theObjID)
+
+vtkCell* 
+VISU_PipeLine
+::GetElemCell(vtkIdType  theObjID)
 {
   return myIDMapper->GetElemCell(theObjID);
 }
+
 //=======================================================================
-//function :  VISU_PipeLine::SetIdMapper
-//purpose  :
-//=======================================================================
-void VISU_PipeLine::SetIDMapper(const VISU::PIDMapper& theIDMapper)
+void
+VISU_PipeLine
+::SetIDMapper(const VISU::PIDMapper& theIDMapper)
 {
-  myIDMapper=theIDMapper;
+  myIDMapper = theIDMapper;
+  SetInput(myIDMapper->GetVTKOutput());
 }
-//=======================================================================
-//function :  VISU_PipeLine::GetIDMapper
-//purpose  :
-//=======================================================================
-const VISU::PIDMapper&  VISU_PipeLine::GetIDMapper()const
+
+const VISU::PIDMapper&  
+VISU_PipeLine
+::GetIDMapper() const
 {
   return myIDMapper;
 }
-//modified by NIZNHY-PKV Thu Sep  1 16:16:15 2005t
index bf43f17a821d2d943dd97507a73f4394b6e590fa..fd4df1bc1f07b7d6b5f1586b2c12c0ad705892e5 100644 (file)
 #ifndef VISU_PipeLine_HeaderFile
 #define VISU_PipeLine_HeaderFile
 
+#include <vector>
 #include <vtkObject.h>
 #include <vtkSmartPointer.h>
 
-#include <vector>
-//pkv f
-#include <VISU_Convertor.hxx>
-//pkv t
+#include "VISU_IDMapper.hxx"
 
 class vtkCell;
+
 template <class T>
 class TVTKSmartPtr: public vtkSmartPointer<T>
 {
 public:
-  TVTKSmartPtr() {}
-  TVTKSmartPtr(T* r, bool theIsOwner = false): vtkSmartPointer<T>(r) {
+  TVTKSmartPtr()
+  {}
+
+  TVTKSmartPtr(T* r, bool theIsOwner = false): vtkSmartPointer<T>(r) 
+  {
     if(r && theIsOwner)
       r->Delete();
   }
-  TVTKSmartPtr& operator()(T* r, bool theIsOwner = false){
+
+  TVTKSmartPtr& operator()(T* r, bool theIsOwner = false)
+  {
     vtkSmartPointer<T>::operator=(r);
     if(r && theIsOwner)
       r->Delete();
     return *this;
   }
-  TVTKSmartPtr& operator=(T* r){
+
+  TVTKSmartPtr& operator=(T* r)
+  {
     vtkSmartPointer<T>::operator=(r);
     return *this;
   }
-  operator T* () const {
+
+  operator T* () const 
+  {
     return vtkSmartPointer<T>::GetPointer();
   }
 };
@@ -69,7 +77,7 @@ class vtkPlane;
 
 class SALOME_ExtractGeometry;
 
-typedef vtkUnstructuredGrid TInput;
+typedef VISU::TVTKOutput TInput;
 
 class VISU_PipeLine : public vtkObject{
 public:
@@ -130,9 +138,11 @@ public:
   vtkCell*
   GetElemCell(vtkIdType theObjID);
 
-  void SetIDMapper(const VISU::PIDMapper& theIDMapper);
+  void 
+  SetIDMapper(const VISU::PIDMapper& theIDMapper);
 
-  const VISU::PIDMapper&  GetIDMapper()const;
+  const VISU::PIDMapper&  
+  GetIDMapper()const;
 
 protected:
   VISU_PipeLine();
@@ -143,15 +153,12 @@ protected:
 
   bool myIsShrinkable;
 
-  TInput  *myInput;
+  TInput *myInput;
+  VISU::PIDMapper myIDMapper;
   vtkDataSetMapper *myMapper;
 
   // Clipping planes
   TVTKSmartPtr<SALOME_ExtractGeometry> myExtractGeometry;
-  //
-  //pkv f
-  VISU::PIDMapper myIDMapper;
-  //pkv t
 };
 
 #endif
index d542b221b8865cf642f28e0852d631a71c1818d6..02d71bc7d51bbbdaa2c59483387f9168b43c7f4d 100644 (file)
@@ -248,6 +248,17 @@ void VISU::CutLines_i::DoHook(){
   ScalarMap_i::DoHook();
 }
 
+VISU_Actor* 
+VISU::CutLines_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+  if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+    anActor->SetVTKMapping(true);
+    return anActor;
+  }
+  return NULL;
+}
+
 void VISU::CutLines_i::BuildTableOfReal(SALOMEDS::SObject_ptr theSObject){
   try{
     if(MYDEBUG) MESSAGE("CutPlanes_i::BuildTableOfReal");
index 81ba7ffa206c537640a23cea656f0e7d5abe3be3..cbc68366e1c64d375fe1d74944d66ec5f8dfcbdc 100644 (file)
@@ -102,6 +102,10 @@ namespace VISU{
 
     virtual Storable* Restore(const Storable::TRestoringMap& theMap);
 
+    virtual 
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
     void BuildTableOfReal(SALOMEDS::SObject_ptr theSObject);
 
     static const std::string myComment;
index b0dca7d0340edd9ddbc094c9e280f965eb439483..120cae90bf7e6a86b60f76ecacd430ebd1ca8c8f 100644 (file)
@@ -185,3 +185,15 @@ void VISU::CutPlanes_i::DoHook(){
 
   ScalarMap_i::DoHook();
 }
+
+VISU_Actor* 
+VISU::CutPlanes_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+  if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+    anActor->SetVTKMapping(true);
+    return anActor;
+  }
+  return NULL;
+}
+
index 28abd7d30165de36dc2fed1f4b3db60fb1489666..b68062433558f41aacf53d253b4df4b1686d3116 100644 (file)
@@ -87,6 +87,10 @@ namespace VISU{
 
     virtual Storable* Restore(const Storable::TRestoringMap& theMap);
 
+    virtual 
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
     static const std::string myComment;
     virtual const char* GetComment() const;
     virtual QString GenerateName();
index 1198ad2d3d31b797a08d9d0136589fdc4eedb4db..a1d7b1084c66cf33b2f93e42f2d9764f9f08db95 100644 (file)
@@ -157,11 +157,14 @@ void VISU::DeformedShape_i::SetMapScale(double theMapScale){
 }
 
 
-VISU_Actor* VISU::DeformedShape_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
+VISU_Actor* 
+VISU::DeformedShape_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
 {
   VISU_Actor* anActor = VISU::ScalarMap_i::CreateActor(theIO);
   anActor->SetRepresentation(1);
   anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
+  anActor->SetVTKMapping(false);
   return anActor;
 }
 
index a930c37df2daed393f0682929b629a7623eb1688..396060115188d6ea97b249bc28799a212418eed9 100644 (file)
@@ -85,7 +85,9 @@ namespace VISU{
 
     virtual void SetMapScale(double theMapScale = 1.0);
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+    virtual 
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
     virtual void UpdateActor(VISU_Actor* theActor) ;
   };
index f2eae4f6d160ade8e4adec30fb5d7b26d144d3bc..e915e9d160a251db1ef10c06ea1b37c4f4aa15e9 100644 (file)
@@ -44,7 +44,7 @@ VISU::GaussPoints_i
             const char* theFieldName, int theIteration, int isMemoryCheck)
 {
   try{
-    if(theEntity != VISU::NODE_ENTITY)
+    if(theEntity != VISU::NODE)
       return VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,isMemoryCheck);
     else
       return false;
@@ -166,6 +166,8 @@ VISU::GaussPoints_i
   VISU_GaussPtsAct* anActor = VISU_GaussPtsAct::New();
   try{
     VISU::Prs3d_i::CreateActor(anActor,theIO);
+    anActor->SetRepresentation(VTK_POINTS);
+    anActor->SetVTKMapping(true);
     UpdateActor(anActor);
   }catch(...){
     anActor->Delete();
index 8d183989d7897764921ddabfbbef723add3ad148..1c80fb61cd2a40eb427e62bf4c7bbf441853bbc6 100644 (file)
@@ -73,10 +73,13 @@ namespace VISU
 
     virtual Storable* Restore(const Storable::TRestoringMap& theMap);
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+    virtual 
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
     virtual void UpdateActor(VISU_Actor* theActor) ;
   };
 }
 
 #endif
+
index 79b2a877fd328bda3c1605e5d1aa3fcb1298cdba..3895cc7eb9f4048ac02e8aac7c931814f41f0592 100644 (file)
@@ -139,6 +139,17 @@ void VISU::IsoSurfaces_i::DoHook(){
 }
 
 
+VISU_Actor* 
+VISU::IsoSurfaces_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+  if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+    anActor->SetVTKMapping(true);
+    return anActor;
+  }
+  return NULL;
+}
+
 void VISU::IsoSurfaces_i::SetMapScale(double theMapScale){
   myIsoSurfacesPL->SetMapScale(theMapScale);
 }
index c7371b6a48b4130e08b91e22aa62acc11bc6f7ee..9b442b68ba11918a8d52a31bd5dae820a481e349 100644 (file)
@@ -78,6 +78,10 @@ namespace VISU{
 
     virtual Storable* Restore(const Storable::TRestoringMap& theMap);
 
+    virtual 
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
     virtual void SetMapScale(double theMapScale = 1.0);
   };
 }
index 774b37114719bf3ca384a0a02a4af109ee2d1f16..5bab8e3d4b3eb4444ea6c98daa6908f3446ed265 100644 (file)
@@ -214,54 +214,42 @@ VISU::Storable* VISU::Mesh_i::Build (int theRestoring)
       myNodeColor.R = myNodeColor.G = 1.0;  myNodeColor.B = 1.0;
       myLinkColor.R = myLinkColor.G = myLinkColor.B = 83/255.;
     }
-    //jfa IPAL9284:if (int(myEntity) >= 0)
-    if (myEntity >= 0) //jfa IPAL9284
-      if (mySubMeshName == "")
+
+    if(myEntity >= 0)
+      if(mySubMeshName == "")
        myType = VISU::TENTITY;
       else
        myType = VISU::TFAMILY;
     else
       myType = VISU::TGROUP;
+
     if(MYDEBUG) MESSAGE("Mesh_i::Build - myType = "<<myType);
     QString aComment;
 
-    VISU_Convertor::TOutput *anOutput;
+    VISU::PIDMapper anIDMapper;
     switch(myType){
     case VISU::TENTITY :
-      anOutput = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);//jfa IPAL9284
+      anIDMapper = myResult->GetInput()->GetMeshOnEntity(myMeshName,(VISU::TEntity)myEntity);//jfa IPAL9284
       aComment.sprintf("myComment=ENTITY;myType=%d;myMeshName=%s;myId=%d",
                       VISU::TENTITY,myMeshName.c_str(),myEntity);
-      //pkv f
-      myMeshPL->SetIDMapper(myResult->GetInput()-> // i.e. the VISU_Convertor
-                          GetMeshOnEntityIDMapper(myMeshName,(VISU::TEntity)myEntity));
-      //pkv t
       break;
     case VISU::TFAMILY :
-      anOutput = myResult->GetInput()->GetFamilyOnEntity(myMeshName,(VISU::TEntity)myEntity,mySubMeshName);
+      anIDMapper = myResult->GetInput()->GetFamilyOnEntity(myMeshName,(VISU::TEntity)myEntity,mySubMeshName);
       aComment.sprintf("myComment=FAMILY;myType=%d;myMeshName=%s;myEntityId=%d;myName=%s",
                       VISU::TFAMILY,myMeshName.c_str(),myEntity,mySubMeshName.c_str());
-      //pkv f
-      myMeshPL->SetIDMapper(myResult->GetInput()-> // i.e. the VISU_Convertor
-                          GetFamilyOnEntityIDMapper(myMeshName,(VISU::TEntity)myEntity,mySubMeshName));
-      //pkv t  
-
       break;
     case VISU::TGROUP :
-      anOutput = myResult->GetInput()->GetMeshOnGroup(myMeshName,mySubMeshName);
+      anIDMapper = myResult->GetInput()->GetMeshOnGroup(myMeshName,mySubMeshName);
       aComment.sprintf("myComment=GROUP;myType=%d;myMeshName=%s;myName=%s",
                       VISU::TGROUP,myMeshName.c_str(),mySubMeshName.c_str());
-      
-      //pkv f
-      myMeshPL->SetIDMapper(myResult->GetInput()-> // i.e. the VISU_Convertor
-                           GetMeshOnGroupIDMapper(myMeshName,mySubMeshName));
-      //pkv t                      
       break;
     }
-    if(anOutput == NULL) throw std::runtime_error("Mesh_i::Build - anOutput == NULL !!!");
-    //
-    myMeshPL->SetInput(anOutput);
+    if(!anIDMapper) 
+      throw std::runtime_error("Mesh_i::Build - !anIDMapper !!!");
+
+    myMeshPL->SetIDMapper(anIDMapper);
     myMeshPL->Build();
-    //
+
     if(!theRestoring) { //Setting IOR on the label
       myMeshPL->Init();
       string aResultEntry = myResult->GetEntry();
index 6acc32d19ff72edcb40ec626aed0a5d06470a32d..641afcb0b350be930f6652522e859265034927e4 100644 (file)
@@ -165,6 +165,17 @@ void VISU::Plot3D_i::DoHook()
   ScalarMap_i::DoHook();
 }
 
+VISU_Actor* 
+VISU::Plot3D_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+{
+  if(VISU_Actor* anActor = ScalarMap_i::CreateActor(theIO)){
+    anActor->SetVTKMapping(true);
+    return anActor;
+  }
+  return NULL;
+}
+
 void VISU::Plot3D_i::SetMapScale(double theMapScale)
 {
   myPlot3DPL->SetMapScale(theMapScale);
index dd5ce19923cdfa989451203a39160ddb57fee609..9e21442458657188dd0320ff12db19c5fcc24cd6 100644 (file)
@@ -68,6 +68,10 @@ namespace VISU {
 
     virtual Storable* Restore (const Storable::TRestoringMap& theMap);
 
+    virtual 
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+
     static const std::string myComment;
     virtual const char* GetComment() const;
     virtual QString GenerateName();
index cceb492bebf0b23781c9f6016ee8110dad2110e6..b6fd953a76c5a0a8ac581bd105f9b92fc0c7dd0a 100644 (file)
@@ -724,9 +724,12 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
       MESSAGE("No mesh named " << theMeshName );
       return components;
     }
-    VISU_Convertor::TOutput* vtkMesh = myInput->GetMeshOnEntity (theMeshName,
-                                                                 CELL_ENTITY);
-    if ( !vtkMesh || vtkMesh->GetNumberOfCells() == 0 ) {
+
+    VISU::PIDMapper anIDMapper = myInput->GetMeshOnEntity(theMeshName,
+                                                         CELL_ENTITY);
+    VISU::TVTKOutput* aMesh = anIDMapper->GetVTKOutput();
+
+    if ( !aMesh || aMesh->GetNumberOfCells() == 0 ) {
       MESSAGE( "No cells in the mesh: " << theMeshName );
       return components;
     }
@@ -737,9 +740,9 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
     gp_Vec axDirs[ nbAxes ];
     float minSize[3] = { FLT_MAX, FLT_MAX, FLT_MAX };
     bool axesComputed = false;
-    for ( vtkIdType iCell = 0; iCell < vtkMesh->GetNumberOfCells(); ++iCell )
+    for ( vtkIdType iCell = 0; iCell < aMesh->GetNumberOfCells(); ++iCell )
     {
-      vtkCell* cell = vtkMesh->GetCell( iCell );
+      vtkCell* cell = aMesh->GetCell( iCell );
       int nbPnt = cell->GetNumberOfPoints();
       if ( nbPnt != 8 )
         continue;
@@ -787,8 +790,8 @@ const vector< float >* Result_i::GetAxisInfo(const string& theMeshName,
     // on axis direction; define bnd box
     set< float > comps[ 3 ];
     Bnd_Box box;
-    vtkPoints * points = vtkMesh->GetPoints();
-    vtkIdType iP, nbP = vtkMesh->GetNumberOfPoints();
+    vtkPoints * points = aMesh->GetPoints();
+    vtkIdType iP, nbP = aMesh->GetNumberOfPoints();
     for ( iP = 0; iP < nbP; ++iP )
     {
       float* coo = points->GetPoint( iP );
index c602b7185801201bc05910d2eb3ae2748588170c..70316daec4db40e6bf654ba383232bc48a99f885 100644 (file)
@@ -459,19 +459,18 @@ VISU::Storable* VISU::ScalarMap_i::Build(int theRestoring){
 void VISU::ScalarMap_i::DoSetInput(Result_i* theResult){
   if(theResult->GetInput() == NULL)
     throw std::runtime_error("Mesh_i::Build - theResult->GetInput() == NULL !!!");
+
   myField = theResult->GetInput()->GetField(myMeshName,myEntity,myFieldName);
   if(myField == NULL) 
     throw std::runtime_error("There is no Field with the parameters !!!");
-  VISU_Convertor::TOutput *anOutput =
+
+  VISU::PIDMapper anIDMapper =
     theResult->GetInput()->GetTimeStampOnMesh(myMeshName,myEntity,myFieldName,myIteration);
-  if(anOutput == NULL) 
+
+  if(!anIDMapper) 
     throw std::runtime_error("There is no TimeStamp with the parameters !!!");
-  myScalarMapPL->SetInput(anOutput);
-  //pkv f
-  //myScalarMapPL->SetProfile(theResult->GetInput()->GetProfile(myMeshName,myEntity,myFieldName,myIteration));
-  myScalarMapPL->SetIDMapper(theResult->GetInput()-> // i.e. the VISU_Convertor
-                            GetTimeStampOnMeshIDMapper(myMeshName,myEntity,myFieldName,myIteration));
-  //pkv t
+
+  myScalarMapPL->SetIDMapper(anIDMapper);
   myScalarMapPL->Build();
 }
 
@@ -493,7 +492,9 @@ void VISU::ScalarMap_i::SetMapScale(double theMapScale){
   myScalarMapPL->SetMapScale(theMapScale);
 }
 
-VISU_Actor* VISU::ScalarMap_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
+VISU_Actor* 
+VISU::ScalarMap_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO)
 {
   VISU_ScalarMapAct* anActor = VISU_ScalarMapAct::New();
   try{
index 3ff150209184e1f5993f98d0109ee32f4fc02136..60e666ae89228143f6c47c9fce17939f41bdbca2 100644 (file)
@@ -196,7 +196,9 @@ namespace VISU{
 
     virtual int GetIteration() { return myIteration; }
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+    virtual 
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
     virtual void UpdateActor(VISU_Actor* theActor) ;
   };
index ecfe43c5942117fc36e2752bdcd2ba668c8ab5d1..521759782298f640dcd0e28a360a2b71c6484f9b 100644 (file)
@@ -46,10 +46,13 @@ int VISU::StreamLines_i::IsPossible(Result_i* theResult, const char* theMeshName
                                    const char* theFieldName, int theIteration, int isMemoryCheck)
 {
   try{
-    if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false)) return 0;
-    VISU_Convertor::TOutput *anOutput = 
+    if(!VISU::ScalarMap_i::IsPossible(theResult,theMeshName,theEntity,theFieldName,theIteration,false)) 
+      return 0;
+
+    VISU::PIDMapper anIDMapper = 
       theResult->GetInput()->GetTimeStampOnMesh(theMeshName,VISU::TEntity(theEntity),theFieldName,theIteration);
-    bool aResult = VISU_StreamLinesPL::IsPossible(anOutput);
+    VISU::TVTKOutput* aDataSet = anIDMapper->GetVTKOutput();
+    bool aResult = VISU_StreamLinesPL::IsPossible(aDataSet);
     MESSAGE("StreamLines_i::IsPossible - aResult = "<<aResult);
     return aResult;
   }catch(std::exception& exc){
@@ -255,9 +258,15 @@ void VISU::StreamLines_i::Update() {
 }
 
 
-VISU_Actor* VISU::StreamLines_i::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
+VISU_Actor* 
+VISU::StreamLines_i
+::CreateActor(const Handle(SALOME_InteractiveObject)& theIO) 
 {
-  return VISU::DeformedShape_i::CreateActor(theIO);
+  if(VISU_Actor* anActor = VISU::DeformedShape_i::CreateActor(theIO)){
+    anActor->SetVTKMapping(true);
+    return anActor;
+  }
+  return NULL;
 }
 
 
index ab8429033c669e926ef33eabfd47bfbd9dbc89f4..a952a9010f57f10c6b6e49ae0533d2f62954777e 100644 (file)
@@ -93,7 +93,9 @@ namespace VISU{
 
     virtual void Update();
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+    virtual 
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
     virtual void UpdateActor(VISU_Actor* theActor);
 
index bd086a600491d10d3f657e513fb2c365d6603259..1207d315b2f01975aaf535771355c70ce450461b 100644 (file)
@@ -179,6 +179,7 @@ VISU_Actor* VISU::Vectors_i::CreateActor(const Handle(SALOME_InteractiveObject)&
   VISU_VectorsAct* anActor = VISU_VectorsAct::New();
   try{
     VISU::Prs3d_i::CreateActor(anActor,theIO);
+    anActor->SetVTKMapping(true);
     anActor->SetBarVisibility(true);
     anActor->GetProperty()->SetColor(myColor.R,myColor.G,myColor.B);
     anActor->GetProperty()->SetLineWidth(GetLineWidth());
index bcb4ab2fd2a108860504a75e0f1be590c66930f3..4750308c5b0630b3bf98b54a7b3e2884b3658e9a 100644 (file)
@@ -83,7 +83,9 @@ namespace VISU{
     virtual const char* GetComment() const;
     virtual QString GenerateName();
 
-    virtual VISU_Actor* CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
+    virtual
+    VISU_Actor* 
+    CreateActor(const Handle(SALOME_InteractiveObject)& theIO = NULL);
 
     virtual void UpdateActor(VISU_Actor* theActor) ;
   };