-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2010 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
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
-// File: GEOMAlgo_ShapeSet.cxx
-// Created:
-// Author: Peter KURNEV
+
+// File: GEOMAlgo_ShapeSet.cxx
+// Created:
+// Author: Peter KURNEV
//
#include <GEOMAlgo_ShapeSet.ixx>
//purpose :
//=======================================================================
void GEOMAlgo_ShapeSet::Add(const TopoDS_Shape& theShape,
- const TopAbs_ShapeEnum theType)
+ const TopAbs_ShapeEnum theType)
{
TopExp_Explorer aExp;
//
//=======================================================================
const TopTools_ListOfShape& GEOMAlgo_ShapeSet::GetSet()const
{
- /*
- TopTools_ListOfShape *pL;
- TopTools_MapIteratorOfMapOfOrientedShape aIt;
- //
- pL=(TopTools_ListOfShape *)&myList;
- pL->Clear();
- aIt.Initialize(myMap);
- for (; aIt.More(); aIt.Next()) {
- pL->Append(aIt.Key());
- }
- */
return myList;
}
//=======================================================================
if (aOr==TopAbs_FORWARD || aOr==TopAbs_REVERSED) {
bRet=myMap.Contains(aF);
if (!bRet) {
- break;
+ break;
}
}
}
//=======================================================================
void GEOMAlgo_ShapeSet::Subtract(const GEOMAlgo_ShapeSet& theOther)
{
- /*
- TopTools_MapIteratorOfMapOfOrientedShape aIt;
- //
- aIt.Initialize(theOther.myMap);
- for (; aIt.More(); aIt.Next()) {
- const TopoDS_Shape& aS=aIt.Key();
- myMap.Remove(aS);
- }
- */
- //
TopTools_ListIteratorOfListOfShape aIt;
TopTools_ListOfShape aLS;
//
const TopoDS_Shape& aS=aIt.Value();
if (!theOther.myMap.Contains(aS)) {
if(myMap.Add(aS)){
- aLS.Append(aS);
+ aLS.Append(aS);
}
}
}
//
myList=aLS;
}
+//modified by NIZNHY-PKV Wed Oct 28 13:51:36 2010f
+//=======================================================================
+//function : IsEqual
+//purpose :
+//=======================================================================
+ Standard_Boolean GEOMAlgo_ShapeSet::IsEqual(const GEOMAlgo_ShapeSet& theOther)const
+{
+ Standard_Boolean bRet;
+ Standard_Integer aNb1, aNb2;
+ TopAbs_Orientation aOr;
+ TopTools_ListIteratorOfListOfShape aIt;
+ //
+ bRet=Standard_True;
+ aNb1=myList.Extent();
+ const TopTools_ListOfShape& aLS2=theOther.GetSet();
+ aNb2=aLS2.Extent();
+ if (aNb1!=aNb2) {
+ return !bRet;
+ }
+ //
+ aIt.Initialize(myList);
+ for (; aIt.More(); aIt.Next()) {
+ const TopoDS_Shape& aS=aIt.Value();
+ if(!theOther.myMap.Contains(aS)) {
+ bRet=!bRet;
+ break;
+ }
+ }
+ return bRet;
+}
+//modified by NIZNHY-PKV Wed Oct 28 13:51:38 2010t