gwnavruntime/navdata/navdataindex.h Source File
Go to the documentation of this file.
21 class NavDataDescriptor
26 NavDataDescriptor() {}
27 const char* GetFileName()
const {
return m_fileName.GetValues(); }
29 BlobArray<char> m_fileName;
35 SwapEndianness(e,
self.m_fileName);
36 SwapEndianness(e,
self.m_guid);
37 SwapEndianness(e,
self.m_boundingBox);
44 KY_ROOT_BLOB_CLASS(NavData, NavDataIndex, 0)
48 KyUInt32 GetDescriptorsCount()
const {
return m_descriptors.GetCount(); }
49 const NavDataDescriptor& GetDescriptor(
KyUInt32 index)
const {
return m_descriptors.GetValues()[index]; }
50 BlobArray<NavDataDescriptor> m_descriptors;
55 SwapEndianness(e,
self.m_descriptors);
58 class NavDataIndexLoader
63 static Ptr<BlobHandler<NavDataIndex> > LoadNavDataIndex(const
char* fileName, FileOpenerBase* fileOpener =
nullptr)
65 Ptr<File> file = DefaultFileOpener(fileOpener).OpenFile(fileName,
OpenMode_Read);
68 KY_LOG_ERROR((
"Could not open file [%s]", fileName));
72 BlobAggregate blobAggregate;
73 if (blobAggregate.Load(file, MemStat_Blob,
nullptr, BLOB_AGGREGATE_IGNORE_UNKNOWN_BLOBTYPES) ==
KY_ERROR)
76 BlobAggregate::Collection<NavDataIndex> collection = blobAggregate.GetCollection<NavDataIndex>();
78 if (collection.GetCount() == 0)
80 KY_LOG_ERROR((
"File [%s] does not contain any NavDataIndex", fileName));
84 if (collection.GetCount() > 1)
86 KY_LOG_ERROR((
"ERROR: File [%s] does contains more than 1 NavDataIndex", fileName));
90 return collection.GetHandler(0);
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
Opens the file for reading only.
Definition: fileopener.h:25
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
#define KY_ERROR
use result == KY_ERROR to test for error
Definition: types.h:132