Panda3D
eggMorphList.h
1 // Filename: eggMorphList.h
2 // Created by: drose (29Jan99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef EGGMORPHLIST_H
16 #define EGGMORPHLIST_H
17 
18 #include "pandabase.h"
19 
20 #include "eggMorph.h"
21 
22 #include "indent.h"
23 
24 #include "epvector.h"
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : EggMorphList
28 // Description : A collection of <Dxyz>'s or <Duv>'s or some such.
29 ////////////////////////////////////////////////////////////////////
30 template<class MorphType>
31 class EggMorphList {
32 private:
33  typedef epvector<MorphType> Morphs;
34 
35 public:
36  typedef TYPENAME Morphs::iterator iterator;
37  typedef TYPENAME Morphs::const_iterator const_iterator;
38  typedef TYPENAME Morphs::size_type size_type;
39 
40  INLINE EggMorphList();
41  INLINE EggMorphList(const EggMorphList<MorphType> &copy);
42  INLINE void operator = (const EggMorphList<MorphType> &copy);
43  INLINE ~EggMorphList();
44 
45  INLINE bool operator == (const EggMorphList<MorphType> &other) const;
46  INLINE bool operator != (const EggMorphList<MorphType> &other) const;
47  INLINE bool operator < (const EggMorphList<MorphType> &other) const;
48  int compare_to(const EggMorphList<MorphType> &other, double threshold) const;
49 
50  INLINE iterator begin();
51  INLINE const_iterator begin() const;
52  INLINE iterator end();
53  INLINE const_iterator end() const;
54 
55  INLINE size_type size() const;
56  INLINE bool empty() const;
57 
58  pair<iterator, bool> insert(const MorphType &value);
59  INLINE void clear();
60 
61  void write(ostream &out, int indent_level,
62  const string &tag, int num_dimensions) const;
63 
64 private:
65  Morphs _morphs;
66 };
67 
72 
73 #include "eggMorphList.I"
74 
75 #endif
pair< iterator, bool > insert(const MorphType &value)
This is similar to the insert() interface for sets, except it does not guarantee that the resulting l...
Definition: eggMorphList.I:193
void clear()
Empties the list of morphs.
Definition: eggMorphList.I:219
A collection of <Dxyz>&#39;s or <Duv>&#39;s or some such.
Definition: eggMorphList.h:31
int compare_to(const EggMorphList< MorphType > &other, double threshold) const
compare_to() compares a different space than the operator methods, which only check the morph&#39;s name...
Definition: eggMorphList.I:101