Salome HOME
INT PAL 0052683: Parameter "Color group" in the "Create Group" dialog box is empty
[modules/smesh.git] / src / SMESHUtils / SMESH_TypeDefs.hxx
index 6e5bda2a523c08584bb425a22c886229b8bc8433..f5c44e79a944fc0a76e0684fb92a1fd82a944543 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -43,7 +43,8 @@ typedef std::map<const SMDS_MeshElement*,
                  std::list<const SMDS_MeshElement*>, TIDCompare > TElemOfElemListMap;
 typedef std::map<const SMDS_MeshElement*,
                  std::list<const SMDS_MeshNode*>,    TIDCompare > TElemOfNodeListMap;
-typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*>      TNodeNodeMap;
+typedef std::map<const SMDS_MeshNode*,
+                 const SMDS_MeshNode*,               TIDCompare>  TNodeNodeMap;
 
 //!< Set of elements sorted by ID, to be used to assure predictability of edition
 typedef std::set< const SMDS_MeshElement*, TIDCompare >      TIDSortedElemSet;
@@ -72,6 +73,30 @@ namespace SMESHUtils
     TVECTOR v2( vec );
     vec.swap( v2 );
   }
+  /*!
+   * \brief Auto pointer
+   */
+  template <typename TOBJ>
+  struct Deleter
+  {
+    TOBJ* _obj;
+    Deleter( TOBJ* obj = (TOBJ*)NULL ): _obj( obj ) {}
+    ~Deleter() { delete _obj; _obj = 0; }
+  private:
+    Deleter( const Deleter& );
+  };
+  /*!
+   * \brief Auto pointer to array
+   */
+  template <typename TOBJ>
+  struct ArrayDeleter
+  {
+    TOBJ* _obj;
+    ArrayDeleter( TOBJ* obj ): _obj( obj ) {}
+    ~ArrayDeleter() { delete [] _obj; _obj = 0; }
+  private:
+    ArrayDeleter( const ArrayDeleter& );
+  };
 }
 
 //=======================================================================
@@ -159,7 +184,6 @@ class SMDS_MeshElement;
 
 typedef const SMDS_MeshElement* SMDS_MeshElementPtr;
 
-DEFINE_BASECOLLECTION (SMESH_BaseCollectionElemPtr, SMDS_MeshElementPtr)
 DEFINE_SEQUENCE (SMESH_SequenceOfElemPtr, SMESH_BaseCollectionElemPtr, SMDS_MeshElementPtr)
 
 
@@ -167,50 +191,7 @@ DEFINE_SEQUENCE (SMESH_SequenceOfElemPtr, SMESH_BaseCollectionElemPtr, SMDS_Mesh
 // class SMESH_SequenceOfNode
 typedef const SMDS_MeshNode* SMDS_MeshNodePtr;
 
-DEFINE_BASECOLLECTION (SMESH_BaseCollectionNodePtr, SMDS_MeshNodePtr)
 DEFINE_SEQUENCE(SMESH_SequenceOfNode,
                 SMESH_BaseCollectionNodePtr, SMDS_MeshNodePtr)
 
-// --------------------------------------------------------------------------------
-// #include "SMESHDS_DataMapOfShape.hxx"
-
-// #include <NCollection_DefineIndexedMap.hxx>
-
-// #include <TopoDS_Shape.hxx>
-
-///  Class SMESH_IndexedMapOfShape
-
-// DEFINE_BASECOLLECTION (SMESH_BaseCollectionShape, TopoDS_Shape)
-// DEFINE_INDEXEDMAP (SMESH_IndexedMapOfShape, SMESH_BaseCollectionShape, TopoDS_Shape)
-
-///  Class SMESH_IndexedDataMapOfShapeIndexedMapOfShape
-
-// DEFINE_BASECOLLECTION (SMESH_BaseCollectionIndexedMapOfShape, SMESH_IndexedMapOfShape)
-// DEFINE_INDEXEDDATAMAP (SMESH_IndexedDataMapOfShapeIndexedMapOfShape,
-//                        SMESH_BaseCollectionIndexedMapOfShape, TopoDS_Shape,
-//                        SMESH_IndexedMapOfShape)
-
-// --------------------------------------------------------------------------------
-// class SMESH_DataMapOfElemPtrSequenceOfElemPtr
-
-// SMESHUtils_EXPORT 
-// inline Standard_Integer HashCode(SMDS_MeshElementPtr theElem,
-//                                  const Standard_Integer theUpper)
-// {
-//   void* anElem = (void*) theElem;
-//   return HashCode(anElem,theUpper);
-// }
-
-// SMESHUtils_EXPORT 
-// 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