Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2010-12-15 00:46:03 +0300
committerNathan Letwory <nathan@letworyinteractive.com>2010-12-15 00:46:03 +0300
commit100d611ce53f759508b29c819b0033cbf8bbb167 (patch)
treee76b37d37cfa20a35465e01541b084acc522185a /source/blender/collada/DocumentImporter.h
parent7775a1a798dd6130140e82f97a1b5e0abea4b8ec (diff)
Apply patch [#25224] Refactor COLLADA DocumentImporter
Submitted by Martijn Berger. Make DocumentImporter class the actual IWriter implementation and move prototype to the header. Group together functions that we should move out of the class. No functional changes.
Diffstat (limited to 'source/blender/collada/DocumentImporter.h')
-rw-r--r--source/blender/collada/DocumentImporter.h108
1 files changed, 106 insertions, 2 deletions
diff --git a/source/blender/collada/DocumentImporter.h b/source/blender/collada/DocumentImporter.h
index 6a6f1dcb3bc..a2c5e664623 100644
--- a/source/blender/collada/DocumentImporter.h
+++ b/source/blender/collada/DocumentImporter.h
@@ -24,13 +24,117 @@
#ifndef __DOCUMENTIMPORTER_H__
#define __DOCUMENTIMPORTER_H__
+
+#include "COLLADAFWIWriter.h"
+#include "COLLADAFWMaterial.h"
+#include "COLLADAFWEffect.h"
+#include "COLLADAFWColor.h"
+#include "COLLADAFWImage.h"
+#include "COLLADAFWInstanceGeometry.h"
+#include "COLLADAFWController.h"
+#include "COLLADAFWMorphController.h"
+#include "COLLADAFWSkinController.h"
+
+#include "BKE_object.h"
+
+#include "TransformReader.h"
+#include "AnimationImporter.h"
+#include "ArmatureImporter.h"
+#include "MeshImporter.h"
+
+
struct Main;
struct bContext;
-class DocumentImporter
+class DocumentImporter : COLLADAFW::IWriter
{
+ private:
+
+ std::string mFilename;
+
+ bContext *mContext;
+
+ UnitConverter unit_converter;
+ ArmatureImporter armature_importer;
+ MeshImporter mesh_importer;
+ AnimationImporter anim_importer;
+
+ std::map<COLLADAFW::UniqueId, Image*> uid_image_map;
+ std::map<COLLADAFW::UniqueId, Material*> uid_material_map;
+ std::map<COLLADAFW::UniqueId, Material*> uid_effect_map;
+ std::map<COLLADAFW::UniqueId, Camera*> uid_camera_map;
+ std::map<COLLADAFW::UniqueId, Lamp*> uid_lamp_map;
+ std::map<Material*, TexIndexTextureArrayMap> material_texture_mapping_map;
+ std::map<COLLADAFW::UniqueId, Object*> object_map;
+ std::map<COLLADAFW::UniqueId, COLLADAFW::Node*> node_map;
+ std::vector<const COLLADAFW::VisualScene*> vscenes;
+ std::vector<Object*> libnode_ob;
+
+ std::map<COLLADAFW::UniqueId, COLLADAFW::Node*> root_map; // find root joint by child joint uid, for bone tree evaluation during resampling
public:
- void import(bContext *C, const char *filename);
+ /** Constructor */
+ DocumentImporter(bContext *C, const char *filename);
+
+ /** Destructor */
+ ~DocumentImporter();
+
+ /** Function called by blender UI */
+ bool import();
+
+ /** these should not be here */
+ Object* create_camera_object(COLLADAFW::InstanceCamera*, Scene*);
+ Object* create_lamp_object(COLLADAFW::InstanceLight*, Scene*);
+ Object* create_instance_node(Object*, COLLADAFW::Node*, COLLADAFW::Node*, Scene*, bool);
+ void write_node(COLLADAFW::Node*, COLLADAFW::Node*, Scene*, Object*, bool);
+ MTex* create_texture(COLLADAFW::EffectCommon*, COLLADAFW::Texture&, Material*, int, TexIndexTextureArrayMap&);
+ void write_profile_COMMON(COLLADAFW::EffectCommon*, Material*);
+ void translate_anim_recursive(COLLADAFW::Node*, COLLADAFW::Node*, Object*);
+
+ /** This method will be called if an error in the loading process occurred and the loader cannot
+ continue to load. The writer should undo all operations that have been performed.
+ @param errorMessage A message containing informations about the error that occurred.
+ */
+ void cancel(const COLLADAFW::String& errorMessage);
+
+ /** This is the method called. The writer hast to prepare to receive data.*/
+ void start();
+
+ /** This method is called after the last write* method. No other methods will be called after this.*/
+ void finish();
+
+ bool writeGlobalAsset(const COLLADAFW::FileInfo*);
+
+ bool writeScene(const COLLADAFW::Scene*);
+
+ bool writeVisualScene(const COLLADAFW::VisualScene*);
+
+ bool writeLibraryNodes(const COLLADAFW::LibraryNodes*);
+
+ bool writeAnimation(const COLLADAFW::Animation*);
+
+ bool writeAnimationList(const COLLADAFW::AnimationList*);
+
+ bool writeGeometry(const COLLADAFW::Geometry*);
+
+ bool writeMaterial(const COLLADAFW::Material*);
+
+ bool writeEffect(const COLLADAFW::Effect*);
+
+ bool writeCamera(const COLLADAFW::Camera*);
+
+ bool writeImage(const COLLADAFW::Image*);
+
+ bool writeLight(const COLLADAFW::Light*);
+
+ bool writeSkinControllerData(const COLLADAFW::SkinControllerData*);
+
+ bool writeController(const COLLADAFW::Controller*);
+
+ bool writeFormulas(const COLLADAFW::Formulas*);
+
+ bool writeKinematicsScene(const COLLADAFW::KinematicsScene*);
+
+
};
#endif