Panda3D
|
00001 // Filename: dxfVertex.cxx 00002 // Created by: drose (04May04) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "dxfVertex.h" 00016 00017 //////////////////////////////////////////////////////////////////// 00018 // Function: DXFVertex::Ordering operator 00019 // Access: Public 00020 // Description: This defines a unique ordering for vertices so that 00021 // the DXFVertexMap can group identical vertices 00022 // together. 00023 //////////////////////////////////////////////////////////////////// 00024 int DXFVertex:: 00025 operator < (const DXFVertex &other) const { 00026 if (fabs(_p[0] - other._p[0]) > 0.0001) { 00027 return _p[0] < other._p[0]; 00028 } else if (fabs(_p[1] - other._p[1]) > 0.0001) { 00029 return _p[1] < other._p[1]; 00030 } else if (fabs(_p[2] - other._p[2]) > 0.0001) { 00031 return _p[2] < other._p[2]; 00032 } 00033 00034 return false; 00035 } 00036