Blender V2.61 - r43446
Public Types | Public Member Functions

DocumentImporter Class Reference

#include <DocumentImporter.h>

List of all members.

Public Types

enum  ImportStage { General, Controller }
 

Enumeration to denote the stage of import.

More...

Public Member Functions

 DocumentImporter (bContext *C, const char *filename)
 ~DocumentImporter ()
bool import ()
Objectcreate_camera_object (COLLADAFW::InstanceCamera *, Scene *)
Objectcreate_lamp_object (COLLADAFW::InstanceLight *, Scene *)
Objectcreate_instance_node (Object *, COLLADAFW::Node *, COLLADAFW::Node *, Scene *, Object *, bool)
void write_node (COLLADAFW::Node *, COLLADAFW::Node *, Scene *, Object *, bool)
MTexcreate_texture (COLLADAFW::EffectCommon *, COLLADAFW::Texture &, Material *, int, TexIndexTextureArrayMap &)
void write_profile_COMMON (COLLADAFW::EffectCommon *, Material *)
void translate_anim_recursive (COLLADAFW::Node *, COLLADAFW::Node *, Object *)
void cancel (const COLLADAFW::String &errorMessage)
void start ()
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 *)
bool addExtraTags (const COLLADAFW::UniqueId &uid, ExtraTags *extra_tags)
ExtraTagsgetExtraTags (const COLLADAFW::UniqueId &uid)

Detailed Description

Importer class.

Definition at line 55 of file DocumentImporter.h.


Member Enumeration Documentation

Enumeration to denote the stage of import.

Enumerator:
General 

First pass to collect all data except controller.

Controller 

Second pass to collect controller data.

Definition at line 59 of file DocumentImporter.h.


Constructor & Destructor Documentation

DocumentImporter::DocumentImporter ( bContext C,
const char *  filename 
)

Constructor

Definition at line 96 of file DocumentImporter.cpp.

DocumentImporter::~DocumentImporter ( )

Destructor

Definition at line 105 of file DocumentImporter.cpp.


Member Function Documentation

bool DocumentImporter::addExtraTags ( const COLLADAFW::UniqueId &  uid,
ExtraTags extra_tags 
)

Add element and data for UniqueId

Definition at line 1125 of file DocumentImporter.cpp.

Referenced by ExtraHandler::parseElement().

void DocumentImporter::cancel ( const COLLADAFW::String &  errorMessage)

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.

Parameters:
errorMessageA message containing informations about the error that occurred.

Definition at line 146 of file DocumentImporter.cpp.

Object * DocumentImporter::create_camera_object ( COLLADAFW::InstanceCamera *  camera,
Scene sce 
)

these should not be here

Definition at line 282 of file DocumentImporter.cpp.

References add_object(), Object::data, free_libblock(), G, Camera::id, if(), NULL, OB_CAMERA, and ID::us.

Referenced by write_node().

Object * DocumentImporter::create_instance_node ( Object source_ob,
COLLADAFW::Node source_node,
COLLADAFW::Node instance_node,
Scene sce,
Object par_ob,
bool  is_library_node 
)
Object * DocumentImporter::create_lamp_object ( COLLADAFW::InstanceLight *  lamp,
Scene sce 
)

Definition at line 299 of file DocumentImporter.cpp.

References add_object(), Object::data, free_libblock(), G, Lamp::id, if(), NULL, OB_LAMP, and ID::us.

Referenced by write_node().

MTex * DocumentImporter::create_texture ( COLLADAFW::EffectCommon *  ef,
COLLADAFW::Texture ctex,
Material ma,
int  i,
TexIndexTextureArrayMap texindex_texarray_map 
)
void DocumentImporter::finish ( )
ExtraTags * DocumentImporter::getExtraTags ( const COLLADAFW::UniqueId &  uid)

Get an extisting ExtraTags for uid

Definition at line 1117 of file DocumentImporter.cpp.

References NULL.

Referenced by ExtraHandler::parseElement().

bool DocumentImporter::import ( )

Function called by blender UI

TODO set up scene graph and such here

Definition at line 115 of file DocumentImporter.cpp.

References Controller, ErrorHandler::hasError(), and MakeCursor::root.

Referenced by collada_import().

void DocumentImporter::start ( )

This is the method called. The writer hast to prepare to receive data.

Definition at line 156 of file DocumentImporter.cpp.

void DocumentImporter::translate_anim_recursive ( COLLADAFW::Node node,
COLLADAFW::Node par = NULL,
Object parob = NULL 
)

