All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
PlaceNamesBuilder.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "PlaceNames.h"
6 #include "IResourceBuilder.h"
7 #include "Types.h"
8 #include "Streaming.h"
9 #include "Space.h"
10 #include "ChunkedFileFormat.h"
11 #include "Interiors.h"
12 #include "Fonts.h"
13 #include "Labels.h"
14 #include <vector>
15 
16 namespace Eegeo
17 {
18  namespace Resources
19  {
20  namespace PlaceNames
21  {
23  {
24  public:
26  PlaceNamesController& placeNamesController,
27  PlaceNameViewBuilder& placeNameViewBuilder,
29  PlaceNameLabelBuilder& placeNameLabelBuilder,
30  Labels::ILabelCellResourceObserver& labelCellResourceObserver,
31  const Fonts::FontInstance& fontInstance,
32  const bool buildLabels,
33  const bool enableInteriorMarkers
34  );
35 
36  virtual ~PlaceNamesBuilder();
37  virtual bool Flush(const Streaming::MortonKey& key, void* input, TBuiltResources& result);
38  virtual void DestroyBuiltResource(const Streaming::MortonKey& key, void* input);
39  virtual void* BuildResource(const Streaming::MortonKey& key, const Byte* data, size_t length);
40 
41  virtual bool AcceptsErroredRequests()
42  {
43  return false;
44  }
45 
46  private:
47 
48  bool CreatePlaceNamesLabelCellFromChunkStream(const Streaming::MortonKey& key, Eegeo::IO::ChunkedFileFormat::ChunkStream& chunkStream, std::vector<const Labels::LabelCellModel*>& output);
49  PlaceNamesCell* CreatePlaceNamesCellFromChunkStream(const Streaming::MortonKey& key, Eegeo::IO::ChunkedFileFormat::ChunkStream& chunkStream);
50 
51  PlaceNamesController& m_placeNamesController;
52  PlaceNameViewBuilder& m_placeNameViewBuilder;
53  PlaceNameLabelBuilder& m_placeNameLabelBuilder;
54  const Fonts::FontInstance& m_fontInstance;
55  std::vector<u32> m_utf32Scratch;
56  const bool m_enableInteriorMarkers;
57 
58  Labels::ILabelCellResourceObserver& m_labelCellResourceObserver;
59  const bool m_buildLabels;
60 
62 
63  PlaceNameModel* BuildPlaceNameModel(const Eegeo::Space::CubeMap::CubeMapCellInfo& cellInfo, const PlaceNameData& placeNameData);
64  };
65  }
66  }
67 }