Panda3D
 All Classes Functions Variables Enumerations
mayaNodeTree.h
00001 // Filename: mayaNodeTree.h
00002 // Created by:  drose (06Jun03)
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 MAYANODETREE_H
00016 #define MAYANODETREE_H
00017 
00018 #include "pandatoolbase.h"
00019 
00020 #include "mayaNodeDesc.h"
00021 #include "mayaBlendDesc.h"
00022 #include "globPattern.h"
00023 #include "indirectCompareNames.h"
00024 #include "ordered_vector.h"
00025 #include "pset.h"
00026 #include "pmap.h"
00027 
00028 class MayaToEggConverter;
00029 class EggData;
00030 class EggGroupNode;
00031 class EggTable;
00032 class EggXfmSAnim;
00033 class EggSAnimData;
00034 
00035 ////////////////////////////////////////////////////////////////////
00036 //       Class : MayaNodeTree
00037 // Description : Describes a complete tree of maya nodes for
00038 //               conversion.
00039 ////////////////////////////////////////////////////////////////////
00040 class MayaNodeTree {
00041 public:
00042   MayaNodeTree(MayaToEggConverter *converter);
00043   MayaNodeDesc *build_node(const MDagPath &dag_path);
00044   bool build_hierarchy();
00045 
00046   void tag_joint_all();
00047   //  bool tag_joint_selected();
00048   bool tag_joint_named(const GlobPattern &glob);
00049 
00050   void tag_all();
00051   bool tag_selected();
00052   bool tag_named(const GlobPattern &glob);
00053   bool untag_named(const GlobPattern &glob);
00054 
00055   int get_num_nodes() const;
00056   MayaNodeDesc *get_node(int n) const;
00057 
00058   void clear();
00059   void clear_egg(EggData *egg_data, EggGroupNode *egg_root, 
00060                  EggGroupNode *skeleton_node, EggGroupNode *morph_node);
00061   EggGroup *get_egg_group(MayaNodeDesc *node_desc);
00062   EggTable *get_egg_table(MayaNodeDesc *node_desc);
00063   EggXfmSAnim *get_egg_anim(MayaNodeDesc *node_desc);
00064   EggSAnimData *get_egg_slider(MayaBlendDesc *blend_desc);
00065 
00066   bool ignore_slider(const string &name) const;
00067   void report_ignored_slider(const string &name);
00068 
00069   MayaBlendDesc *add_blend_desc(MayaBlendDesc *blend_desc);
00070   int get_num_blend_descs() const;
00071   MayaBlendDesc *get_blend_desc(int n) const;
00072 
00073   void reset_sliders();
00074 
00075 public:
00076   string _subroot_parent_name;
00077   PT(MayaNodeDesc) _root;
00078   PN_stdfloat _fps;
00079 
00080 private:
00081   MayaNodeDesc *r_build_node(const string &path);
00082 
00083   MayaToEggConverter *_converter;
00084 
00085   EggData *_egg_data;
00086   EggGroupNode *_egg_root;
00087   EggGroupNode *_skeleton_node;
00088   EggGroupNode *_morph_node;
00089 
00090   typedef pmap<string, MayaNodeDesc *> NodesByPath;
00091   NodesByPath _nodes_by_path;
00092 
00093   typedef pvector<MayaNodeDesc *> Nodes;
00094   Nodes _nodes;
00095 
00096   typedef ov_set<PT(MayaBlendDesc), IndirectCompareNames<MayaBlendDesc> > BlendDescs;
00097   BlendDescs _blend_descs;
00098 
00099   typedef pset<string> Strings;
00100   Strings _ignored_slider_names;
00101 };
00102 
00103 #endif
 All Classes Functions Variables Enumerations