gwnavruntime/collision/collisiondataindex.h Source File

collisiondataindex.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 // primary contact: JAPA - secondary contact: GUAL
9 #ifndef Navigation_ColDataIndex_H
10 #define Navigation_ColDataIndex_H
11 
17 
18 namespace Kaim
19 {
20 
21 class FileOpenerBase;
22 
23 class ColDataDescriptor
24 {
25  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_CollisionData)
26  KY_CLASS_WITHOUT_COPY(ColDataDescriptor)
27 public:
28  ColDataDescriptor() {}
29  const char* GetFileName() const { return m_fileName.GetValues(); }
30 
31  BlobArray<char> m_fileName;
32  KyGuid m_guid;
33  Box2f m_boundingBox;
34 };
35 inline void SwapEndianness(Endianness::Target e, ColDataDescriptor& self)
36 {
37  SwapEndianness(e, self.m_fileName);
38  SwapEndianness(e, self.m_guid);
39  SwapEndianness(e, self.m_boundingBox);
40 }
41 
42 
43 class ColDataIndex
44 {
45  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_CollisionData)
46  KY_ROOT_BLOB_CLASS(CollisionData, ColDataIndex, 0)
47  KY_CLASS_WITHOUT_COPY(ColDataIndex)
48 public:
49  ColDataIndex() {}
50  KyUInt32 GetDescriptorsCount() const { return m_descriptors.GetCount(); }
51  const ColDataDescriptor& GetDescriptor(KyUInt32 index) const { return m_descriptors.GetValues()[index]; }
52  BlobArray<ColDataDescriptor> m_descriptors;
53 };
54 
55 inline void SwapEndianness(Endianness::Target e, ColDataIndex& self)
56 {
57  SwapEndianness(e, self.m_descriptors);
58 }
59 
60 class ColDataIndexLoader
61 {
62  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_CollisionData)
63 
64 public:
65  static Ptr< BlobHandler<ColDataIndex> > LoadColDataIndex(const char* filename, FileOpenerBase* fileOpener = KY_NULL);
66 };
67 
68 
69 } // namespace Kaim
70 
71 #endif
#define KY_NULL
Null value.
Definition: types.h:247
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36