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

panda/src/egg2pg/computedVerticesMakerEntity.h

Go to the documentation of this file.
00001 // Filename: computedVerticesMakerEntity.h
00002 // Created by:  drose (02Mar99)
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 COMPUTEDVERTICESMAKERENTITY_H
00020 #define COMPUTEDVERTICESMAKERENTITY_H
00021 
00022 #include "pandabase.h"
00023 
00024 #include "luse.h"
00025 #include "eggMorphList.h"
00026 #include "typedef.h"
00027 #include "pointerToArray.h"
00028 
00029 #include "pmap.h"
00030 #include <math.h>
00031 
00032 ///////////////////////////////////////////////////////////////////
00033 //       Class : ComputedVerticesMakerEntity
00034 // Description : This represents a single vertex value, or color
00035 //               value, or normal value, or some such thing, added to
00036 //               the ComputedVerticesMaker.  This supports
00037 //               ComputedVerticesMakerEntityMap, below, which is used
00038 //               by ComputedVerticesMaker to collect together vertex
00039 //               values with identical values.
00040 ////////////////////////////////////////////////////////////////////
00041 template<class ValueType, class MorphType>
00042 class ComputedVerticesMakerEntity {
00043 public:
00044   INLINE ComputedVerticesMakerEntity(const ValueType &value,
00045                                      const MorphType &morphs);
00046   bool
00047   operator < (const ComputedVerticesMakerEntity<ValueType, MorphType> &other) const;
00048 
00049   ValueType _value;
00050   const MorphType &_morphs;
00051 };
00052 
00053 
00054 ///////////////////////////////////////////////////////////////////
00055 //       Class : ComputedVerticesMakerEntityMap
00056 // Description : A map of some kind of entity, above, to an integer
00057 //               index number.  This collects together identical
00058 //               vertices into a common index number.
00059 ////////////////////////////////////////////////////////////////////
00060 template<class ValueType, class MorphType>
00061 class ComputedVerticesMakerEntityMap {
00062 public:
00063   int add_value(const ValueType &value, const MorphType &morphs,
00064                 PTA(ValueType) &table);
00065 
00066   typedef pmap<ComputedVerticesMakerEntity<ValueType, MorphType>, int> MapType;
00067   MapType _map;
00068 };
00069 
00070 typedef ComputedVerticesMakerEntityMap<Vertexf, EggMorphVertexList> ComputedVerticesMakerVertexMap;
00071 typedef ComputedVerticesMakerEntityMap<Normalf, EggMorphNormalList> ComputedVerticesMakerNormalMap;
00072 typedef ComputedVerticesMakerEntityMap<TexCoordf, EggMorphTexCoordList> ComputedVerticesMakerTexCoordMap;
00073 typedef ComputedVerticesMakerEntityMap<Colorf, EggMorphColorList> ComputedVerticesMakerColorMap;
00074 
00075 #include "computedVerticesMakerEntity.I"
00076 
00077 #endif

Generated on Fri May 2 00:38:09 2003 for Panda by doxygen1.3