gwnavgeneration/generator/generatorpostprocessparameters.h Source File

generatorpostprocessparameters.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 #ifndef GwNavGen_GeneratorAbstractGraphParameters_H
9 #define GwNavGen_GeneratorAbstractGraphParameters_H
10 
15 
16 namespace Kaim
17 {
18 
19 class BlobAggregate;
20 
21 class GeneratorAbstractGraphParametersBlob
22 {
23  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
24  KY_ROOT_BLOB_CLASS(Generator, GeneratorAbstractGraphParametersBlob, 0)
25  KY_CLASS_WITHOUT_COPY(GeneratorAbstractGraphParametersBlob)
26 public:
27  GeneratorAbstractGraphParametersBlob() {}
28  BlobFieldArray m_fields;
29 };
30 inline void SwapEndianness(Endianness::Target e, GeneratorAbstractGraphParametersBlob& self)
31 {
32  SwapEndianness(e, self.m_fields);
33 }
34 
35 enum GenerateAbstractGraphs
36 {
37  GENERATE_ABSTRACTGRAPHS_DISABLE = 0, // no abstract graph generated
38  GENERATE_ABSTRACTGRAPHS_ENABLE = 1, // abstract graph generated only for sectors which did change (cf. SECTOR_CHANGED)
39  GENERATE_ABSTRACTGRAPHS_FORCE_ENABLE = 2, // abstract graph generated for all sectors even if they didn't change (cf. SECTOR_NOCHANGE)
40 };
41 
42 class GeneratorAbstractGraphParameters
43 {
44  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
45 public:
46  GeneratorAbstractGraphParameters();
47  void Clear();
48 
50  void BuildBlob(BlobHandler<GeneratorAbstractGraphParametersBlob>& handler) const;
51 
54  KyResult ReadFromAggregate(BlobAggregate& aggregate);
55 
56  KyResult ReadBlob(const GeneratorAbstractGraphParametersBlob& blob);
57 
59  void InitBlobFieldsMapping(BlobFieldsMapping& mapping);
60  void InitBlobFieldsMapping(BlobFieldsMapping& mapping) const;
61 
63  bool operator==(const GeneratorAbstractGraphParameters& other) const
64  {
65  return m_doGenerateAbstractGraphs == other.m_doGenerateAbstractGraphs
66  && m_extentsInNumberOfCells == other.m_extentsInNumberOfCells;
67  }
68 
70  bool operator!=(const GeneratorAbstractGraphParameters& other) const { return !operator==(other); }
71 
72 public:
75  KyUInt32 m_doGenerateAbstractGraphs;
78  KyUInt32 m_extentsInNumberOfCells;
80  KyUInt32 m_workingMemorySizeLimit;
81 };
82 
83 
84 template <class OSTREAM>
85 inline OSTREAM& operator<<(OSTREAM& os, GeneratorAbstractGraphParameters& params)
86 {
87  BlobFieldsMapping mapping;
88  params.InitBlobFieldsMapping(mapping);
89 
90  os << KY_LOG_SMALL_TITLE_BEGIN("", "GeneratorAbstractGraphParameters Info");
91  os << mapping;
92  os << KY_LOG_SMALL_TITLE_END("", "GeneratorAbstractGraphParameters Info");
93  return os;
94 }
95 
96 
97 class GeneratorPostProcessParametersBlobBuilder : public BaseBlobBuilder<GeneratorAbstractGraphParametersBlob>
98 {
99 public:
100  GeneratorPostProcessParametersBlobBuilder(const GeneratorAbstractGraphParameters* params)
101  : m_params(params)
102  {}
103 
104 private:
105  virtual void DoBuild();
106 
107  const GeneratorAbstractGraphParameters* m_params;
108 };
109 
110 } // namespace Kaim
111 
112 
113 #endif
114 
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
#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