dc0a0c3e2adb721a874bd7746c41ef7261f930cc
[blender.git] / source / blender / collada / SceneExporter.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16
17 /** \file
18  * \ingroup collada
19  */
20
21 #ifndef __SCENEEXPORTER_H__
22 #define __SCENEEXPORTER_H__
23
24 #include <stdlib.h>
25 #include <stdio.h>
26 #include <math.h>
27
28 extern "C" {
29 #include "DNA_scene_types.h"
30 #include "DNA_object_types.h"
31 #include "DNA_collection_types.h"
32 #include "DNA_meshdata_types.h"
33 #include "DNA_mesh_types.h"
34 #include "DNA_image_types.h"
35 #include "DNA_material_types.h"
36 #include "DNA_texture_types.h"
37 #include "DNA_anim_types.h"
38 #include "DNA_action_types.h"
39 #include "DNA_curve_types.h"
40 #include "DNA_constraint_types.h"
41 #include "DNA_armature_types.h"
42 #include "DNA_modifier_types.h"
43 #include "DNA_userdef_types.h"
44
45 #include "BKE_fcurve.h"
46 #include "BKE_animsys.h"
47 #include "BLI_path_util.h"
48 #include "BKE_constraint.h"
49 #include "BLI_fileops.h"
50 #include "ED_keyframing.h"
51 }
52
53 #include "COLLADASWAsset.h"
54 #include "COLLADASWLibraryVisualScenes.h"
55 #include "COLLADASWNode.h"
56 #include "COLLADASWSource.h"
57 #include "COLLADASWInstanceGeometry.h"
58 #include "COLLADASWInputList.h"
59 #include "COLLADASWPrimitves.h"
60 #include "COLLADASWVertices.h"
61 #include "COLLADASWLibraryAnimations.h"
62 #include "COLLADASWLibraryImages.h"
63 #include "COLLADASWLibraryEffects.h"
64 #include "COLLADASWImage.h"
65 #include "COLLADASWEffectProfile.h"
66 #include "COLLADASWColorOrTexture.h"
67 #include "COLLADASWParamTemplate.h"
68 #include "COLLADASWParamBase.h"
69 #include "COLLADASWSurfaceInitOption.h"
70 #include "COLLADASWSampler.h"
71 #include "COLLADASWScene.h"
72 #include "COLLADASWTechnique.h"
73 #include "COLLADASWTexture.h"
74 #include "COLLADASWLibraryMaterials.h"
75 #include "COLLADASWBindMaterial.h"
76 #include "COLLADASWInstanceCamera.h"
77 #include "COLLADASWInstanceLight.h"
78 #include "COLLADASWConstants.h"
79 #include "COLLADASWLibraryControllers.h"
80 #include "COLLADASWInstanceController.h"
81 #include "COLLADASWInstanceNode.h"
82 #include "COLLADASWBaseInputElement.h"
83
84 #include "ArmatureExporter.h"
85
86 #include "ExportSettings.h"
87
88 class SceneExporter : COLLADASW::LibraryVisualScenes,
89                       protected TransformWriter,
90                       protected InstanceWriter {
91  public:
92   SceneExporter(BlenderContext &blender_context,
93                 COLLADASW::StreamWriter *sw,
94                 ArmatureExporter *arm,
95                 const ExportSettings *export_settings)
96       : COLLADASW::LibraryVisualScenes(sw),
97         blender_context(blender_context),
98         arm_exporter(arm),
99         export_settings(export_settings)
100   {
101   }
102
103   void exportScene();
104
105  private:
106   BlenderContext &blender_context;
107   friend class ArmatureExporter;
108   ArmatureExporter *arm_exporter;
109   const ExportSettings *export_settings;
110
111   void exportHierarchy();
112   void writeNodeList(std::vector<Object *> &child_objects, Object *parent);
113   void writeNodes(Object *ob);
114 };
115
116 #endif