1/*
2 * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved.
3 *
4 * NVIDIA CORPORATION and its licensors retain all intellectual property
5 * and proprietary rights in and to this software, related documentation
6 * and any modifications thereto. Any use, reproduction, disclosure or
7 * distribution of this software and related documentation without an express
8 * license agreement from NVIDIA CORPORATION is strictly prohibited.
9 */
10// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
11// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
12
13
14
15#ifndef PX_REPX_SIMPLE_TYPE_H
16#define PX_REPX_SIMPLE_TYPE_H
17
18/** \addtogroup extensions
19 @{
20*/
21
22#include "foundation/PxSimpleTypes.h"
23#include "cooking/PxCooking.h"
24#include "common/PxStringTable.h"
25#include "common/PxSerialFramework.h"
26
27#ifndef PX_DOXYGEN
28namespace physx
29{
30#endif
31
32 /**
33 \brief Helper class containing the mapping of id to object, and type name.
34 */
35 struct PxRepXObject
36 {
37 /**
38 \brief Identifies the extension meant to handle this object.
39 @see PxTypeInfo, PX_DEFINE_TYPEINFO, PxRepXSerializer
40 */
41 const char* typeName;
42
43 /**
44 \brief Pointer to the serializable this was created from
45 */
46 const void* serializable;
47
48 /**
49 \brief Id given to this object at some point
50 */
51 PxSerialObjectId id;
52 PxRepXObject( const char* inTypeName = "", const void* inSerializable = NULL, const PxSerialObjectId inId = 0 )
53 : typeName( inTypeName )
54 , serializable( inSerializable )
55 , id( inId )
56 {
57 }
58 bool isValid() const { return serializable != NULL; }
59 };
60
61 /**
62 \brief Arguments required to instantiate a serializable object from RepX.
63
64 Extra arguments can be added to the object map under special ids.
65
66 @see PxRepXSerializer::objectToFile, PxRepXSerializer::fileToObject
67 */
68 struct PxRepXInstantiationArgs
69 {
70 PxPhysics& physics;
71 PxCooking* cooker;
72 PxStringTable* stringTable;
73 PxRepXInstantiationArgs( PxPhysics& inPhysics, PxCooking* inCooking = NULL , PxStringTable* inStringTable = NULL )
74 : physics( inPhysics )
75 , cooker( inCooking )
76 , stringTable( inStringTable )
77 {
78 }
79
80 PxRepXInstantiationArgs& operator=(const PxRepXInstantiationArgs&);
81 };
82
83
84#ifndef PX_DOXYGEN
85} // namespace physx
86#endif
87
88/** @} */
89#endif
90