Salome HOME
Added help page and revert some changes for a better ergonomy
[modules/geom.git] / src / NMTDS / NMTDS_InterfPool.cxx
index d601d5cd8adbae3c4cb46e8bbfbd65ce6eb95fba..a4b6132dfb355b2e75eb9b2bc17370f5c750e20f 100644 (file)
@@ -1,34 +1,32 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  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
+// 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 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.
 //
-//  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// File:       NMTDS_.InterfPoolcxx
-// Created:    Wed Feb 21 10:35:35 2007
-// Author:     Peter KURNEV
-//             <pkv@irinox>
+// 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+// File:        NMTDS_InterfPool.cxx
+// Author:      Peter KURNEV
+
 #include <NMTDS_InterfPool.ixx>
-#include <NMTDS_PassKeyBoolean.hxx>
-#include <NMTDS_ListOfPassKeyBoolean.hxx>
-#include <NMTDS_MapIteratorOfMapOfPassKeyBoolean.hxx>
-#include <NMTDS_ListIteratorOfListOfPassKeyBoolean.hxx>
+
+#include <NMTDS_PairBoolean.hxx>
+#include <NMTDS_ListOfPairBoolean.hxx>
+#include <NMTDS_MapIteratorOfMapOfPairBoolean.hxx>
+#include <NMTDS_ListIteratorOfListOfPairBoolean.hxx>
+
+#include <Basics_OCCTVersion.hxx>
 
 static
   Standard_Integer TypeToInteger(const NMTDS_InterfType aType);
@@ -37,7 +35,7 @@ static
 //function : 
 //purpose  : 
 //=======================================================================
-  NMTDS_InterfPool::NMTDS_InterfPool()
+NMTDS_InterfPool::NMTDS_InterfPool()
 {
   myMaxInd=6;
 }
@@ -52,8 +50,8 @@ static
 //function : Add
 //purpose  : 
 //=======================================================================
