Panda3D

colladaLoader.h

00001 // Filename: colladaLoader.h
00002 // Created by: Xidram (21Dec10)
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 COLLADALOADER_H
00016 #define COLLADALOADER_H
00017 
00018 #include "pandabase.h"
00019 #include "config_collada.h"
00020 #include "typedReferenceCount.h"
00021 #include "pandaNode.h"
00022 #include "modelRoot.h"
00023 #include "pvector.h"
00024 #include "pta_LVecBase4.h"
00025 
00026 class ColladaBindMaterial;
00027 class BamCacheRecord;
00028 class GeomNode;
00029 class LightNode;
00030 
00031 class domBind_material;
00032 class domCOLLADA;
00033 class domNode;
00034 class domVisual_scene;
00035 class domExtra;
00036 class domGeometry;
00037 class domInstance_geometry;
00038 class domLight;
00039 class domCamera;
00040 class domSource;
00041 class DAE;
00042 
00043 ////////////////////////////////////////////////////////////////////
00044 //       Class : ColladaLoader
00045 // Description : Object that interfaces with the COLLADA DOM library
00046 //               and loads the COLLADA structures into Panda nodes.
00047 ////////////////////////////////////////////////////////////////////
00048 class ColladaLoader {
00049 public:
00050   ColladaLoader();
00051   virtual ~ColladaLoader();
00052 
00053   bool _error;
00054   PT(ModelRoot) _root;
00055   BamCacheRecord *_record;
00056   CoordinateSystem _cs;
00057   Filename _filename;
00058 
00059   bool read(const Filename &filename);
00060   void build_graph();
00061 
00062 private:
00063   const domCOLLADA* _collada;
00064   DAE* _dae;
00065   pvector<LightNode*> _lights;
00066 
00067   void load_visual_scene(domVisual_scene &scene, PandaNode *parent);
00068   void load_node(domNode &node, PandaNode *parent);
00069   void load_tags(domExtra &extra, PandaNode *node);
00070   void load_camera(domCamera &cam, PandaNode *parent);
00071   void load_instance_geometry(domInstance_geometry &inst, PandaNode *parent);
00072   void load_geometry(domGeometry &geom, GeomNode *parent, ColladaBindMaterial &bind_mat);
00073   void load_light(domLight &light, PandaNode *parent);
00074 };
00075 
00076 #include "colladaLoader.I"
00077 
00078 #endif
 All Classes Functions Variables Enumerations