From 56e741c0f7baa6d2f3e0201de90301f838104b6b Mon Sep 17 00:00:00 2001 From: skl Date: Tue, 4 Oct 2005 06:04:02 +0000 Subject: [PATCH] Integration some new classes for working of core mesher --- src/SMESH/Makefile.in | 4 ++- ...MESH_DataMapOfElemPtrSequenceOfElemPtr.hxx | 31 +++++++++++++++++++ src/SMESH/SMESH_MeshEditor.cxx | 9 ++++-- src/SMESH/SMESH_MeshEditor.hxx | 7 +++-- src/SMESH/SMESH_SequenceOfElemPtr.hxx | 20 ++++++++++++ 5 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx create mode 100644 src/SMESH/SMESH_SequenceOfElemPtr.hxx diff --git a/src/SMESH/Makefile.in b/src/SMESH/Makefile.in index 3e98ff590..613502dc2 100644 --- a/src/SMESH/Makefile.in +++ b/src/SMESH/Makefile.in @@ -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 index 000000000..87382ddad --- /dev/null +++ b/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx @@ -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 + +#include + +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 diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 3ab795264..932bd828d 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -2467,13 +2467,16 @@ void SMESH_MeshEditor::ExtrusionSweep(set & theElems, sweepElement( aMesh, elem, newNodesItVec, newElemsMap[elem] ); // fill history - TColStd_ListOfInteger ListNewID; + //TColStd_ListOfInteger ListNewID; + SMESH_SequenceOfElemPtr SeqNewME; list tmpList = newElemsMap[elem]; for(list::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 } diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index fdbda16d0..6c4dc76c8 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -35,7 +35,8 @@ #include #include -#include +//#include +#include 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 index 000000000..aa4d02df8 --- /dev/null +++ b/src/SMESH/SMESH_SequenceOfElemPtr.hxx @@ -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 + +//#include +#include + +typedef const SMDS_MeshElement* SMDS_MeshElementPtr; + +DEFINE_BASECOLLECTION (SMESH_BaseCollectionElemPtr, SMDS_MeshElementPtr) +DEFINE_SEQUENCE (SMESH_SequenceOfElemPtr, SMESH_BaseCollectionElemPtr, SMDS_MeshElementPtr) + +#endif -- 2.39.2