-  Standard_Boolean NMTDS_InterfPool::Add (const NMTDS_PassKeyBoolean& aPKB,
-                                         const NMTDS_InterfType aType)
+Standard_Boolean NMTDS_InterfPool::Add (const NMTDS_PairBoolean& aPKB,
+                                       const NMTDS_InterfType aType)
 {
   Standard_Boolean bRet;
   Standard_Integer iType;
@@ -70,11 +68,11 @@ static
 //function : Add
 //purpose  : 
 //=======================================================================
-  Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
-                                         const Standard_Integer aInd2,
-                                         const NMTDS_InterfType aType)
+Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
+                                       const Standard_Integer aInd2,
+                                       const NMTDS_InterfType aType)
 {
-  NMTDS_PassKeyBoolean aPKB;
+  NMTDS_PairBoolean aPKB;
   //
   aPKB.SetIds(aInd1, aInd2);
   return Add(aPKB, aType);
@@ -83,12 +81,12 @@ static
 //function : Add
 //purpose  : 
 //=======================================================================
-  Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
-                                         const Standard_Integer aInd2,
-                                         const Standard_Boolean bFlag,
-                                         const NMTDS_InterfType aType)
+Standard_Boolean NMTDS_InterfPool::Add (const Standard_Integer aInd1,
+                                       const Standard_Integer aInd2,
+                                       const Standard_Boolean bFlag,
+                                       const NMTDS_InterfType aType)
 {
-  NMTDS_PassKeyBoolean aPKB;
+  NMTDS_PairBoolean aPKB;
   //
   aPKB.SetIds(aInd1, aInd2);
   aPKB.SetFlag(bFlag);
@@ -98,7 +96,7 @@ static
 //function : Contains 
 //purpose  : 
 //=======================================================================
-  Standard_Boolean NMTDS_InterfPool::Contains(const NMTDS_PassKeyBoolean& aPKB)const
+Standard_Boolean NMTDS_InterfPool::Contains(const NMTDS_PairBoolean& aPKB)const
 {
   Standard_Boolean bRet;
   Standard_Integer i;
@@ -116,9 +114,9 @@ static
 //purpose  : 
 //=======================================================================
   Standard_Boolean NMTDS_InterfPool::Contains(const Standard_Integer aInd1,
-                                             const Standard_Integer aInd2)const
+                                              const Standard_Integer aInd2)const
 {
-  NMTDS_PassKeyBoolean aPKB;
+  NMTDS_PairBoolean aPKB;
   //
   aPKB.SetIds(aInd1, aInd2);
   return Contains(aPKB);
@@ -127,20 +125,20 @@ static
 //function :  Get
 //purpose  : 
 //=======================================================================
-  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get()const
+const NMTDS_ListOfPairBoolean& NMTDS_InterfPool::Get()const
 {
   Standard_Integer i;
-  NMTDS_ListOfPassKeyBoolean* pL;
+  NMTDS_ListOfPairBoolean* pL;
   //
-  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL=(NMTDS_ListOfPairBoolean*)&myList;
   pL->Clear();
   //
   for (i=0; i<myMaxInd; ++i) {
-    NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+    NMTDS_MapIteratorOfMapOfPairBoolean aIt;
     //
     aIt.Initialize(myTable[i]);
     for(; aIt.More(); aIt.Next()) {
-      const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+      const NMTDS_PairBoolean& aPKB=aIt.Key();
       pL->Append(aPKB);
     }
   }
@@ -150,23 +148,24 @@ static
 //function :  Get
 //purpose  : 
 //=======================================================================
-  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd)const
+const NMTDS_ListOfPairBoolean& NMTDS_InterfPool::Get
+  (const Standard_Integer aInd)const
 {
   Standard_Integer i, n1, n2;
-  NMTDS_ListOfPassKeyBoolean* pL;
+  NMTDS_ListOfPairBoolean* pL;
   //
-  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL=(NMTDS_ListOfPairBoolean*)&myList;
   pL->Clear();
   //
   for (i=0; i<myMaxInd; ++i) {
-    NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+    NMTDS_MapIteratorOfMapOfPairBoolean aIt;
     //
     aIt.Initialize(myTable[i]);
     for(; aIt.More(); aIt.Next()) {
-      const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+      const NMTDS_PairBoolean& aPKB=aIt.Key();
       aPKB.Ids(n1, n2);
       if(n1==aInd || n2==aInd) {
-       pL->Append(aPKB);
+        pL->Append(aPKB);
       }
     }
   }
@@ -176,21 +175,22 @@ static
 //function :  Get
 //purpose  : 
 //=======================================================================
-  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const NMTDS_InterfType aType)const
+const NMTDS_ListOfPairBoolean& NMTDS_InterfPool::Get
+  (const NMTDS_InterfType aType)const
 {
   Standard_Integer iType;
-  NMTDS_ListOfPassKeyBoolean* pL;
+  NMTDS_ListOfPairBoolean* pL;
   //
-  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL=(NMTDS_ListOfPairBoolean*)&myList;
   pL->Clear();
   //
   iType=TypeToInteger(aType);
   if (iType>-1 && iType<myMaxInd) {
-    NMTDS_MapIteratorOfMapOfPassKeyBoolean aIt;
+    NMTDS_MapIteratorOfMapOfPairBoolean aIt;
     //
     aIt.Initialize(myTable[iType]);
     for(; aIt.More(); aIt.Next()) {
-      const NMTDS_PassKeyBoolean& aPKB=aIt.Key();
+      const NMTDS_PairBoolean& aPKB=aIt.Key();
       pL->Append(aPKB);
     }
   }
@@ -200,21 +200,22 @@ static
 //function :  Get
 //purpose  : 
 //=======================================================================
-  const NMTDS_ListOfPassKeyBoolean& NMTDS_InterfPool::Get(const Standard_Integer aInd,
-                                                         const NMTDS_InterfType aType)const
+const NMTDS_ListOfPairBoolean& NMTDS_InterfPool::Get
+  (const Standard_Integer aInd,
+   const NMTDS_InterfType aType)const
 {
   Standard_Integer n1, n2;
-  NMTDS_ListOfPassKeyBoolean *pL, aLPKB;
-  NMTDS_ListIteratorOfListOfPassKeyBoolean aIt;
+  NMTDS_ListOfPairBoolean *pL, aLPKB;
+  NMTDS_ListIteratorOfListOfPairBoolean aIt;
   //
   aLPKB=Get(aType);
   //
-  pL=(NMTDS_ListOfPassKeyBoolean*)&myList;
+  pL=(NMTDS_ListOfPairBoolean*)&myList;
   pL->Clear();
   //
   aIt.Initialize (aLPKB);
   for (; aIt.More(); aIt.Next()) {
-    const NMTDS_PassKeyBoolean& aPKB=aIt.Value();
+    const NMTDS_PairBoolean& aPKB=aIt.Value();
     aPKB.Ids(n1, n2);
     if(n1==aInd || n2==aInd) {
       pL->Append(aPKB);
@@ -227,7 +228,7 @@ static
 //function : SSInterferences
 //purpose  : 
 //===========================================================================
-  BOPTools_CArray1OfSSInterference&  NMTDS_InterfPool::SSInterferences()
+BOPTools_CArray1OfSSInterference&  NMTDS_InterfPool::SSInterferences()
 {
   return mySSInterferences;
 }
@@ -235,7 +236,7 @@ static
 //function : ESInterferences
 //purpose  : 
 //===========================================================================
-  BOPTools_CArray1OfESInterference&  NMTDS_InterfPool::ESInterferences()
+BOPTools_CArray1OfESInterference&  NMTDS_InterfPool::ESInterferences()
 {
   return myESInterferences;
 }
@@ -243,7 +244,7 @@ static
 //function : VSInterferences
 //purpose  : 
 //===========================================================================
-  BOPTools_CArray1OfVSInterference&  NMTDS_InterfPool::VSInterferences()
+BOPTools_CArray1OfVSInterference&  NMTDS_InterfPool::VSInterferences()
 {
   return myVSInterferences;
 }
@@ -251,7 +252,7 @@ static
 //function : EEInterferences
 //purpose  : 
 //===========================================================================
-  BOPTools_CArray1OfEEInterference&  NMTDS_InterfPool::EEInterferences()
+BOPTools_CArray1OfEEInterference&  NMTDS_InterfPool::EEInterferences()
 {
   return myEEInterferences;
 }
@@ -259,7 +260,7 @@ static
 //function : VEInterferences
 //purpose  : 
 //===========================================================================
-  BOPTools_CArray1OfVEInterference&  NMTDS_InterfPool::VEInterferences()
+BOPTools_CArray1OfVEInterference&  NMTDS_InterfPool::VEInterferences()
 {
   return myVEInterferences;
 }
@@ -267,11 +268,29 @@ static
 //function : VVInterferences
 //purpose  : 
 //===========================================================================
-  BOPTools_CArray1OfVVInterference&  NMTDS_InterfPool::VVInterferences()
+BOPTools_CArray1OfVVInterference&  NMTDS_InterfPool::VVInterferences()
 {
   return myVVInterferences;
 }
-////////////////////
+
+//modified by NIZNHY-PKV Mon Dec 12 09:07:54 2011f
+//=======================================================================
+//function : Purge
+//purpose  : 
+//=======================================================================
+void NMTDS_InterfPool::Purge()
+{
+#if OCC_VERSION_LARGE > 0x06050200
+  myVVInterferences.Purge();
+  myVEInterferences.Purge();
+  myEEInterferences.Purge();
+  myVSInterferences.Purge();
+  myESInterferences.Purge();
+  mySSInterferences.Purge();
+#endif
+}
+//modified by NIZNHY-PKV Mon Dec 12 09:07:58 2011t
+
 //=======================================================================
 //function : TypeToInteger
 //purpose  :