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

pandatool/src/eggbase/eggWriter.h

Go to the documentation of this file.
00001 // Filename: eggWriter.h
00002 // Created by:  drose (14Feb00)
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 EGGWRITER_H
00020 #define EGGWRITER_H
00021 
00022 #include "pandatoolbase.h"
00023 #include "eggBase.h"
00024 #include "withOutputFile.h"
00025 
00026 #include "filename.h"
00027 #include "luse.h"
00028 
00029 ////////////////////////////////////////////////////////////////////
00030 //       Class : EggWriter
00031 // Description : This is the base class for a program that generates
00032 //               an egg file output, but doesn't read any for input.
00033 ////////////////////////////////////////////////////////////////////
00034 class EggWriter : virtual public EggBase, public WithOutputFile {
00035 public:
00036   EggWriter(bool allow_last_param = false, bool allow_stdout = true);
00037 
00038   void add_normals_options();
00039   void add_transform_options();
00040 
00041   virtual EggWriter *as_writer();
00042 
00043   virtual void post_process_egg_file();
00044   void write_egg_file();
00045 
00046 protected:
00047   virtual bool handle_args(Args &args);
00048   virtual bool post_command_line();
00049 
00050   static bool dispatch_normals(ProgramBase *self, const string &opt, const string &arg, void *mode);
00051   bool ns_dispatch_normals(const string &opt, const string &arg, void *mode);
00052 
00053   static bool dispatch_scale(const string &opt, const string &arg, void *var);
00054   static bool dispatch_rotate_xyz(ProgramBase *self, const string &opt, const string &arg, void *var);
00055   bool ns_dispatch_rotate_xyz(const string &opt, const string &arg, void *var);
00056   static bool dispatch_rotate_axis(ProgramBase *self, const string &opt, const string &arg, void *var);
00057   bool ns_dispatch_rotate_axis(const string &opt, const string &arg, void *var);
00058   static bool dispatch_translate(const string &opt, const string &arg, void *var);
00059 
00060 protected:
00061   enum NormalsMode {
00062     NM_strip,
00063     NM_polygon,
00064     NM_vertex,
00065     NM_preserve
00066   };
00067   NormalsMode _normals_mode;
00068   double _normals_threshold;
00069 
00070   bool _got_transform;
00071   LMatrix4d _transform;
00072 
00073 private:
00074   ofstream _output_stream;
00075   ostream *_output_ptr;
00076 };
00077 
00078 #endif
00079 
00080 

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