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

panda/src/grutil/cardMaker.h

Go to the documentation of this file.
00001 // Filename: cardMaker.h
00002 // Created by:  drose (16Mar02)
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 CARDMAKER_H
00020 #define CARDMAKER_H
00021 
00022 #include "pandabase.h"
00023 
00024 #include "luse.h"
00025 #include "pandaNode.h"
00026 #include "pointerTo.h"
00027 #include "namable.h"
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //       Class : CardMaker
00031 // Description : This class generates 2-d "cards", that is,
00032 //               rectangular polygons, particularly useful for showing
00033 //               textures etc. in the 2-d scene graph.
00034 ////////////////////////////////////////////////////////////////////
00035 class EXPCL_PANDA CardMaker : public Namable {
00036 PUBLISHED:
00037   INLINE CardMaker(const string &name);
00038   INLINE ~CardMaker();
00039 
00040   void reset();
00041   INLINE void set_uv_range(const TexCoordf &ll, const TexCoordf &ur);
00042   INLINE void set_has_uvs(bool flag);
00043 
00044   INLINE void set_frame(float left, float right, float bottom, float top);
00045   INLINE void set_frame(const LVecBase4f &frame);
00046 
00047   INLINE void set_color(float r, float g, float b, float a);
00048   INLINE void set_color(const Colorf &color);
00049 
00050   INLINE void set_source_geometry(PandaNode *node, const LVecBase4f &frame);
00051   INLINE void clear_source_geometry();
00052 
00053   PT(PandaNode) generate();
00054 
00055 private:
00056   PT(PandaNode) rescale_source_geometry();
00057 
00058   bool _has_uvs;
00059   TexCoordf _ll, _ur;
00060   LVecBase4f _frame;
00061 
00062   bool _has_color;
00063   Colorf _color;
00064 
00065   PT(PandaNode) _source_geometry;
00066   LVecBase4f _source_frame;
00067 };
00068 
00069 #include "cardMaker.I"
00070 
00071 #endif
00072 

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