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

panda/src/builder/builderVertexTempl.h

Go to the documentation of this file.
00001 // Filename: builderVertexTempl.h
00002 // Created by:  drose (09Sep97)
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 BUILDERVERTEXTEMPL_H
00020 #define BUILDERVERTEXTEMPL_H
00021 
00022 #include "pandabase.h"
00023 
00024 #include "builderTypes.h"
00025 #include "builderAttribTempl.h"
00026 #include "builder_compare.h"
00027 
00028 #include "notify.h"
00029 #include "pvector.h"
00030 
00031 /////////////////////////////////////////////////////////////////////
00032 //       Class : BuilderVertexTempl
00033 // Description : The main body of BuilderVertex and BuilderVertexI.
00034 //               This is a template class on each of the four
00035 //               attribute types: vertex coordinates, normal, texture
00036 //               coordinates, and color.  See builderVertex.h.
00037 ////////////////////////////////////////////////////////////////////
00038 template <class VT, class NT, class TT, class CT>
00039 class BuilderVertexTempl : public BuilderAttribTempl<VT, NT, TT, CT> {
00040 public:
00041   typedef VT VType;
00042   typedef NT NType;
00043   typedef TT TType;
00044   typedef CT CType;
00045 
00046   INLINE BuilderVertexTempl();
00047   INLINE BuilderVertexTempl(const VType &c);
00048   INLINE BuilderVertexTempl(const BuilderVertexTempl &copy);
00049   INLINE BuilderVertexTempl &operator = (const BuilderVertexTempl &copy);
00050 
00051   INLINE bool is_valid() const;
00052   INLINE BuilderVertexTempl &clear();
00053 
00054   INLINE bool has_coord() const;
00055   INLINE VType get_coord() const;
00056   INLINE BuilderVertexTempl &set_coord(const VType &c);
00057 
00058   INLINE BuilderVertexTempl &set_normal(const NType &c);
00059   INLINE BuilderVertexTempl &clear_normal();
00060 
00061   INLINE bool has_texcoord() const;
00062   INLINE TType get_texcoord() const;
00063   INLINE BuilderVertexTempl &set_texcoord(const TType &t);
00064   INLINE BuilderVertexTempl &clear_texcoord();
00065 
00066   INLINE BuilderVertexTempl &set_color(const CType &c);
00067   INLINE BuilderVertexTempl &clear_color();
00068 
00069   INLINE BuilderVertexTempl &set_pixel_size(float s);
00070   INLINE BuilderVertexTempl &clear_pixel_size();
00071 
00072   INLINE bool operator == (const BuilderVertexTempl &other) const;
00073   INLINE bool operator != (const BuilderVertexTempl &other) const;
00074   INLINE bool operator < (const BuilderVertexTempl &other) const;
00075   int compare_to(const BuilderVertexTempl &other) const;
00076 
00077   ostream &output(ostream &out) const;
00078 
00079 protected:
00080   VType _coord;
00081   TType _texcoord;
00082 };
00083 
00084 template <class VT, class NT, class TT, class CT>
00085 INLINE ostream &operator << (ostream &out,
00086                              const BuilderVertexTempl<VT, NT, TT, CT> &vertex) {
00087   return vertex.output(out);
00088 }
00089 
00090 
00091 #include "builderVertexTempl.I"
00092 
00093 #endif

Generated on Fri May 2 00:34:47 2003 for Panda by doxygen1.3