Panda3D

eggMorph.h

00001 // Filename: eggMorph.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 EGGMORPH_H
00016 #define EGGMORPH_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "namable.h"
00021 #include "luse.h"
00022 #include "pset.h"
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : EggMorph
00026 // Description : A single <Dxyz> or <Duv> or some such entry.  This
00027 //               simply contains the morph name and the offset value.
00028 //               The class EggMorph is actually a template class on
00029 //               the type of value that is being offset; the specific
00030 //               kinds of morphs are instantiated from this below.
00031 ////////////////////////////////////////////////////////////////////
00032 template<class Parameter>
00033 class EggMorph : public Namable {
00034 public:
00035   INLINE EggMorph(const string &name, const Parameter &offset);
00036   INLINE void set_offset(const Parameter &offset);
00037   INLINE const Parameter &get_offset() const;
00038 
00039   INLINE bool operator < (const EggMorph<Parameter> &other) const;
00040   INLINE bool operator == (const EggMorph<Parameter> &other) const;
00041   INLINE bool operator != (const EggMorph<Parameter> &other) const;
00042 
00043   INLINE int compare_to(const EggMorph<Parameter> &other, double threshold) const;
00044 
00045   INLINE void output(ostream &out, const string &tag,
00046                      int num_dimensions) const;
00047 
00048 private:
00049   Parameter _offset;
00050 };
00051 
00052 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorph<LVector3d>);
00053 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorph<LVector4>);
00054 
00055 typedef EggMorph<LVector3d> EggMorphVertex;
00056 typedef EggMorph<LVector3d> EggMorphNormal;
00057 typedef EggMorph<LVector3d> EggMorphTexCoord;
00058 typedef EggMorph<LVector4> EggMorphColor;
00059 
00060 #include "eggMorph.I"
00061 
00062 #endif
 All Classes Functions Variables Enumerations