00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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
00033
00034
00035
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