]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PR: debug SMDS memimp
authorprascle <prascle>
Thu, 13 May 2010 08:07:39 +0000 (08:07 +0000)
committerprascle <prascle>
Thu, 13 May 2010 08:07:39 +0000 (08:07 +0000)
15 files changed:
src/OBJECT/SMESH_Object.cxx
src/OBJECT/SMESH_Object.h
src/OBJECT/SMESH_ObjectDef.h
src/SMDS/Notes
src/SMDS/SMDS_Mesh.cxx
src/SMDS/SMDS_MeshElementIDFactory.cxx
src/SMDS/SMDS_MeshNode.cxx
src/SMDS/SMDS_UnstructuredGrid.cxx
src/SMDS/SMDS_UnstructuredGrid.hxx
src/SMDS/SMDS_VtkEdge.cxx
src/SMESHDS/SMESHDS_Mesh.cxx
src/SMESHDS/SMESHDS_SubMesh.cxx
src/SMESHGUI/SMESHGUI_ComputeDlg.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.cxx
src/SMESHGUI/SMESHGUI_VTKUtils.h

index ea86d22c5a7f724796abfce938e43fa0099e57ea..58715e251e89a654ed3f4bfaa6c5337eaa10679c 100644 (file)
@@ -532,12 +532,20 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
   return true;
 }
 
+vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid()
+{
+       MESSAGE("SMESH_VisualObjDef::GetUnstructuredGrid " << myGrid);
+       return myGrid;
+}
+
+
 //=================================================================================
 // function : IsValid
 // purpose  : Return true if there are some entities
 //=================================================================================
 bool SMESH_VisualObjDef::IsValid() const
 {
+       MESSAGE("SMESH_VisualObjDef::IsValid");
   return GetNbEntities(SMDSAbs_Node) > 0      || 
          GetNbEntities(SMDSAbs_0DElement) > 0 || 
          GetNbEntities(SMDSAbs_Edge) > 0      || 
@@ -557,6 +565,7 @@ bool SMESH_VisualObjDef::IsValid() const
 SMESH_MeshObj::SMESH_MeshObj(SMESH::SMESH_Mesh_ptr theMesh):
   myClient(SalomeApp_Application::orb(),theMesh)
 {
+       myEmptyGrid = 0;
   if ( MYDEBUG ) 
     MESSAGE("SMESH_MeshObj - this = "<<this<<"; theMesh->_is_nil() = "<<theMesh->_is_nil());
 }
@@ -578,6 +587,7 @@ SMESH_MeshObj::~SMESH_MeshObj()
 bool SMESH_MeshObj::Update( int theIsClear )
 {
   // Update SMDS_Mesh on client part
+       MESSAGE("SMESH_MeshObj::Update");
   if ( myClient.Update(theIsClear) || GetUnstructuredGrid()->GetNumberOfPoints()==0) {
     buildPrs();  // Fill unstructured grid
     return true;
@@ -585,6 +595,22 @@ bool SMESH_MeshObj::Update( int theIsClear )
   return false;
 }
 
+bool SMESH_MeshObj::NulData()
+{
+       MESSAGE ("SMESH_MeshObj::NulData() ==================================================================================");
+       if (!myEmptyGrid)
+       {
+         myEmptyGrid = SMDS_UnstructuredGrid::New();
+         myEmptyGrid->Initialize();
+         myEmptyGrid->Allocate();
+         vtkPoints* points = vtkPoints::New();
+         points->SetNumberOfPoints(0);
+         myEmptyGrid->SetPoints( points );
+         points->Delete();
+         myEmptyGrid->BuildLinks();
+       }
+       myGrid->ShallowCopy(myEmptyGrid);
+}
 //=================================================================================
 // function : GetElemDimension
 // purpose  : Get dimension of element
index 3bc178eca4127f47a2da547bfb6dda5083086f3f..5dbf6d5ae6e8942b03d115e2dd84c5fe9444d5ae 100644 (file)
@@ -55,6 +55,7 @@ class SMESHOBJECT_EXPORT SMESH_VisualObj
 {
 public:
   virtual bool Update( int theIsClear = true ) = 0;
+  virtual bool NulData() = 0;
   virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
   virtual int GetElemDimension( const int theObjId ) = 0;
 
index ac0bd30c126bd4ff86cdc7f229d6dfc5efca6b60..ab79b9a011290a1677a05abf79cdc18d903ac18d 100644 (file)
@@ -61,6 +61,7 @@ public:
   virtual                   ~SMESH_VisualObjDef();
   
   virtual bool              Update( int theIsClear = true ) = 0;
+  virtual bool              NulData() {return 0; };
   virtual void              UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0;
   virtual int               GetElemDimension( const int theObjId ) = 0;
 
@@ -76,7 +77,7 @@ public:
                                           int&      theNodeId1,
                                           int&      theNodeId2 ) const;
 
-  virtual vtkUnstructuredGrid* GetUnstructuredGrid() { return myGrid; }
+  virtual vtkUnstructuredGrid* GetUnstructuredGrid(); // { return myGrid; }
   
   virtual vtkIdType         GetNodeObjId( int theVTKID );
   virtual vtkIdType         GetNodeVTKId( int theObjID );
@@ -90,7 +91,7 @@ protected:
 //  void                      buildNodePrs();
 //  void                      buildElemPrs();
   
-private:                                   
+//private:
 
 //  TMapOfIds                 mySMDS2VTKNodes;
 //  TMapOfIds                 myVTK2SMDSNodes;
@@ -114,6 +115,7 @@ public:
   virtual                   ~SMESH_MeshObj();
   
   virtual bool              Update( int theIsClear = true );
+  virtual bool              NulData();
   
   virtual int               GetNbEntities( const SMDSAbs_ElementType) const;
   virtual int               GetEntities( const SMDSAbs_ElementType, TEntityList& ) const;
@@ -128,6 +130,7 @@ public:
 
 protected:
   SMESH_Client              myClient;
+  vtkUnstructuredGrid*      myEmptyGrid;
 };
 
 
index a9bc5a37e74ade16541da795e9d087129668bd90..38ac69ae1cc9dc5823252508d90df20ba8436c8a 100644 (file)
@@ -1,3 +1,16 @@
+Problemes en cours
+==================
+
+- visualisation de groupe (type d'element): on voit tout le maillage, mais le groupe est OK
+- inversion d'un volume (tetra): exception
+- script de creation de noeuds et d'elements: OK, mais pas compatible avec version precedente (numerotation noeuds differente)
+- affichage numeros noeuds: numeros en trop sur O (enlever dans vtkUnstructuredGrid)    
+
+A tester, non pris en compte
+============================
+- engine standalone
+- polyedres (attendre vtk)
+
 
 =============================== Hypothese de refonte de l'API de SMDS
 
index 1f704a681d20b72e46de6438efc7fcfbe99d5aed..ed42389f991d1d1b56ac0cc794843789a693ade6 100644 (file)
@@ -2255,47 +2255,52 @@ SMDS_Mesh::~SMDS_Mesh()
 
 void SMDS_Mesh::Clear()
 {
-  if (myParent!=NULL) {
+  if (myParent!=NULL)
+    {
     SMDS_ElemIteratorPtr eIt = elementsIterator();
     while ( eIt->more() )
       myElementIDFactory->ReleaseID(eIt->next()->GetID());
     SMDS_NodeIteratorPtr itn = nodesIterator();
     while (itn->more())
       myNodeIDFactory->ReleaseID(itn->next()->GetID());
-  }
-  else {
+    }
+  else
+    {
     myNodeIDFactory->Clear();
     myElementIDFactory->Clear();
-  }
+    }
 
   SMDS_ElemIteratorPtr itv = elementsIterator();
   while (itv->more())
-    delete itv->next();
+    {
+      SMDS_MeshElement* elem = (SMDS_MeshElement*)(itv->next());
+      SMDSAbs_ElementType aType = elem->GetType();
+      switch (aType)
+      {
+        case SMDSAbs_0DElement:
+          delete elem;
+          break;
+        case SMDSAbs_Edge:
+           myEdgePool->destroy(static_cast<SMDS_VtkEdge*>(elem));
+          break;
+        case SMDSAbs_Face:
+          myFacePool->destroy(static_cast<SMDS_VtkFace*>(elem));
+          break;
+        case SMDSAbs_Volume:
+          myVolumePool->destroy(static_cast<SMDS_VtkVolume*>(elem));
+          break;
+        default:
+          break;
+      }
+    }
   myCells.clear();
 
-//  SMDS_VolumeIteratorPtr itv = volumesIterator();
-//  while (itv->more())
-//    delete itv->next();
-//  myVolumes.Clear();
-//
-//  SMDS_FaceIteratorPtr itf = facesIterator();
-//  while (itf->more())
-//    delete itf->next();
-//  myFaces.Clear();
-//
-//  SMDS_EdgeIteratorPtr ite = edgesIterator();
-//  while (ite->more())
-//    delete ite->next();
-//  myEdges.Clear();
-//
-//  SMDS_0DElementIteratorPtr it0d = elements0dIterator();
-//  while (it0d->more())
-//    delete it0d->next();
-//  my0DElements.Clear();
-
   SMDS_NodeIteratorPtr itn = nodesIterator();
   while (itn->more())
-    delete itn->next();
+    {
+      SMDS_MeshNode *node = (SMDS_MeshNode*)(itn->next());
+      myNodePool->destroy(node);
+    }
   myNodes.clear();
 
   list<SMDS_Mesh*>::iterator itc=myChildren.begin();
@@ -2303,6 +2308,14 @@ void SMDS_Mesh::Clear()
     (*itc)->Clear();
 
   myInfo.Clear();
+
+  myGrid->Initialize();
+  myGrid->Allocate();
+  vtkPoints* points = vtkPoints::New();
+  points->SetNumberOfPoints(SMDS_Mesh::chunkSize);
+  myGrid->SetPoints( points );
+  points->Delete();
+  myGrid->BuildLinks();
 }
 
 ///////////////////////////////////////////////////////////////////////////////
index 412159a382055eebf470b87b9f9889cb5efd2363..e33e75ae9a807a89b2df2cefc0bb0a80a46e01c9 100644 (file)
@@ -128,6 +128,7 @@ SMDS_MeshElement* SMDS_MeshElementIDFactory::MeshElement(int ID)
 void SMDS_MeshElementIDFactory::ReleaseID(const int ID)
 {
   int vtkId = myMesh->myIDElements[ID];
+  //MESSAGE("~~~~~~~~~~~~~~ SMDS_MeshElementIDFactory::ReleaseID smdsId vtkId " << ID << " " << vtkId);
   myMesh->myIDElements[ID] = -1;
   myMesh->myVtkIndex[vtkId] = -1;
   SMDS_MeshIDFactory::ReleaseID(ID);
index f1c100046be18ea73676daea1ece4c404c82f953..1752046b0bf49607c5c9d52cf6d553bd2ac0ccc2 100644 (file)
@@ -51,18 +51,19 @@ SMDS_MeshNode::SMDS_MeshNode() :
   SMDS_MeshElement(-1, -1, -1),
   myPosition(SMDS_SpacePosition::originSpacePosition())
 {
+  nbNodes++;
 }
 
 SMDS_MeshNode::SMDS_MeshNode(int id, int meshId, int shapeId, double x, double y, double z):
   SMDS_MeshElement(id, meshId, shapeId),
   myPosition(SMDS_SpacePosition::originSpacePosition())
 {
+  nbNodes++;
   init(id, meshId, shapeId, x, y ,z);
 }
 
 void SMDS_MeshNode::init(int id, int meshId, int shapeId, double x, double y, double z)
 {
-  nbNodes++;
   myID = id;
   myMeshId = meshId;
   myShapeId = shapeId;
index 7fe994f2108b438560de2eebeb76e82b139f7cf7..143d54334de7988cf8a1fd00aca95cc8cdd3448f 100644 (file)
@@ -4,6 +4,7 @@
 #include "utilities.h"
 
 #include <vtkCellArray.h>
+#include <vtkCellLinks.h>
 #include <vtkIdTypeArray.h>
 #include <vtkUnsignedCharArray.h>
 
@@ -33,6 +34,12 @@ unsigned long SMDS_UnstructuredGrid::GetMTime()
        return mtime;
 }
 
+void SMDS_UnstructuredGrid::Update()
+{
+       MESSAGE("SMDS_UnstructuredGrid::Update");
+       return vtkUnstructuredGrid::Update();
+}
+
 void SMDS_UnstructuredGrid::UpdateInformation()
 {
        MESSAGE("SMDS_UnstructuredGrid::UpdateInformation");
@@ -49,9 +56,16 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
        int startBloc = 0;
        int endBloc = 0;
        int alreadyCopied = 0;
+
        typedef enum {lookHoleStart, lookHoleEnd, lookBlocEnd} enumState;
        enumState compactState = lookHoleStart;
 
+//     if (this->Links)
+//     {
+//             this->Links->UnRegister(this);
+//             this->Links = 0;
+//     }
+
        // --- if newNodeSize, create a new compacted vtkPoints
 
        vtkPoints *newPoints = 0;
@@ -71,6 +85,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
                        case lookHoleStart:
                                if (idNodesOldToNew[i] < 0)
                                {
+                                       MESSAGE("-------------- newNodeSize, startHole " << i <<  " " << oldNodeSize);
                                        startHole = i;
                                        compactState = lookHoleEnd;
                                }
@@ -78,6 +93,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
                        case lookHoleEnd:
                                if (idNodesOldToNew[i] >= 0)
                                {
+                                       MESSAGE("-------------- newNodeSize, endHole " << i <<  " " << oldNodeSize);
                                        endHole = i;
                                        startBloc = i;
                                        compactState = lookBlocEnd;
@@ -88,7 +104,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
                                else if (i == (oldNodeSize-1)) endBloc = i+1;
                                if (endBloc)
                                {
-                                       MESSAGE("-------------- newNodeSize, endbloc");
+                                       MESSAGE("-------------- newNodeSize, endbloc " << endBloc <<  " " << oldNodeSize);
                                        void *target = newPoints->GetVoidPointer(3*alreadyCopied);
                                        void *source = this->Points->GetVoidPointer(3*startBloc);
                                        int nbPoints = endBloc - startBloc;
@@ -106,7 +122,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
                }
                if (!alreadyCopied) // no hole, but shorter, no need to modify idNodesOldToNew
                {
-                       MESSAGE("------------- newNodeSize, shorter")
+                       MESSAGE("------------- newNodeSize, shorter " << oldNodeSize)
                        void *target = newPoints->GetVoidPointer(0);
                        void *source = this->Points->GetVoidPointer(0);
                        int nbPoints = newNodeSize;
@@ -151,6 +167,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
                case lookHoleStart:
                        if (this->Types->GetValue(i) == VTK_EMPTY_CELL)
                        {
+                       MESSAGE(" -------- newCellSize, startHole " << i << " " << oldCellSize);
                                startHole = i;
                                compactState = lookHoleEnd;
                        }
@@ -158,6 +175,7 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
                case lookHoleEnd:
                        if (this->Types->GetValue(i) != VTK_EMPTY_CELL)
                        {
+                       MESSAGE(" -------- newCellSize, EndHole " << i << " " << oldCellSize);
                                endHole = i;
                                startBloc = i;
                                compactState = lookBlocEnd;
@@ -168,39 +186,45 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector<int>& idNodesOldToNew, int n
                        else if (i == (oldCellSize-1)) endBloc = i+1;
                        if (endBloc)
                        {
-                       MESSAGE(" -------- newCellSize, endBloc");
+                       MESSAGE(" -------- newCellSize, endBloc " << endBloc << " " << oldCellSize);
                                for (int j=startBloc; j<endBloc; j++)
                                {
                                        newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
                                        idCellsOldToNew[j] = alreadyCopied;
-                                       int oldLoc = this->Locations->GetValue(j);
-                                       int nbpts;
-                                       this->Connectivity->GetCell(oldLoc, nbpts, pointsCell);
+                                       vtkIdType oldLoc = this->Locations->GetValue(j);
+                                       vtkIdType nbpts;
+                                       vtkIdType *oldPtsCell = 0;
+                                       this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
                                        for (int l=0; l<nbpts; l++)
-                                               pointsCell[l] = idNodesOldToNew[pointsCell[l]];
+                                       {
+                                               int oldval = oldPtsCell[l];
+                                               pointsCell[l] = idNodesOldToNew[oldval];
+                                       }
                                        int newcnt = newConnectivity->InsertNextCell(nbpts, pointsCell);
                                        int newLoc = newConnectivity->GetInsertLocation(nbpts);
                                        newLocations->SetValue(alreadyCopied, newLoc);
                                        alreadyCopied++;
                                }
+                       compactState = lookHoleStart;
                        }
                        break;
                }
     }
     if (!alreadyCopied) // no hole, but shorter
     {
-       MESSAGE(" -------- newCellSize, shorter");
+       MESSAGE(" -------- newCellSize, shorter " << oldCellSize);
                for (int j=0; j<oldCellSize; j++)
                {
                        newTypes->SetValue(alreadyCopied, this->Types->GetValue(j));
                        idCellsOldToNew[j] = alreadyCopied;
-                       int oldLoc = this->Locations->GetValue(j);
-                       int nbpts;
-                       this->Connectivity->GetCell(oldLoc, nbpts, pointsCell);
+                       vtkIdType oldLoc = this->Locations->GetValue(j);
+                       vtkIdType nbpts;
+                       vtkIdType *oldPtsCell = 0;
+                       this->Connectivity->GetCell(oldLoc, nbpts, oldPtsCell);
                        //MESSAGE(j << " " << alreadyCopied << " " << (int)this->Types->GetValue(j) << " " << oldLoc << " " << nbpts );
                        for (int l=0; l<nbpts; l++)
                        {
-                               int oldval = pointsCell[l];
+                               int oldval = oldPtsCell[l];
                                pointsCell[l] = idNodesOldToNew[oldval];
                                //MESSAGE("   " << oldval << " " << pointsCell[l]);
                        }
index e2bc01d0d0c16b8cba92b0c940ad0ec5dfde297b..9840dcc39dfcefaf14bf15b970de7b8a6349e2b4 100644 (file)
@@ -19,6 +19,7 @@ public:
                                         std::vector<int>& idCellsOldToNew, int newCellSize);
 
        virtual unsigned long GetMTime();
+       virtual void Update();
        virtual void UpdateInformation();
 
     static SMDS_UnstructuredGrid* New();
index 75a96b966ecf4eb33cc1fad64a4b7f0d3f885fe6..3b3e25882f96487de422da2bb89f9e345795111e 100644 (file)
@@ -6,6 +6,7 @@
 #include "utilities.h"
 
 #include <vector>
+#include <cassert>
 
 using namespace std;
 
@@ -48,6 +49,7 @@ int SMDS_VtkEdge::NbNodes() const
 {
        vtkUnstructuredGrid* grid =SMDS_Mesh::_meshList[myMeshId]->getGrid();
        int nbPoints = grid->GetCell(myVtkID)->GetNumberOfPoints();
+       assert(nbPoints >=2);
        return nbPoints;
 }
 
index d3bcea07b7ffde59e53674165f04c721343fbd80..880cda0e30cd1a93612a99c464643eeed9f9e749 100644 (file)
@@ -816,6 +816,7 @@ void SMESHDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elt,
                                      SMESHDS_SubMesh *        subMesh,
                                      bool                     fromGroups)
 {
+  //MESSAGE(" --------------------------------> SMESHDS_Mesh::RemoveFreeElement " << subMesh << " " << fromGroups);
   if (elt->GetType() == SMDSAbs_Node) {
     RemoveFreeNode( static_cast<const SMDS_MeshNode*>(elt), subMesh);
     return;
@@ -1779,9 +1780,12 @@ void SMESHDS_Mesh::compactMesh()
 {
        int newNodeSize = 0;
        int nbNodes = myNodes.size();
+       int nbVtkNodes = myGrid->GetNumberOfPoints();
+       MESSAGE("nbNodes=" << nbNodes << " nbVtkNodes=" << nbVtkNodes);
+       if (nbNodes > nbVtkNodes) nbVtkNodes = nbNodes;
        vector<int> idNodesOldToNew;
        idNodesOldToNew.clear();
-       idNodesOldToNew.resize(nbNodes, -1); // all unused id will be -1
+       idNodesOldToNew.resize(nbVtkNodes, -1); // all unused id will be -1
 
        bool areNodesModified = ! myNodeIDFactory->isPoolIdEmpty();
        MESSAGE("------------------------------------------------- SMESHDS_Mesh::compactMesh " << areNodesModified);
@@ -1804,9 +1808,12 @@ void SMESHDS_Mesh::compactMesh()
 
        int newCellSize = 0;
        int nbCells = myCells.size();
+       int nbVtkCells = myGrid->GetNumberOfCells();
+       MESSAGE("nbCells=" << nbCells << " nbVtkCells=" << nbVtkCells);
+       if (nbCells > nbVtkCells) nbVtkCells = nbCells;
        vector<int> idCellsOldToNew;
        idCellsOldToNew.clear();
-       idCellsOldToNew.resize(nbCells, -1);             // all unused id will be -1
+       idCellsOldToNew.resize(nbVtkCells, -1);             // all unused id will be -1
 
        for (int i=0; i<nbCells; i++)
        {
@@ -1842,17 +1849,56 @@ void SMESHDS_Mesh::compactMesh()
 
        // --- SMDS_MeshCell, myIDElements and myVtkIndex (myCells and myElementIdFactory are not compacted)
 
-       for (int oldVtkId=0; oldVtkId<nbCells; oldVtkId++)
+       int vtkIndexSize = myVtkIndex.size();
+       int maxVtkId = 0;
+       for (int oldVtkId=0; oldVtkId<vtkIndexSize; oldVtkId++)
        {
                int smdsId = this->myVtkIndex[oldVtkId];
                if (smdsId >=0)
                {
                        int newVtkId = idCellsOldToNew[oldVtkId];
+                       if (newVtkId > maxVtkId) maxVtkId = newVtkId;
+                       //MESSAGE("===========> smdsId newVtkId " << smdsId << " " << newVtkId);
                        myCells[smdsId]->setVtkId(newVtkId);
                        myIDElements[smdsId] = newVtkId;
                        myVtkIndex[newVtkId] = smdsId;
                }
        }
+       maxVtkId++;
+       MESSAGE("myCells.size()=" << myCells.size() << " myIDElements.size()=" << myIDElements.size() << " myVtkIndex.size()=" << myVtkIndex.size() );
+       MESSAGE("maxVtkId=" << maxVtkId);
+
+       SetOfCells newCells;
+       vector<int> newSmdsToVtk;
+       vector<int> newVtkToSmds;
+
+       newCells.resize(maxVtkId,0);
+       newSmdsToVtk.resize(maxVtkId,-1);
+       newVtkToSmds.resize(maxVtkId,-1);
+
+       int myCellsSize = myCells.size();
+       int newSmdsId =0;
+       for (int i=0; i<myCellsSize; i++)
+       {
+               if (myCells[i])
+               {
+           newCells[newSmdsId] = myCells[i];
+           int idvtk = myCells[i]->getVtkId();
+           newSmdsToVtk[newSmdsId] = idvtk;
+           assert(idvtk < maxVtkId);
+           newVtkToSmds[idvtk] = newSmdsId;
+           myCells[i]->setId(newSmdsId);
+           newSmdsId++;
+           assert(newSmdsId <= maxVtkId);
+               }
+       }
+
+       myCells.swap(newCells);
+       myIDElements.swap(newSmdsToVtk);
+       myVtkIndex.swap(newVtkToSmds);
+       MESSAGE("myCells.size()=" << myCells.size() << " myIDElements.size()=" << myIDElements.size() << " myVtkIndex.size()=" << myVtkIndex.size() );
+
+
 
        // ---TODO: myNodes, myElements in submeshes
 
index 02141893d96c91b030cf51ccebda7b5c0da86860..d45d9ddb8cf9c6b6081b43c451e4c799e133d176 100644 (file)
@@ -70,7 +70,7 @@ bool SMESHDS_SubMesh::RemoveElement(const SMDS_MeshElement * ME, bool isElemDele
   if (!isElemDeleted) // alive element has valid ID and can be found
       {
         int idInSubShape = ME->getIdInShape();
-        //MESSAGE("SMESHDS_SubMesh::RemoveElement " << idInSubShape << " " << ME->GetID());
+        //MESSAGE("SMESHDS_SubMesh::RemoveElement " << idInSubShape << " " << ME->GetID() << " " << myUnusedIdElements);
         assert(idInSubShape >= 0);
         assert(idInSubShape < myElements.size());
         myElements[idInSubShape] = 0; // this vector entry is no more used
index 60042708182ece6acfc5f87afcd7a7fd97604fb7..9ca09b1a3ed5f218a18b5b73f922796366d20045 100644 (file)
@@ -693,6 +693,7 @@ void SMESHGUI_BaseComputeOp::computeMesh()
 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
       OCC_CATCH_SIGNALS;
 #endif
+      SMESH::UpdateNulData(myIObject, true);
       if (gen->Compute(myMesh, myMainShape))
         computeFailed = false;
     }
index d19fa7d1f9062f96486ed95b2ab9ac07c3f9886b..97577596fb112ab87e48c76801e3603101a4c071 100644 (file)
@@ -252,7 +252,7 @@ namespace SMESH
    */
   //================================================================================
 
-  TVisualObjPtr GetVisualObj(int theStudyId, const char* theEntry){
+  TVisualObjPtr GetVisualObj(int theStudyId, const char* theEntry, bool nulData){
     TVisualObjPtr aVisualObj;
     TVisualObjCont::key_type aKey(theStudyId,theEntry);
     try{
@@ -326,7 +326,11 @@ namespace SMESH
 #if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
         OCC_CATCH_SIGNALS;
 #endif
-        objModified = aVisualObj->Update();
+        MESSAGE("GetVisualObj");
+        if (nulData)
+               objModified = aVisualObj->NulData();
+        else
+          objModified = aVisualObj->Update();
       }
       catch (...) {
 #ifdef _DEBUG_
@@ -662,6 +666,7 @@ namespace SMESH
 
   bool UpdateView(SUIT_ViewWindow *theWnd, EDisplaing theAction, const char* theEntry)
   {
+       MESSAGE("UpdateView");
     bool OK = false;
     SVTK_ViewWindow* aViewWnd = GetVtkViewWindow(theWnd);
     if (!aViewWnd)
@@ -736,6 +741,7 @@ namespace SMESH
 
 
   bool UpdateView(EDisplaing theAction, const char* theEntry){
+       MESSAGE("UpdateView");
     SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( GetActiveStudy() );
     SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( aStudy->application() );
     SUIT_ViewWindow *aWnd = app->activeViewManager()->getActiveView();
@@ -774,6 +780,7 @@ namespace SMESH
 
   bool Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
   {
+       MESSAGE("Update");
     _PTR(Study) aStudy = GetActiveStudyDocument();
     CORBA::Long anId = aStudy->StudyId();
     if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry())) {
@@ -784,6 +791,18 @@ namespace SMESH
     return false;
   }
 
+  bool UpdateNulData(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay)
+  {
+       MESSAGE("UpdateNulData");
+    _PTR(Study) aStudy = GetActiveStudyDocument();
+    CORBA::Long anId = aStudy->StudyId();
+    if ( TVisualObjPtr aVisualObj = SMESH::GetVisualObj(anId,theIO->getEntry(), true)) {
+      if ( theDisplay )
+        UpdateView(SMESH::eDisplay,theIO->getEntry());
+      return true;
+    }
+    return false;
+  }
 
   void UpdateSelectionProp( SMESHGUI* theModule ) {
     if( !theModule )
index 0d49a44375823a8678fe8bca2f6dac566f6b2278..12c74459e6fcf3310b968576b7bd8309971b31d1 100644 (file)
@@ -62,7 +62,7 @@ namespace SMESH
   typedef std::pair<int,std::string> TKeyOfVisualObj;
   
 SMESHGUI_EXPORT
-  TVisualObjPtr GetVisualObj( int, const char* );
+  TVisualObjPtr GetVisualObj( int, const char*, bool nulData =false );
 SMESHGUI_EXPORT
   void OnVisuException(); // PAL16631
 
@@ -119,7 +119,10 @@ SMESHGUI_EXPORT
   void UpdateView();
 
 SMESHGUI_EXPORT
-  bool Update( const Handle(SALOME_InteractiveObject)&, bool );
+  bool UpdateNulData( const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay);
+
+SMESHGUI_EXPORT
+  bool Update( const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay);
 
   //----------------------------------------------------------------------------
 SMESHGUI_EXPORT