27 #include "RTFXRecorder.h"
28 #include "RTFXHelpers.h"
31 #include "RTFXCamera.h"
32 #include "RTFXLight.h"
33 #include "RTFXGeometry.h"
34 #include "RTFXSkeleton.h"
35 #include "RTFXParticleSystem.h"
37 #include "RTFXScript.h"
38 #include "RTFXCustom.h"
71 void DeleteObjectMemoryMap();
74 void DeletePropertyMemoryMap();
77 void DeleteParentMemoryVector();
80 void DeleteChildrenMemoryVector();
83 void SetID( boost::uuids::uuid _id );
86 void SetRoot(
bool _root );
89 void SetName( std::string _name );
92 void SetDescription( std::string _description );
95 boost::uuids::uuid GetID();
101 std::string GetName();
104 std::string GetDescription();
110 bool PropertyExists( boost::uuids::uuid _id, std::string _propertyName );
113 void DeleteProperty( boost::uuids::uuid _id, std::string _propertyName );
116 RTFXProperty * GetProperty( boost::uuids::uuid _id, std::string _propertyName );
122 bool ObjectExists( boost::uuids::uuid _id );
125 bool ObjectExists( std::string _name );
128 RTFXObject * GetAnObject( boost::uuids::uuid _id );
131 RTFXObject * GetAnObject( std::string _name );
134 void DeleteObject( boost::uuids::uuid _id );
137 void DeleteObject( std::string _name );
140 void DeleteAllWithOwner( boost::uuids::uuid _id );
143 std::vector<RTFXData *> * GetParents();
146 std::vector<RTFXData *> * GetChildren();
149 void AddParent(
RTFXData * _parent );
155 RTFXData * FindParent( std::string _name );
158 RTFXData * FindChild( std::string _name );
161 void DeleteParent( std::string _name );
167 std::vector<RTFXProperty *> GetChangedProperties();
170 vector<RTFXObject *> GetNewObjects();
184 RTFXObject * FindObjectInGraph( boost::uuids::uuid _id );
188 RTFXProperty * FindPropertyNotAtObjectLevel( boost::uuids::uuid _id, std::string _propertyName );
191 RTFXData * FindChild( boost::uuids::uuid _id );
194 vector<RTFXObject *> GetAllObjects();
197 unsigned int NumberOfObjectsOfType(
unsigned int _type );
200 bool AreThereAnyObjectsOfType(
unsigned int _type );
210 RTFXBIGINT GetNumObjects();
213 boost::uuids::uuid GetObjectIDOfTypeAtIndex(
unsigned int _type,
unsigned int _idx );
217 void UpdateProcessCompleted();
220 void SetLocks(
bool _useLocks )
222 useLocks = _useLocks;
232 void RemoveObjectReferences( boost::uuids::uuid _id );
235 void RemovePropertyReferences( boost::uuids::uuid _owner,
string _name );
238 void AssignOwner( boost::uuids::uuid _owner )
241 std::map<boost::uuids::uuid, RTFXObject *>::iterator iter_ = objectMap.begin();
242 while ( iter_ != objectMap.end() )
245 if ( ( (*iter_).second )->GetOwner() == boost::uuids::nil_uuid() )
247 ( (*iter_).second )->SetOwner( _owner );
253 std::map< pair<boost::uuids::uuid, std::string>,
RTFXProperty *>::iterator iter2_ = propertyMap.begin();
254 while ( iter2_ != propertyMap.end() )
257 if ( ( (*iter2_).second )->GetOwner() == boost::uuids::nil_uuid() )
258 ( (*iter2_).second )->
SetOwner( _owner );
279 debug( ostringstream().flush() <<
"RTFXData::FindAnObject: by id - " << boost::lexical_cast<string>(_id) << endl );
280 if ( ObjectExists( _id ) )
282 ptr_ = objectMap[ _id ];
283 debug( ostringstream().flush() <<
"RTFXData::FindAnObject: object exists - " << ptr_->
GetName() << endl );
286 debug( ostringstream().flush() <<
"RTFXData::FindAnObject: by id - object not found" << endl );
297 debug( ostringstream().flush() <<
"RTFXData::FindAnObject: by name - " << _name << endl );
298 if ( ObjectExists( _name ) )
299 ptr_ = FindAnObject( objectMapByName[ _name ] );
301 debug( ostringstream().flush() <<
"RTFXData::FindAnObject: by name - object not found" << endl );
310 boost::uuids::uuid
id;
344 friend class boost::serialization::access;
346 template<
class Archive>
347 void serialize( Archive &_ar,
const unsigned int _version )
349 _ar &
id & isRoot & name & description;
350 _ar & objectMap & objectMapByName;
351 _ar & propertyMap & children & listOfObjectIdsByType;
359 RTFXAPI
void Serialize( RTFXData * _graph,
string &_output );
368 RTFXAPI
void SerializeText( RTFXData * _graph,
string &_output );