Panda3D
|
00001 // Filename: eggMorphList.h 00002 // Created by: drose (29Jan99) 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 #ifndef EGGMORPHLIST_H 00016 #define EGGMORPHLIST_H 00017 00018 #include "pandabase.h" 00019 00020 #include "eggMorph.h" 00021 00022 #include "indent.h" 00023 00024 #include "pvector.h" 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : EggMorphList 00028 // Description : A collection of <Dxyz>'s or <Duv>'s or some such. 00029 //////////////////////////////////////////////////////////////////// 00030 template<class MorphType> 00031 class EggMorphList { 00032 private: 00033 typedef epvector<MorphType> Morphs; 00034 00035 public: 00036 typedef TYPENAME Morphs::iterator iterator; 00037 typedef TYPENAME Morphs::const_iterator const_iterator; 00038 typedef TYPENAME Morphs::size_type size_type; 00039 00040 INLINE EggMorphList(); 00041 INLINE EggMorphList(const EggMorphList<MorphType> ©); 00042 INLINE void operator = (const EggMorphList<MorphType> ©); 00043 INLINE ~EggMorphList(); 00044 00045 INLINE bool operator == (const EggMorphList<MorphType> &other) const; 00046 INLINE bool operator != (const EggMorphList<MorphType> &other) const; 00047 INLINE bool operator < (const EggMorphList<MorphType> &other) const; 00048 int compare_to(const EggMorphList<MorphType> &other, double threshold) const; 00049 00050 INLINE iterator begin(); 00051 INLINE const_iterator begin() const; 00052 INLINE iterator end(); 00053 INLINE const_iterator end() const; 00054 00055 INLINE size_type size() const; 00056 INLINE bool empty() const; 00057 00058 pair<iterator, bool> insert(const MorphType &value); 00059 INLINE void clear(); 00060 00061 void write(ostream &out, int indent_level, 00062 const string &tag, int num_dimensions) const; 00063 00064 private: 00065 Morphs _morphs; 00066 }; 00067 00068 typedef EggMorphList<EggMorphVertex> EggMorphVertexList; 00069 typedef EggMorphList<EggMorphNormal> EggMorphNormalList; 00070 typedef EggMorphList<EggMorphTexCoord> EggMorphTexCoordList; 00071 typedef EggMorphList<EggMorphColor> EggMorphColorList; 00072 00073 #include "eggMorphList.I" 00074 00075 #endif