Salome HOME
Integration some new classes for working of core mesher
authorskl <skl@opencascade.com>
Tue, 4 Oct 2005 06:04:02 +0000 (06:04 +0000)
committerskl <skl@opencascade.com>
Tue, 4 Oct 2005 06:04:02 +0000 (06:04 +0000)
src/SMESH/Makefile.in
src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx [new file with mode: 0644]
src/SMESH/SMESH_MeshEditor.cxx
src/SMESH/SMESH_MeshEditor.hxx
src/SMESH/SMESH_SequenceOfElemPtr.hxx [new file with mode: 0644]

index 3e98ff5904a6bc029ea3de1daa68e497fc7bff25..613502dc2746dbd84b461eafafd825a852c2ae6c 100644 (file)
@@ -47,7 +47,9 @@ EXPORT_HEADERS= \
        SMESH_MeshEditor.hxx \
        SMESH_Block.hxx \
        SMESH_Pattern.hxx \
-       SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx
+       SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx \
+       SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx \
+       SMESH_SequenceOfElemPtr.hxx
 
 EXPORT_PYSCRIPTS =
 
diff --git a/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx b/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx
new file mode 100644 (file)
index 0000000..87382dd
--- /dev/null
@@ -0,0 +1,31 @@
+// File:      SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx
+// Created:   26.09.05 17:41:10
+// Author:    Sergey KUUL
+// Copyright: Airbus Industries 2004
+
+
+#ifndef SMESH_DataMapOfElemPtrSequenceOfElemPtr_HeaderFile
+#define SMESH_DataMapOfElemPtrSequenceOfElemPtr_HeaderFile
+
+#include <SMESH_SequenceOfElemPtr.hxx>
+
+#include <NCollection_DefineDataMap.hxx>
+
+inline Standard_Integer HashCode(SMDS_MeshElementPtr theElem,
+                                 const Standard_Integer theUpper)
+{
+  SMDS_MeshElement * anElem = (SMDS_MeshElement *) theElem;
+  return HashCode(anElem,theUpper);
+}
+
+inline Standard_Boolean IsEqual(SMDS_MeshElementPtr theOne,
+                                SMDS_MeshElementPtr theTwo)
+{
+  return theOne == theTwo;
+}
+
+DEFINE_BASECOLLECTION (SMESH_BaseCollectionSequenceOfElemPtr, SMESH_SequenceOfElemPtr)
+DEFINE_DATAMAP (SMESH_DataMapOfElemPtrSequenceOfElemPtr,
+                SMESH_BaseCollectionSequenceOfElemPtr,
+                SMDS_MeshElementPtr, SMESH_SequenceOfElemPtr)
+#endif 
index 3ab795264d54f260c7c2bc43e15165ed8aeeede2..932bd828d5a51eb7934f2fd79abf327142f46682 100644 (file)
@@ -2467,13 +2467,16 @@ void SMESH_MeshEditor::ExtrusionSweep(set<const SMDS_MeshElement*> & theElems,
     sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem] );
 
     // fill history
-    TColStd_ListOfInteger ListNewID;
+    //TColStd_ListOfInteger ListNewID;
+    SMESH_SequenceOfElemPtr SeqNewME;
     list<const SMDS_MeshElement*> tmpList = newElemsMap[elem];
     for(list<const SMDS_MeshElement*>::iterator ite = tmpList.begin();
         ite!=tmpList.end(); ite++) {
-      ListNewID.Append((*ite)->GetID());
+      //ListNewID.Append((*ite)->GetID());
+      SeqNewME.Append(*ite);
     }
-    myExtrusionHistory.Bind(elem->GetID(),ListNewID);
+    //myExtrusionHistory.Bind(elem->GetID(),ListNewID);
+    myExtrusionHistory.Bind(elem,SeqNewME);
     // end fill history
 
   }
index fdbda16d08b5a36e568f3f31bbb0f03de1819ee8..6c4dc76c8ef55a38daac5e66238e305382225385 100644 (file)
@@ -35,7 +35,8 @@
 
 #include <list>
 #include <map>
-#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
+//#include <TColStd_DataMapOfIntegerListOfInteger.hxx>
+#include <SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx>
 
 class SMDS_MeshElement;
 class SMDS_MeshFace;
@@ -305,14 +306,14 @@ class SMESH_MeshEditor {
 
   SMESHDS_Mesh * GetMeshDS() { return myMesh->GetMeshDS(); }
 
-  const TColStd_DataMapOfIntegerListOfInteger& GetExtrusionHistory() const
+  const SMESH_DataMapOfElemPtrSequenceOfElemPtr& GetExtrusionHistory() const
     { return myExtrusionHistory; }
 
  private:
 
   SMESH_Mesh * myMesh;
 
-  TColStd_DataMapOfIntegerListOfInteger myExtrusionHistory;
+  SMESH_DataMapOfElemPtrSequenceOfElemPtr myExtrusionHistory;
 
 };
 
diff --git a/src/SMESH/SMESH_SequenceOfElemPtr.hxx b/src/SMESH/SMESH_SequenceOfElemPtr.hxx
new file mode 100644 (file)
index 0000000..aa4d02d
--- /dev/null
@@ -0,0 +1,20 @@
+// File:      SMESH_SequenceOfElemPtr.hxx
+// Created:   26.09.05 17:41:10
+// Author:    Sergey KUUL
+// Copyright: Airbus Industries 2004
+
+
+#ifndef SMESH_SequenceOfElemPtr_HeaderFile
+#define SMESH_SequenceOfElemPtr_HeaderFile
+
+#include <NCollection_DefineSequence.hxx>
+
+//#include <Handle_SMDS_MeshElement.hxx>
+#include <SMDS_MeshElement.hxx>
+
+typedef const SMDS_MeshElement* SMDS_MeshElementPtr;
+
+DEFINE_BASECOLLECTION (SMESH_BaseCollectionElemPtr, SMDS_MeshElementPtr)
+DEFINE_SEQUENCE (SMESH_SequenceOfElemPtr, SMESH_BaseCollectionElemPtr, SMDS_MeshElementPtr)
+
+#endif