FCDocument/FCDEntity.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2005-2007 Feeling Software Inc.
00003     Portions of the code are:
00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
00005     
00006     MIT License: http://www.opensource.org/licenses/mit-license.php
00007 */
00008 /*
00009     Based on the FS Import classes:
00010     Copyright (C) 2005-2006 Feeling Software Inc
00011     Copyright (C) 2005-2006 Autodesk Media Entertainment
00012     MIT License: http://www.opensource.org/licenses/mit-license.php
00013 */
00014 
00020 #ifndef _FCD_ENTITY_H_
00021 #define _FCD_ENTITY_H_
00022 
00023 #ifndef __FCD_OBJECT_WITH_ID_H_
00024 #include "FCDocument/FCDObjectWithId.h"
00025 #endif // __FCD_OBJECT_WITH_ID_H_
00026 #ifndef _FU_PARAMETER_H_
00027 #include "FUtils/FUParameter.h"
00028 #endif // _FU_PARAMETER_H_
00029 
00030 class FCDocument;
00031 class FCDAsset;
00032 class FCDExtra;
00033 
00034 typedef fm::pvector<FCDAsset> FCDAssetList; 
00035 typedef fm::pvector<const FCDAsset> FCDAssetConstList; 
00052 class FCOLLADA_EXPORT FCDEntity : public FCDObjectWithId
00053 {
00054 public:
00058     enum Type
00059     {
00060         ENTITY, 
00061         ANIMATION, 
00062         ANIMATION_CLIP, 
00063         CAMERA, 
00064         LIGHT, 
00065         IMAGE, 
00066         MATERIAL, 
00067         EFFECT, 
00068         GEOMETRY, 
00069         CONTROLLER, 
00070         SCENE_NODE, 
00071         PHYSICS_RIGID_CONSTRAINT, 
00072         PHYSICS_MATERIAL, 
00073         PHYSICS_RIGID_BODY, 
00074         PHYSICS_SHAPE, 
00075         PHYSICS_ANALYTICAL_GEOMETRY, 
00076         PHYSICS_MODEL, 
00077         PHYSICS_SCENE_NODE, 
00078         FORCE_FIELD, 
00079         EMITTER, 
00080         TYPE_COUNT
00081     };
00082 
00083 private:
00084     DeclareObjectType(FCDObjectWithId);
00085 
00086     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, name, FC("Name"));
00087     DeclareParameterRef(FCDExtra, extra, FC("Extra Tree"));
00088     DeclareParameterRef(FCDAsset, asset, FC("Asset Tag"));
00089     DeclareParameter(fstring, FUParameterQualifiers::SIMPLE, note, FC("Note")); // Maya and Max both support custom strings for objects.
00090 
00091 public:
00096     FCDEntity(FCDocument* document, const char* baseId = "GenericEntity");
00097 
00099     virtual ~FCDEntity();
00100 
00106     virtual Type GetType() const { return ENTITY; }
00107 
00112     const fstring& GetName() const { return name; }
00113 
00118     void SetName(const fstring& _name);
00119 
00125     FCDExtra* GetExtra() { return extra; }
00126     const FCDExtra* GetExtra() const { return extra; } 
00134     FCDAsset* GetAsset();
00135     inline const FCDAsset* GetAsset() const { return asset; } 
00140     inline void GetHierarchicalAssets(FCDAssetList& assets) { GetHierarchicalAssets(*(FCDAssetConstList*) &assets); }
00141     virtual void GetHierarchicalAssets(FCDAssetConstList& assets) const; 
00147     bool HasNote() const;
00148 
00153     const fstring& GetNote() const;
00154 
00159     void SetNote(const fstring& _note);
00160 
00167     virtual FCDEntity* FindDaeId(const fm::string& daeId) { return const_cast<FCDEntity*>(const_cast<const FCDEntity*>(this)->FindDaeId(daeId)); }
00168     virtual const FCDEntity* FindDaeId(const fm::string& daeId) const; 
00179     virtual FCDEntity* Clone(FCDEntity* clone = NULL, bool cloneChildren = false) const;
00180 
00184     static fstring CleanName(const fchar* c);
00185 };
00186 
00187 #endif // _FCD_ENTITY_H_
00188 

Generated on Thu Feb 14 16:58:34 2008 for FCollada by  doxygen 1.4.6-NO