00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef PX_SERIALIZATION_H
00032 #define PX_SERIALIZATION_H
00033
00037 #include "PxPhysXConfig.h"
00038 #include "common/PxBase.h"
00039 #include "cooking/PxCooking.h"
00040 #include "foundation/PxIO.h"
00041 #include "common/PxTolerancesScale.h"
00042 #include "common/PxTypeInfo.h"
00043 #include "common/PxStringTable.h"
00044
00045
00046
00047
00048
00058 #define PX_BINARY_SERIAL_VERSION 0
00059
00060
00061 #if !PX_DOXYGEN
00062 namespace physx
00063 {
00064 #endif
00065
00071 class PxSerialization
00072 {
00073 public:
00081 struct PxXmlMiscParameter
00082 {
00086 PxVec3 upVector;
00087
00091 PxTolerancesScale scale;
00092
00093 PxXmlMiscParameter() : upVector(0) {}
00094 PxXmlMiscParameter(PxVec3& inUpVector, PxTolerancesScale inScale) : upVector(inUpVector), scale(inScale) {}
00095 };
00096
00121 static bool isSerializable(PxCollection& collection, PxSerializationRegistry& sr, const PxCollection* externalReferences = NULL);
00122
00151 static void complete(PxCollection& collection, PxSerializationRegistry& sr, const PxCollection* exceptFor = NULL, bool followJoints = false);
00152
00163 static void createSerialObjectIds(PxCollection& collection, const PxSerialObjectId base);
00164
00178 static PxCollection* createCollectionFromXml(PxInputData& inputData, PxCooking& cooking, PxSerializationRegistry& sr, const PxCollection* externalRefs = NULL, PxStringTable* stringTable = NULL, PxXmlMiscParameter* outArgs = NULL);
00179
00197 static PxCollection* createCollectionFromBinary(void* memBlock, PxSerializationRegistry& sr, const PxCollection* externalRefs = NULL);
00198
00217 static bool serializeCollectionToXml(PxOutputStream& outputStream, PxCollection& collection, PxSerializationRegistry& sr, PxCooking* cooking = NULL, const PxCollection* externalRefs = NULL, PxXmlMiscParameter* inArgs = NULL);
00218
00241 static bool serializeCollectionToBinary(PxOutputStream& outputStream, PxCollection& collection, PxSerializationRegistry& sr, const PxCollection* externalRefs = NULL, bool exportNames = false );
00242
00257 static void dumpBinaryMetaData(PxOutputStream& outputStream, PxSerializationRegistry& sr);
00258
00264 static PxBinaryConverter* createBinaryConverter();
00265
00275 static PxSerializationRegistry* createSerializationRegistry(PxPhysics& physics);
00276 };
00277
00278 #if !PX_DOXYGEN
00279 }
00280 #endif
00281
00283 #endif