Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/egg/eggMorph.h

Go to the documentation of this file.
00001 // Filename: eggMorph.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 EGGMORPH_H
00020 #define EGGMORPH_H
00021 
00022 #include <pandabase.h>
00023 
00024 #include <namable.h>
00025 #include <luse.h>
00026 #include "pset.h"
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //       Class : EggMorph
00030 // Description : A single <Dxyz> or <Duv> or some such entry.  This
00031 //               simply contains the morph name and the offset value.
00032 //               The class EggMorph is actually a template class on
00033 //               the type of value that is being offset; the specific
00034 //               kinds of morphs are instantiated from this below.
00035 ////////////////////////////////////////////////////////////////////
00036 template<class Parameter>
00037 class EggMorph : public Namable {
00038 public:
00039   INLINE EggMorph(const string &name, const Parameter &offset);
00040   INLINE void set_offset(const Parameter &offset);
00041   INLINE const Parameter &get_offset() const;
00042 
00043   INLINE bool operator < (const EggMorph<Parameter> &other) const;
00044   INLINE bool operator == (const EggMorph<Parameter> &other) const;
00045   INLINE bool operator != (const EggMorph<Parameter> &other) const;
00046 
00047 private:
00048   Parameter _offset;
00049 };
00050 
00051 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorph<LVector3d>);
00052 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorph<LVector2d>);
00053 EXPORT_TEMPLATE_CLASS(EXPCL_PANDAEGG, EXPTP_PANDAEGG, EggMorph<LVector4f>);
00054 
00055 typedef EggMorph<LVector3d> EggMorphVertex;
00056 typedef EggMorph<LVector3d> EggMorphNormal;
00057 typedef EggMorph<LVector2d> EggMorphTexCoord;
00058 typedef EggMorph<LVector4f> EggMorphColor;
00059 
00060 INLINE ostream &operator << (ostream &out, const EggMorphVertex &m);
00061 INLINE ostream &operator << (ostream &out, const EggMorphTexCoord &m);
00062 INLINE ostream &operator << (ostream &out, const EggMorphColor &m);
00063 
00064 // EggMorphNormal is, by virtue of equivalent typedefs, another name
00065 // for EggMorphVertex.  Therefore we shouldn't define its output
00066 // operator again.
00067 //INLINE ostream &operator << (ostream &out, const EggMorphNormal &m);
00068 
00069 #include "eggMorph.I"
00070 
00071 #endif

Generated on Fri May 2 00:37:42 2003 for Panda by doxygen1.3