Panda3D
|
00001 // Filename: eggVertexAux.cxx 00002 // Created by: jenes (15Nov11) 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 "eggVertexAux.h" 00016 #include "eggParameters.h" 00017 00018 #include "indent.h" 00019 00020 TypeHandle EggVertexAux::_type_handle; 00021 00022 //////////////////////////////////////////////////////////////////// 00023 // Function: EggVertexAux::Constructor 00024 // Access: Published 00025 // Description: 00026 //////////////////////////////////////////////////////////////////// 00027 EggVertexAux:: 00028 EggVertexAux(const string &name, const LVecBase4d &aux) : 00029 EggNamedObject(name), 00030 _aux(aux) 00031 { 00032 } 00033 00034 //////////////////////////////////////////////////////////////////// 00035 // Function: EggVertexAux::Copy Constructor 00036 // Access: Published 00037 // Description: 00038 //////////////////////////////////////////////////////////////////// 00039 EggVertexAux:: 00040 EggVertexAux(const EggVertexAux ©) : 00041 EggNamedObject(copy), 00042 _aux(copy._aux) 00043 { 00044 } 00045 00046 //////////////////////////////////////////////////////////////////// 00047 // Function: EggVertexAux::Copy Assignment Operator 00048 // Access: Published 00049 // Description: 00050 //////////////////////////////////////////////////////////////////// 00051 EggVertexAux &EggVertexAux:: 00052 operator = (const EggVertexAux ©) { 00053 EggNamedObject::operator = (copy); 00054 _aux = copy._aux; 00055 00056 return (*this); 00057 } 00058 00059 //////////////////////////////////////////////////////////////////// 00060 // Function: EggVertexAux::Destructor 00061 // Access: Published, Virtual 00062 // Description: 00063 //////////////////////////////////////////////////////////////////// 00064 EggVertexAux:: 00065 ~EggVertexAux() { 00066 } 00067 00068 //////////////////////////////////////////////////////////////////// 00069 // Function: EggVertexAux::write 00070 // Access: Public 00071 // Description: 00072 //////////////////////////////////////////////////////////////////// 00073 void EggVertexAux:: 00074 write(ostream &out, int indent_level) const { 00075 string inline_name = get_name(); 00076 if (!inline_name.empty()) { 00077 inline_name += ' '; 00078 } 00079 indent(out, indent_level) 00080 << "<Aux> " << inline_name << "{ " << get_aux() << " }\n"; 00081 } 00082 00083 //////////////////////////////////////////////////////////////////// 00084 // Function: EggVertexAux::compare_to 00085 // Access: Public 00086 // Description: An ordering operator to compare two vertices for 00087 // sorting order. This imposes an arbitrary ordering 00088 // useful to identify unique vertices. 00089 //////////////////////////////////////////////////////////////////// 00090 int EggVertexAux:: 00091 compare_to(const EggVertexAux &other) const { 00092 int compare; 00093 compare = _aux.compare_to(other._aux, egg_parameters->_pos_threshold); 00094 if (compare != 0) { 00095 return compare; 00096 } 00097 00098 return 0; 00099 }