Panda3D
eggMorph.h
1 // Filename: eggMorph.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 EGGMORPH_H
16 #define EGGMORPH_H
17 
18 #include "pandabase.h"
19 
20 #include "namable.h"
21 #include "luse.h"
22 #include "pset.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : EggMorph
26 // Description : A single <Dxyz> or <Duv> or some such entry. This
27 // simply contains the morph name and the offset value.
28 // The class EggMorph is actually a template class on
29 // the type of value that is being offset; the specific
30 // kinds of morphs are instantiated from this below.
31 ////////////////////////////////////////////////////////////////////
32 template<class Parameter>
33 class EggMorph : public Namable {
34 public:
35  INLINE EggMorph(const string &name, const Parameter &offset);
36  INLINE void set_offset(const Parameter &offset);
37  INLINE const Parameter &get_offset() const;
38 
39  INLINE bool operator < (const EggMorph<Parameter> &other) const;
40  INLINE bool operator == (const EggMorph<Parameter> &other) const;
41  INLINE bool operator != (const EggMorph<Parameter> &other) const;
42 
43  INLINE int compare_to(const EggMorph<Parameter> &other, double threshold) const;
44 
45  INLINE void output(ostream &out, const string &tag,
46  int num_dimensions) const;
47 
48 private:
49  Parameter _offset;
50 };
51 
52 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorph<LVector3d>);
53 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorph<LVector4>);
54 
59 
60 #include "eggMorph.I"
61 
62 #endif
int compare_to(const EggMorph< Parameter > &other, double threshold) const
compare_to() compares a different space than the operator methods, which only check the name...
Definition: eggMorph.I:96
A single <Dxyz> or <Duv> or some such entry.
Definition: eggMorph.h:33
A base class for all things which can have a name.
Definition: namable.h:29