// Created by: Peter KURNEV // Copyright (c) 2010-2014 OPEN CASCADE SAS // 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 // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. static inline Standard_Integer NormalizedId(const Standard_Integer aId, const Standard_Integer aDiv); static inline void SortShell(const Standard_Integer n, Standard_Integer* a); //======================================================================= //function : //purpose : //======================================================================= inline BOPDS_PassKey::BOPDS_PassKey() { myAllocator=NCollection_BaseAllocator::CommonBaseAllocator(); myPtr=NULL; Clear(); } //======================================================================= //function : //purpose : //======================================================================= inline BOPDS_PassKey::BOPDS_PassKey(const Handle(NCollection_BaseAllocator)& theAllocator) { myAllocator=theAllocator; myPtr=NULL; Clear(); } //======================================================================= //function : //purpose : //======================================================================= inline BOPDS_PassKey::BOPDS_PassKey(const BOPDS_PassKey& theOther) : myPtr(0) { (*this) = theOther; } //======================================================================= //function :operator = //purpose : //======================================================================= inline BOPDS_PassKey& BOPDS_PassKey::operator =(const BOPDS_PassKey& aOther) { Clear(); // myAllocator=aOther.myAllocator; myNbIds=aOther.myNbIds; mySum=aOther.mySum; // if (myNbIds) { myPtr=Allocate(myNbIds); for (int i=0; iAllocate(theSize*sizeof(Standard_Integer)); return pPtr; } //======================================================================= //function :Clear //purpose : //======================================================================= inline void BOPDS_PassKey::Clear() { myNbIds=0; mySum=0; if (myPtr) { myAllocator->Free(myPtr); myPtr=NULL; } } //======================================================================= //function :SetIds //purpose : //======================================================================= inline void BOPDS_PassKey::SetIds(const Standard_Integer aId1) { Clear(); myNbIds=1; myPtr=Allocate(myNbIds); myPtr[0]=aId1; mySum=NormalizedId(aId1, myNbIds); } //======================================================================= //function :SetIds //purpose : //======================================================================= inline void BOPDS_PassKey::SetIds(const Standard_Integer aId1, const Standard_Integer aId2) { Clear(); // myNbIds=2; myPtr=Allocate(myNbIds); // if (aId1myNbIds-1) { return -1; } return myPtr[aIndex]; } //======================================================================= //function :Ids //purpose : //======================================================================= inline void BOPDS_PassKey::Ids(Standard_Integer& aId1, Standard_Integer& aId2) const { aId1=0; aId2=0; if (myNbIds>1) { aId1=myPtr[0]; aId2=myPtr[1]; } } //======================================================================= //function :IsEqual //purpose : //======================================================================= inline Standard_Boolean BOPDS_PassKey::IsEqual(const BOPDS_PassKey& aOther) const { Standard_Boolean bRet; Standard_Integer i; // bRet=Standard_False; // if (myNbIds!=aOther.myNbIds) { return bRet; } for (i=0; iaTresh) { aIdRet=aId%aTresh; } return aIdRet; } //======================================================================= // function: SortShell // purpose : //======================================================================= inline void SortShell(const Standard_Integer n, Standard_Integer* a) { Standard_Integer nd, i, j, l, d=1; Standard_Integer x; // while(d<=n) { d*=2; } // while (d) { d=(d-1)/2; // nd=n-d; for (i=0; i -1) { goto m30; } }//if (a[l] < a[j]){ }//for (i=0; i