Panda3D
|
00001 // Filename: eggMesherFanMaker.I 00002 // Created by: drose (22Mar05) 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 00016 //////////////////////////////////////////////////////////////////// 00017 // Function: EggMesherFanMaker::operator < 00018 // Access: Public 00019 // Description: Provides a unique ordering between different fan 00020 // makers based on the leading edge. 00021 //////////////////////////////////////////////////////////////////// 00022 INLINE bool EggMesherFanMaker:: 00023 operator < (const EggMesherFanMaker &other) const { 00024 nassertr(!_edges.empty() && !other._edges.empty(), false); 00025 return _edges.front() < other._edges.front(); 00026 } 00027 00028 //////////////////////////////////////////////////////////////////// 00029 // Function: EggMesherFanMaker::operator != 00030 // Access: Public 00031 // Description: Provides a unique ordering between different fan 00032 // makers based on the leading edge. 00033 //////////////////////////////////////////////////////////////////// 00034 INLINE bool EggMesherFanMaker:: 00035 operator != (const EggMesherFanMaker &other) const { 00036 return !operator == (other); 00037 } 00038 00039 //////////////////////////////////////////////////////////////////// 00040 // Function: EggMesherFanMaker::operator == 00041 // Access: Public 00042 // Description: Provides a unique ordering between different fan 00043 // makers based on the leading edge. 00044 //////////////////////////////////////////////////////////////////// 00045 INLINE bool EggMesherFanMaker:: 00046 operator == (const EggMesherFanMaker &other) const { 00047 return _edges.front() == other._edges.front(); 00048 } 00049 00050 //////////////////////////////////////////////////////////////////// 00051 // Function: EggMesherFanMaker::is_empty 00052 // Access: Public 00053 // Description: Returns true if the fan maker has no edges, false 00054 // otherwise. 00055 //////////////////////////////////////////////////////////////////// 00056 INLINE bool EggMesherFanMaker:: 00057 is_empty() const { 00058 return (_edges.empty()); 00059 } 00060 00061 //////////////////////////////////////////////////////////////////// 00062 // Function: EggMesherFanMaker::is_valid 00063 // Access: Public 00064 // Description: Returns true if the fan maker has enough edges to 00065 // define at least one fan, false otherwise. 00066 //////////////////////////////////////////////////////////////////// 00067 INLINE bool EggMesherFanMaker:: 00068 is_valid() const { 00069 return (_edges.size() > 2); 00070 } 00071 00072 //////////////////////////////////////////////////////////////////// 00073 // Function: EggMesherFanMaker::is_coplanar_with 00074 // Access: Public 00075 // Description: Returns true if the strip and the other strip are 00076 // coplanar. 00077 //////////////////////////////////////////////////////////////////// 00078 INLINE bool EggMesherFanMaker:: 00079 is_coplanar_with(const EggMesherFanMaker &other) const { 00080 return _planar && other._planar && 00081 _strips.front()->is_coplanar_with(*other._strips.front(), 00082 egg_coplanar_threshold); 00083 } 00084 00085 INLINE ostream & 00086 operator << (ostream &out, const EggMesherFanMaker &fm) { 00087 fm.output(out); 00088 return out; 00089 }