FCDocument/FCDEntity.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005-2006 Feeling Software Inc.
00003     MIT License: http://www.opensource.org/licenses/mit-license.php
00004 */
00005 /*
00006     Based on the FS Import classes:
00007     Copyright (C) 2005-2006 Feeling Software Inc
00008     Copyright (C) 2005-2006 Autodesk Media Entertainment
00009     MIT License: http://www.opensource.org/licenses/mit-license.php
00010 */
00011 
00017 #ifndef _FCD_ENTITY_H_
00018 #define _FCD_ENTITY_H_
00019 
00020 #include "FCDocument/FCDObject.h"
00021 
00022 class FCDocument;
00023 class FCDExtra;
00024 
00040 class FCOLLADA_EXPORT FCDEntity : public FCDObjectWithId
00041 {
00042 public:
00046     enum Type
00047     {
00048         ENTITY, 
00049         ANIMATION, 
00050         ANIMATION_CLIP, 
00051         CAMERA, 
00052         LIGHT, 
00053         IMAGE, 
00054         TEXTURE, 
00055         MATERIAL, 
00056         EFFECT, 
00057         GEOMETRY, 
00058         CONTROLLER, 
00059         SCENE_NODE, 
00060         PHYSICS_RIGID_CONSTRAINT, 
00061         PHYSICS_MATERIAL, 
00062         PHYSICS_RIGID_BODY, 
00063         PHYSICS_SHAPE, 
00064         PHYSICS_ANALYTICAL_GEOMETRY, 
00065         PHYSICS_MODEL, 
00066         PHYSICS_SCENE_NODE 
00067     };
00068 
00069 private:
00070     DeclareObjectType;
00071     fstring name;
00072 
00073     // Extra information for the entity.
00074     FCDExtra* extra;
00075 
00076     // Maya and Max both support custom strings for objects.
00077     fstring note;
00078 
00079     // Deprecated ColladaMaya post-processing information.
00080     StringList postCmds;
00081 
00082 public:
00087     FCDEntity(FCDocument* document, const char* baseId = "GenericEntity");
00088 
00091     virtual ~FCDEntity();
00092 
00098     virtual Type GetType() const { return ENTITY; }
00099 
00104     const fstring& GetName() const { return name; }
00105 
00110     void SetName(const fstring& _name);
00111 
00117     FCDExtra* GetExtra() { return extra; }
00118     const FCDExtra* GetExtra() const { return extra; } 
00124     bool HasNote() const { return !note.empty(); }
00125 
00130     const fstring& GetNote() const { return note; }
00131 
00136     void SetNote(const fstring& _note) { note = _note; }
00137 
00144     virtual FCDEntity* FindDaeId(const string& daeId);
00145 
00151     virtual FUStatus LoadFromXML(xmlNode* entityNode);
00152 
00157     virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
00158 
00162     StringList& GetPostProcessCmds() { return postCmds; }
00163 
00164 protected:
00172     xmlNode* WriteToEntityXML(xmlNode* parentNode, const char* nodeName) const;
00173 
00180     void WriteToExtraXML(xmlNode* entityNode) const;
00181 
00186     void Clone(FCDEntity* clone);
00187 };
00188 
00189 #endif // _FCD_ENTITY_H_
00190 

Generated on Fri May 12 16:44:38 2006 for FCollada by  doxygen 1.4.6-NO