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

pandatool/src/eggprogs/eggTextureCards.h

Go to the documentation of this file.
00001 // Filename: eggTextureCards.h
00002 // Created by:  drose (21Feb01)
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 EGGTEXTURECARDS_H
00020 #define EGGTEXTURECARDS_H
00021 
00022 #include "pandatoolbase.h"
00023 
00024 #include "eggWriter.h"
00025 #include "eggTexture.h"
00026 #include "luse.h"
00027 
00028 class EggVertexPool;
00029 class EggVertex;
00030 
00031 ////////////////////////////////////////////////////////////////////
00032 //       Class : EggTextureCards
00033 // Description : Generates an egg file featuring a number of polygons,
00034 //               one for each named texture.  This is a support
00035 //               program for getting textures through egg-palettize.
00036 ////////////////////////////////////////////////////////////////////
00037 class EggTextureCards : public EggWriter {
00038 public:
00039   EggTextureCards();
00040 
00041 protected:
00042   virtual bool handle_args(Args &args);
00043 
00044   static bool dispatch_wrap_mode(const string &opt, const string &arg, void *var);
00045   static bool dispatch_format(const string &opt, const string &arg, void *var);
00046 
00047 private:
00048   bool scan_texture(const Filename &filename, LVecBase4d &geometry,
00049                     int &num_channels);
00050   void make_vertices(const LPoint4d &geometry, EggVertexPool *vpool,
00051                      EggVertex *&v1, EggVertex *&v2, EggVertex *&v3, EggVertex *&v4);
00052 
00053 public:
00054   void run();
00055 
00056   LVecBase4d _polygon_geometry;
00057   LVecBase2d _pixel_scale;
00058   bool _got_pixel_scale;
00059   Colorf _polygon_color;
00060   vector_string _texture_names;
00061   EggTexture::WrapMode _wrap_mode;
00062   EggTexture::Format _format;
00063   EggTexture::Format _format_1, _format_2, _format_3, _format_4;
00064   bool _apply_bface;
00065 };
00066 
00067 #endif
00068 

Generated on Fri May 2 03:18:52 2003 for Panda-Tool by doxygen1.3