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_INSTANCE_H_ 00018 #define _FCD_ENTITY_INSTANCE_H_ 00019 00020 class FCDocument; 00021 class FCDEntity; 00022 00023 #include "FCDocument/FCDObject.h" 00024 #include "FCDocument/FCDEntity.h" 00025 00034 class FCOLLADA_EXPORT FCDEntityInstance : public FCDObject 00035 { 00036 public: 00039 enum Type 00040 { 00041 SIMPLE, 00043 EXTERNAL_REFERENCE, 00044 GEOMETRY, 00045 MATERIAL, 00046 PHYSICS_MODEL, 00047 PHYSICS_RIGID_BODY, 00048 PHYSICS_RIGID_CONSTRAINT 00049 }; 00050 00051 private: 00052 DeclareObjectType; 00053 FCDEntity* entity; 00054 00055 public: 00062 FCDEntityInstance(FCDocument* document, FCDEntity* entity = NULL); 00063 00067 virtual ~FCDEntityInstance(); 00068 00072 virtual Type GetType() const { return SIMPLE; } 00073 00076 inline FCDEntity* GetEntity() { return entity; } 00077 inline const FCDEntity* GetEntity() const { return entity; } 00083 virtual FUStatus LoadFromXML(xmlNode* UNUSED(instanceNode)) { return FUStatus(true); } 00084 00088 virtual xmlNode* WriteToXML(xmlNode* parentNode) const; 00089 00090 protected: 00094 inline void SetEntity(FCDEntity* _entity) { entity = _entity; } 00095 00099 static const char* GetInstanceClassType(FCDEntity::Type type); 00100 }; 00101 00102 #endif // _FCD_ENTITY_INSTANCE_H_