00001 // Filename: eggMorphList.h 00002 // Created by: drose (29Jan99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef EGGMORPHLIST_H 00020 #define EGGMORPHLIST_H 00021 00022 #include <pandabase.h> 00023 00024 #include "eggMorph.h" 00025 00026 #include <indent.h> 00027 00028 #include "pvector.h" 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Class : EggMorphList 00032 // Description : A collection of <Dxyz>'s or <Duv>'s or some such. 00033 //////////////////////////////////////////////////////////////////// 00034 template<class MorphType> 00035 class EggMorphList { 00036 private: 00037 typedef pvector<MorphType> Morphs; 00038 00039 public: 00040 typedef TYPENAME Morphs::iterator iterator; 00041 typedef TYPENAME Morphs::const_iterator const_iterator; 00042 typedef TYPENAME Morphs::size_type size_type; 00043 00044 INLINE EggMorphList(); 00045 INLINE EggMorphList(const EggMorphList<MorphType> ©); 00046 INLINE void operator = (const EggMorphList<MorphType> ©); 00047 INLINE ~EggMorphList(); 00048 00049 INLINE bool operator == (const EggMorphList<MorphType> &other) const; 00050 INLINE bool operator != (const EggMorphList<MorphType> &other) const; 00051 INLINE bool operator < (const EggMorphList<MorphType> &other) const; 00052 00053 INLINE iterator begin(); 00054 INLINE const_iterator begin() const; 00055 INLINE iterator end(); 00056 INLINE const_iterator end() const; 00057 00058 INLINE size_type size() const; 00059 INLINE bool empty() const; 00060 00061 pair<iterator, bool> insert(const MorphType &value); 00062 INLINE void clear(); 00063 00064 void write(ostream &out, int indent_level) const; 00065 00066 private: 00067 Morphs _morphs; 00068 }; 00069 00070 // Export all of the vectors. 00071 00072 #define EXPCL EXPCL_PANDAEGG 00073 #define EXPTP EXPTP_PANDAEGG 00074 #define TYPE LVector3d 00075 #define NAME vector_LVector3d 00076 #include <vector_src.h> 00077 00078 #define EXPCL EXPCL_PANDAEGG 00079 #define EXPTP EXPTP_PANDAEGG 00080 #define TYPE LVector2d 00081 #define NAME vector_LVector2d 00082 #include <vector_src.h> 00083 00084 #define EXPCL EXPCL_PANDAEGG 00085 #define EXPTP EXPTP_PANDAEGG 00086 #define TYPE LVector4f 00087 #define NAME vector_LVector4f 00088 #include <vector_src.h> 00089 00090 // Now export each EggMorphList. 00091 00092 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorphList<LVector3d>) 00093 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorphList<LVector2d>) 00094 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorphList<LVector4f>) 00095 00096 typedef EggMorphList<EggMorphVertex> EggMorphVertexList; 00097 typedef EggMorphList<EggMorphNormal> EggMorphNormalList; 00098 typedef EggMorphList<EggMorphTexCoord> EggMorphTexCoordList; 00099 typedef EggMorphList<EggMorphColor> EggMorphColorList; 00100 00101 #include "eggMorphList.I" 00102 00103 #endif