1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // File: GEOMAlgo_PassKeyShape.cxx
22 // Author: Peter KURNEV
26 #include <GEOMAlgo_PassKeyShape.ixx>
31 #include <TopTools_ListIteratorOfListOfShape.hxx>
32 #include <TColStd_ListOfInteger.hxx>
34 //=======================================================================
37 //=======================================================================
38 GEOMAlgo_PassKeyShape::GEOMAlgo_PassKeyShape()
43 GEOMAlgo_PassKey::Clear();
45 //=======================================================================
48 //=======================================================================
49 void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1)
52 Standard_Integer anId1;
54 anId1=aS1.HashCode(myUpper);
55 GEOMAlgo_PassKey::SetIds(anId1);
57 //=======================================================================
60 //=======================================================================
61 void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1,
62 const TopoDS_Shape& aS2)
64 Standard_Integer anId1, anId2;
66 anId1=aS1.HashCode(myUpper);
67 anId2=aS2.HashCode(myUpper);
69 GEOMAlgo_PassKey::SetIds(anId1, anId2);
71 //=======================================================================
74 //=======================================================================
75 void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1,
76 const TopoDS_Shape& aS2,
77 const TopoDS_Shape& aS3)
79 Standard_Integer anId1, anId2, anId3;
81 anId1=aS1.HashCode(myUpper);
82 anId2=aS2.HashCode(myUpper);
83 anId3=aS3.HashCode(myUpper);
85 GEOMAlgo_PassKey::SetIds(anId1, anId2, anId3);
87 //=======================================================================
90 //=======================================================================
91 void GEOMAlgo_PassKeyShape::SetIds(const TopoDS_Shape& aS1,
92 const TopoDS_Shape& aS2,
93 const TopoDS_Shape& aS3,
94 const TopoDS_Shape& aS4)
96 Standard_Integer anId1, anId2, anId3, anId4;
98 anId1=aS1.HashCode(myUpper);
99 anId2=aS2.HashCode(myUpper);
100 anId3=aS3.HashCode(myUpper);
101 anId4=aS4.HashCode(myUpper);
103 GEOMAlgo_PassKey::SetIds(anId1, anId2, anId3, anId4);
105 //=======================================================================
108 //=======================================================================
109 void GEOMAlgo_PassKeyShape::SetIds(const TopTools_ListOfShape& aLS)
111 Standard_Integer anId;
112 TopTools_ListIteratorOfListOfShape aIt;
113 TColStd_ListOfInteger aLI;
116 //if (aNb<1 || aNb > myNbMax) {
125 for (; aIt.More(); aIt.Next()) {
126 const TopoDS_Shape& aS=aIt.Value();
127 anId=aS.HashCode(myUpper);
130 GEOMAlgo_PassKey::SetIds(aLI);