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_transform_options();
00038 
00039   static void convert_paths(EggNode *node, PathReplace *path_replace,
00040                             const DSearchPath &additional_path);
00041 
00042 protected:
00043   void append_command_comment(EggData *_data);
00044   static void append_command_comment(EggData *_data, const string &comment);
00045 
00046   static bool dispatch_normals(ProgramBase *self, const string &opt, const string &arg, void *mode);
00047   bool ns_dispatch_normals(const string &opt, const string &arg, void *mode);
00048 
00049   static bool dispatch_scale(const string &opt, const string &arg, void *var);
00050   static bool dispatch_rotate_xyz(ProgramBase *self, const string &opt, const string &arg, void *var);
00051   bool ns_dispatch_rotate_xyz(const string &opt, const string &arg, void *var);
00052   static bool dispatch_rotate_axis(ProgramBase *self, const string &opt, const string &arg, void *var);
00053   bool ns_dispatch_rotate_axis(const string &opt, const string &arg, void *var);
00054   static bool dispatch_translate(const string &opt, const string &arg, void *var);
00055 
00056 protected:
00057   enum NormalsMode {
00058     NM_strip,
00059     NM_polygon,
00060     NM_vertex,
00061     NM_preserve
00062   };
00063   NormalsMode _normals_mode;
00064   double _normals_threshold;
00065   vector_string _tbn_names;
00066   bool _got_tbnall;
00067   bool _got_tbnauto;
00068 
00069   bool _got_transform;
00070   LMatrix4d _transform;
00071 
00072   bool _got_coordinate_system;
00073   CoordinateSystem _coordinate_system;
00074 
00075   bool _noabs;
00076 };
00077 
00078 #endif
00079 
00080 
 All Classes Functions Variables Enumerations