gwnavgeneration/generator/generatorinputoutput.h Source File

generatorinputoutput.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 // primary contact: LASI - secondary contact: GUAL
8 #ifndef GwNavGen_GeneratorConfig_H
9 #define GwNavGen_GeneratorConfig_H
10 
26 
27 
28 
29 namespace Kaim
30 {
31 
35 // - the Sectors: description of all sectors in the database (typically change not very often)
39 class GeneratorInputOutput : public RefCountBaseNTS<GeneratorInputOutput, MemStat_NavDataGen>
40 {
42 
43 public:
45  void ShallowCopy(const GeneratorInputOutput& other);
46  void DeepCopy(const GeneratorInputOutput& other, GeneratorSector::ClearPointedDataMode clearPointedDataMode);
47  void Clear();
48 
49  // ---------------------------------- Save, Load, Copy, Clear Functions ----------------------------------
50 
54  KyResult Save(const char* fullFileName, FileOpenerBase* fileOpener = KY_NULL) const;
55 
60  KyResult Load(const char* fullFileName, FileOpenerBase* fileOpener = KY_NULL);
61 
62  // ---------------------------------- Add/Remove/Set Functions ----------------------------------
63 
65  void SetSectorChangeForAllSectors(GenFlags::SectorChange sectorChange);
66 
68  void SetInputSourceForAllSectors(GenFlags::SectorInputSource inputSource);
69 
72  KyResult AddSector(Ptr<GeneratorSector> sector);
73 
85  void AddExclusiveGuids(const KyGuid* guids, KyUInt32 guidsCount);
86  void AddExclusiveGuids(const GeneratorGuidCompound& generatorGuidCompound);
87 
88  // ---------------------------------- Accessors ----------------------------------
89  KyUInt32 GetSectorCount() const;
90 
92  Ptr<GeneratorSector> GetSectorWithName(const char* name);
93  Ptr<GeneratorSector> GetSectorWithGuid(const KyGuid& guid);
94 
95  const Ptr<GeneratorSector> GetSectorWithIndex(KyUInt32 index) const;
96  const Ptr<GeneratorSector> GetSectorWithName(const char* name) const;
97  const Ptr<GeneratorSector> GetSectorWithGuid(const KyGuid& guid) const;
98 
99 private:
100  void CommonCopy(const GeneratorInputOutput& other);
101 
102 public:
103  GeneratorParameters m_params; //In
104  GeneratorAbstractGraphParameters m_abstractGraphParams; //In
105  GeneratorRunOptions m_runOptions; //In
106  KyArray<GeneratorGuidCompound> m_exclusiveGuids; //In
107  GeneratorSectorList m_sectors; // In/Out
108 
109  // Out. The info contained in m_navDataIndexHandler is redundant with m_sectors
110  // but having a NavDataIndex Blob available allows to load them in a pure runtime environment
111  // that does NOT link with gwnavgeneration.lib
112  Ptr< BlobHandler<NavDataIndex> > m_navDataIndexHandler;
113 
114  // Out. The info contained in m_abstractDataIndexHandler is redundant with m_sectors
115  // but having a AbstractDataIndex Blob available allows to load them in a pure runtime environment
116  // that does NOT link with gwnavgeneration.lib
117  Ptr< BlobHandler<AbstractDataIndex> > m_abstractDataIndexHandler;
118 
119  // Out. The info contained in m_colDataIndexHandler is redundant with m_sectors
120  // but having a ColDataIndex Blob in GenIO files allows to load them in a pure runtime environment
121  // that does not link with gwnavgeneration.lib
122  Ptr< BlobHandler<ColDataIndex> > m_colDataIndexHandler;
123 
126 };
127 
128 
129 }
130 
131 
132 #endif
Base interface for a class that opens a file on disk.
Definition: fileopener.h:35
KyResult Load(const char *fullFileName, FileOpenerBase *fileOpener=0)
Load the GeneratorInputOutput from a file.
KyResult AddSector(Ptr< GeneratorSector > sector)
Use this function to Add new GeneratorSector to the list stored in the GeneratorInputOutput.
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
DatabaseDescriptor m_databaseDescriptor
Out The database description.
Definition: generatorinputoutput.h:146
KyResult Save(const char *fullFileName, FileOpenerBase *fileOpener=0) const
Save the GeneratorInputOutput in a file.
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
#define KY_NULL
Null value.
Definition: types.h:247
SectorInputSource
Describes where the Generator will get its input for each sector.
Definition: genflags.h:17
The BlobHandler class is a top-level mechanism for serializing blobs between objects in memory and fi...
Definition: blobhandler.h:45
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
void SetSectorChangeForAllSectors(GenFlags::SectorChange sectorChange)
Set sectorChange for all sectors (regular and patches)
KyUInt32 GetSectorCount() const
Returns the sector count.
void SetInputSourceForAllSectors(GenFlags::SectorInputSource inputSource)
Set inputSource for all sectors (regular and patches)
void AddExclusiveGuids(const KyGuid *guids, KyUInt32 guidsCount)
Specifies the GUIDs of sectors that cover the same areas of terrain, but that will never be loaded in...
Easy to write/read version of DatabaseDescriptorBlob.
Definition: databasedescriptor.h:38
SectorChange
Describes what the generation does about a sector.
Definition: genflags.h:28
The GeneratorSector class provides a definition for a single sector to be treated by the Generator...
Definition: generatorsector.h:46
Definition: gamekitcrowddispersion.h:20
The KyGuid class represents a globally unique ID.
Definition: kyguid.h:22
The GeneratorInputOutput class is a central element of the generation.
Definition: generatorinputoutput.h:41
The GeneratorParameters class contains configuration parameters that control the characteristics of t...
Definition: generatorparameters.h:75
The GeneratorRunOptions class contains configuration parameters that control the way in which the Gen...
Definition: generatorrunoptions.h:49
This class is a wrapper around an array of KyGuid objects.
Definition: generatorguidcompound.h:22
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
Ptr< GeneratorSector > GetSectorWithName(const char *name)
Returns the Sector with name if it exists, non const version.
Ptr< GeneratorSector > GetSectorWithGuid(const KyGuid &guid)
Returns the Sector with guid if it exists, non const version.
void Clear()
Reset members as if the object was freshly constructed.
Ptr< GeneratorSector > GetSectorWithIndex(KyUInt32 index)
Returns the Sector at index if it exists, non const version.