gwnavgeneration/input/clientinput.h Source File

clientinput.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
8 
9 
16 
17 
18 namespace Kaim
19 {
20 
21 class GeneratorSystem;
22 class File;
23 class FileOpenerBase;
24 
29 {
30  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
32 
33 public:
34  // ---------------------------------- Constructor and destructor ----------------------------------
35  ClientInput() : m_sectorGuid(KyGuid::GetInvalidGuid()), m_sys(nullptr) {}
36  ~ClientInput() { Clear(); }
37  void Clear();
38 
39  // ---------------------------------- Accessors ----------------------------------
40  const KyGuid* GetGuid() const;
41  KyUInt32 GetDatabaseIndex() const { return m_sectorDescriptor.m_databaseIndex; }
42 
43  // ---------------------------------- Save and Load from file ----------------------------------
44  KyResult Save(const char* path);
45  KyResult Load(const char* path, FileOpenerBase* fileOpener = nullptr);
46 
47  // ---------------------------------- Internals ----------------------------------
48  void Init(GeneratorSystem* sys);
49  void InitFromDynamicClientInputChunk(GeneratorSystem* sys, const DynamicClientInputChunk& dynamicClientInputChunk);
50 
51  Kaim::Box3f ComputeTrianglesBoundingBox();
52 
53 private:
54  KyResult Load(File* file);
55 
57  KyResult LoadParts(const char* fullFileName, FileOpenerBase* fileOpener);
58 
59 public:
62 
63  GeneratorAbstractGraphParameters m_abstractGraphParams;
64 
67 
68  // Information about the sector (databaseIndex)
69  ClientInputSectorDescriptor m_sectorDescriptor;
70 
71  KyArray< Ptr<BlobHandler<ClientInputChunk> > > m_clientInputChunks; //< Internal data containing the inputs
72  KyArray<ClientInputDescriptor> m_clientInputParts; //< Internal usage for buffering
73  GeneratorSystem* m_sys; //< Internal usage from within the generation
74 };
75 
76 
77 
78 }
79 
80 
81 
Base interface for a class that opens a file on disk.
Definition: fileopener.h:30
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
GeneratorSystem gathers everything that is global across a generation: configuration, options...
Definition: generatorsystem.h:45
The ClientInput is a representation of the input that was supplied to the generator for a particular ...
Definition: clientinput.h:28
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:162
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
KyResult LoadParts(const char *fullFileName, FileOpenerBase *fileOpener)
Called by Load() once the m_clientInputParts strings have been retrieved from root client Input...
Definition: clientinput.cpp:115
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
3d axis aligned box of 32bits floating points
Definition: box3f.h:16
Navigation return code class.
Definition: types.h:108
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
The KyGuid class represents a globally unique ID.
Definition: kyguid.h:20
static const KyGuid & GetInvalidGuid()
Returns the invalid KyGuid value.
Definition: kyguid.cpp:21
Easy to write/read version of ClientInputSectorDescriptorBlob.
Definition: clientinputsectordescriptor.h:34
The GeneratorParameters class contains configuration parameters that control the characteristics of t...
Definition: generatorparameters.h:67
KyGuid m_sectorGuid
The Kaim::KyGuid of the Kaim::GeneratorSector associated with this Kaim::ClientInput.
Definition: clientinput.h:66
GeneratorParameters m_globalConfig
The global config used for this Kaim::ClientInput.
Definition: clientinput.h:61
KyUInt32 m_databaseIndex
Index of the Lab's database in which the NavData will be added to.
Definition: clientinputsectordescriptor.h:64