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

panda/src/builder/builderAttribTempl.h

Go to the documentation of this file.
00001 // Filename: builderAttribTempl.h
00002 // Created by:  drose (17Sep97)
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 #ifndef BUILDERATTRIBTEMPL_H
00019 #define BUILDERATTRIBTEMPL_H
00020 
00021 #include <pandabase.h>
00022 
00023 #include "builderTypes.h"
00024 
00025 #include "pvector.h"
00026 
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //       Class : BuilderAttribTempl
00030 // Description : The main body of BuilderAttrib and BuilderAttribI,
00031 //               and the base class for BuilderVertexTempl and
00032 //               BuilderPrimTempl, this class defines the attributes
00033 //               that may be specified for either vertices or
00034 //               primitives.
00035 ////////////////////////////////////////////////////////////////////
00036 template <class VT, class NT, class TT, class CT>
00037 class BuilderAttribTempl {
00038 public:
00039   typedef VT VType;
00040   typedef NT NType;
00041   typedef TT TType;
00042   typedef CT CType;
00043 
00044   INLINE BuilderAttribTempl();
00045   INLINE BuilderAttribTempl(const BuilderAttribTempl &copy);
00046   INLINE BuilderAttribTempl &operator = (const BuilderAttribTempl &copy);
00047 
00048   INLINE BuilderAttribTempl &clear();
00049 
00050   INLINE bool has_normal() const;
00051   INLINE NType get_normal() const;
00052   INLINE BuilderAttribTempl &set_normal(const NType &n);
00053   INLINE BuilderAttribTempl &clear_normal();
00054 
00055   INLINE bool has_color() const;
00056   INLINE CType get_color() const;
00057   INLINE BuilderAttribTempl &set_color(const CType &c);
00058   INLINE BuilderAttribTempl &clear_color();
00059 
00060   INLINE bool has_pixel_size() const;
00061   INLINE float get_pixel_size() const;
00062   INLINE BuilderAttribTempl &set_pixel_size(float s);
00063   INLINE BuilderAttribTempl &clear_pixel_size();
00064 
00065   INLINE bool operator == (const BuilderAttribTempl &other) const;
00066   INLINE bool operator != (const BuilderAttribTempl &other) const;
00067   INLINE bool operator < (const BuilderAttribTempl &other) const;
00068   int compare_to(const BuilderAttribTempl &other) const;
00069 
00070   ostream &output(ostream &out) const;
00071 
00072 protected:
00073   NType _normal;
00074   CType _color;
00075   float _pixel_size;
00076   int _flags;
00077 };
00078 
00079 template <class VT, class NT, class TT, class CT>
00080 INLINE ostream &operator << (ostream &out,
00081                              const BuilderAttribTempl<VT, NT, TT, CT> &attrib) {
00082   return attrib.output(out);
00083 }
00084 
00085 #include "builderAttribTempl.I"
00086 
00087 #endif
00088 

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