Definition at line 236 of file DocumentImporter.cpp.

References i, NULL, and AnimationImporter::translate_Animations().

Referenced by finish().

void DocumentImporter::write_node ( COLLADAFW::Node node,
COLLADAFW::Node parent_node,
Scene sce,
Object par,
bool  is_library_node 
)
void DocumentImporter::write_profile_COMMON ( COLLADAFW::EffectCommon *  ef,
Material ma 
)
bool DocumentImporter::writeAnimation ( const COLLADAFW::Animation *  anim)

Definition at line 1072 of file DocumentImporter.cpp.

References General, and AnimationImporter::write_animation().

bool DocumentImporter::writeAnimationList ( const COLLADAFW::AnimationList *  animationList)

Definition at line 1082 of file DocumentImporter.cpp.

References General, and AnimationImporter::write_animation_list().

bool DocumentImporter::writeCamera ( const COLLADAFW::Camera camera)

When this method is called, the writer must write the camera.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 760 of file DocumentImporter.cpp.

References add_camera(), CAM_ORTHO, CAM_PERSP, DEG2RADF, fov_to_focallength(), General, NULL, and UNDEFINED.

bool DocumentImporter::writeController ( const COLLADAFW::Controller *  controller)

Definition at line 1099 of file DocumentImporter.cpp.

References General, and ArmatureImporter::write_controller().

bool DocumentImporter::writeEffect ( const COLLADAFW::Effect effect)

When this method is called, the writer must write the effect.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 722 of file DocumentImporter.cpp.

References General, and write_profile_COMMON().

bool DocumentImporter::writeFormulas ( const COLLADAFW::Formulas *  formulas)

Definition at line 1107 of file DocumentImporter.cpp.

bool DocumentImporter::writeGeometry ( const COLLADAFW::Geometry *  geom)

When this method is called, the writer must write the geometry.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 523 of file DocumentImporter.cpp.

References General, and MeshImporter::write_geometry().

bool DocumentImporter::writeGlobalAsset ( const COLLADAFW::FileInfo *  asset)

When this method is called, the writer must write the global document asset.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 268 of file DocumentImporter.cpp.

References UnitConverter::read_asset().

bool DocumentImporter::writeImage ( const COLLADAFW::Image image)

When this method is called, the writer must write the image.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 876 of file DocumentImporter.cpp.

References BKE_add_image_file(), BLI_join_dirfile(), BLI_split_dir_part(), FILE_MAX, and General.

bool DocumentImporter::writeKinematicsScene ( const COLLADAFW::KinematicsScene *  kinematicsScene)

Definition at line 1112 of file DocumentImporter.cpp.

bool DocumentImporter::writeLibraryNodes ( const COLLADAFW::LibraryNodes *  libraryNodes)

When this method is called, the writer must handle all nodes contained in the library nodes.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 505 of file DocumentImporter.cpp.

References CTX_data_scene(), General, i, nodes, NULL, and write_node().

bool DocumentImporter::writeLight ( const COLLADAFW::Light *  light)

When this method is called, the writer must write the light.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 901 of file DocumentImporter.cpp.

References add_lamp(), simple_enum_gen::d, credits_svn_gen::e, General, UnitConverter::getLinearMeter(), IS_EQ, ExtraTags::isProfile(), LA_FALLOFF_INVLINEAR, LA_FALLOFF_INVSQUARE, LA_HEMI, LA_LOCAL, LA_NO_SPEC, LA_SPOT, LA_SUN, NULL, ExtraTags::setData(), sqrt(), and UNDEFINED.

bool DocumentImporter::writeMaterial ( const COLLADAFW::Material cmat)

When this method is called, the writer must write the material.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 533 of file DocumentImporter.cpp.

References add_material(), and General.

bool DocumentImporter::writeScene ( const COLLADAFW::Scene scene)

When this method is called, the writer must write the scene.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 277 of file DocumentImporter.cpp.

bool DocumentImporter::writeSkinControllerData ( const COLLADAFW::SkinControllerData *  skin)

When this method is called, the writer must write the skin controller data.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 1093 of file DocumentImporter.cpp.

References ArmatureImporter::write_skin_controller_data().

bool DocumentImporter::writeVisualScene ( const COLLADAFW::VisualScene *  visualScene)

When this method is called, the writer must write the entire visual scene.

Returns:
The writer should return true, if writing succeeded, false otherwise.

Definition at line 482 of file DocumentImporter.cpp.

References General.


The documentation for this class was generated from the following files: