00001 // Wild Magic Source Code 00002 // David Eberly 00003 // http://www.geometrictools.com 00004 // Copyright (c) 1998-2007 00005 // 00006 // This library is free software; you can redistribute it and/or modify it 00007 // under the terms of the GNU Lesser General Public License as published by 00008 // the Free Software Foundation; either version 2.1 of the License, or (at 00009 // your option) any later version. The license is available for reading at 00010 // either of the locations: 00011 // http://www.gnu.org/copyleft/lgpl.html 00012 // http://www.geometrictools.com/License/WildMagicLicense.pdf 00013 // The license applies to versions 0 through 4 of Wild Magic. 00014 // 00015 // Version: 4.0.0 (2006/06/28) 00016 00017 namespace Wm4 00018 { 00019 //---------------------------------------------------------------------------- 00020 inline EdgeKey::EdgeKey (int iV0, int iV1) 00021 { 00022 if (iV0 < iV1) 00023 { 00024 // v0 is minimum 00025 V[0] = iV0; 00026 V[1] = iV1; 00027 } 00028 else 00029 { 00030 // v1 is minimum 00031 V[0] = iV1; 00032 V[1] = iV0; 00033 } 00034 } 00035 //---------------------------------------------------------------------------- 00036 inline bool EdgeKey::operator< (const EdgeKey& rkKey) const 00037 { 00038 if (V[1] < rkKey.V[1]) 00039 { 00040 return true; 00041 } 00042 00043 if (V[1] > rkKey.V[1]) 00044 { 00045 return false; 00046 } 00047 00048 return V[0] < rkKey.V[0]; 00049 } 00050 //---------------------------------------------------------------------------- 00051 inline EdgeKey::operator size_t () const 00052 { 00053 return V[0] | (V[1] << 16); 00054 } 00055 //---------------------------------------------------------------------------- 00056 } //namespace Wm4