Panda3D

eggBase.h

00001 // Filename: eggBase.h
00002 // Created by:  drose (14Feb00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef EGGBASE_H
00016 #define EGGBASE_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "programBase.h"
00021 #include "eggData.h"
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : EggBase
00025 // Description : This is a base class for both EggSingleBase and
00026 //               EggMultiBase.  Don't inherit directly from this; use
00027 //               one of those two classes instead.
00028 //
00029 //               This is just a base class; see EggReader, EggWriter,
00030 //               or EggFilter according to your particular I/O needs.
00031 ////////////////////////////////////////////////////////////////////
00032 class EggBase : public ProgramBase {
00033 public:
00034   EggBase();
00035 
00036   void add_normals_options();
00037   void add_points_options();
00038   void add_transform_options();
00039 
00040   static void convert_paths(EggNode *node, PathReplace *path_replace,
00041                             const DSearchPath &additional_path);
00042 
00043 protected:
00044   void append_command_comment(EggData *_data);
00045   static void append_command_comment(EggData *_data, const string &comment);
00046 
00047   static bool dispatch_normals(ProgramBase *self, const string &opt, const string &arg, void *mode);
00048   bool ns_dispatch_normals(const string &opt, const string &arg, void *mode);
00049 
00050   static bool dispatch_scale(const string &opt, const string &arg, void *var);
00051   static bool dispatch_rotate_xyz(ProgramBase *self, const string &opt, const string &arg, void *var);
00052   bool ns_dispatch_rotate_xyz(const string &opt, const string &arg, void *var);
00053   static bool dispatch_rotate_axis(ProgramBase *self, const string &opt, const string &arg, void *var);
00054   bool ns_dispatch_rotate_axis(const string &opt, const string &arg, void *var);
00055   static bool dispatch_translate(const string &opt, const string &arg, void *var);
00056 
00057 protected:
00058   enum NormalsMode {
00059     NM_strip,
00060     NM_polygon,
00061     NM_vertex,
00062     NM_preserve
00063   };
00064   NormalsMode _normals_mode;
00065   double _normals_threshold;
00066   vector_string _tbn_names;
00067   bool _got_tbnall;
00068   bool _got_tbnauto;
00069   
00070   bool _make_points;
00071 
00072   bool _got_transform;
00073   LMatrix4d _transform;
00074 
00075   bool _got_coordinate_system;
00076   CoordinateSystem _coordinate_system;
00077 
00078   bool _noabs;
00079 };
00080 
00081 #endif
00082 
00083 
 All Classes Functions Variables Enumerations