All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorLabelAnchorCategoryMapper.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IInteriorLabelAnchorCategoryMapper.h"
6 #include "Types.h"
7 #include "Labels.h"
8 #include "LabelLayer.h"
9 #include "LabelAnchorCategory.h"
10 #include "CallbackCollection.h"
11 #include "IInteriorLabelAnchorCategoryMapperFactory.h"
12 #include "InteriorLabelAnchorCategory.h"
13 
14 #include <string>
15 #include <vector>
16 #include <unordered_map>
17 
18 
19 namespace Eegeo
20 {
21  namespace Resources
22  {
23  namespace Interiors
24  {
25  namespace Builder
26  {
28  {
29  public:
30  typedef std::unordered_map<std::string, std::string> TInteriorLabelNameToTag;
31  typedef std::unordered_multimap<std::string, std::string> TInteriorTagToLabelCategory;
32  typedef std::unordered_map<std::string, InteriorLabelAnchorCategory> TAnchorCategoryMap;
33  typedef std::vector<InteriorLabelAnchorCategory> TAnchorCategoryList;
34 
36  Labels::LabelLayer::IdType labelLayerId,
37  TInteriorLabelNameToTag& interiorLabelNameToTag,
38  TInteriorTagToLabelCategory& interiorTagToLabelCategory,
39  const TAnchorCategoryMap& labelAnchorCategories);
40 
42 
43  const Labels::LabelAnchorCategory* GetAnchorCategory(const Entities::InteriorsEntityMetadata& interiorEntityMetadata) const;
44  private:
45  const Labels::LabelAnchorCategory::IdType& GetAnchorCategoryIdFor(const Entities::InteriorsEntityMetadata& interiorEntityMetadata) const;
46 
47  const InteriorLabelAnchorCategory& GetBestCategoryForTag(const std::string& tag, const float entityPriority) const;
48 
49 
50  const std::string& GetTagFor(const Entities::InteriorsEntityMetadata& interiorEntityMetadata) const;
51  std::vector<InteriorLabelAnchorCategory> OrderedCandidatesForTag(const std::string& tag) const;
52 
53  Labels::ILabelAnchorCategoryRepository& m_labelAnchorCategoryRepository;
54  const Labels::LabelLayer::IdType m_labelLayerId;
55  const TInteriorLabelNameToTag m_interiorLabelNameToTag;
56  const TInteriorTagToLabelCategory m_interiorTagToLabelCategory;
57  TAnchorCategoryMap m_labelAnchorCategories;
58  TAnchorCategoryList m_orderedCandidatesForDefaultTag;
59 
60  const std::string m_defaultTag;
61 
62  void RegisterLabelAnchorCategories();
63  void UnregisterLabelAnchorCategories();
64  };
65  }
66  }
67  }
68 }