mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
committed by
Konstantin Pastbin
parent
c9cbb64f12
commit
76ffc99abd
32
libs/drape_frontend/custom_features_context.hpp
Normal file
32
libs/drape_frontend/custom_features_context.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "indexer/feature_decl.hpp"
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
namespace df
|
||||
{
|
||||
using CustomFeatures = std::map<FeatureID, bool>;
|
||||
|
||||
struct CustomFeaturesContext
|
||||
{
|
||||
CustomFeatures const m_features;
|
||||
|
||||
explicit CustomFeaturesContext(CustomFeatures && features)
|
||||
: m_features(std::move(features))
|
||||
{}
|
||||
|
||||
bool NeedDiscardGeometry(FeatureID const & id) const
|
||||
{
|
||||
auto const it = m_features.find(id);
|
||||
if (it == m_features.cend())
|
||||
return false;
|
||||
return it->second;
|
||||
}
|
||||
};
|
||||
|
||||
using CustomFeaturesContextPtr = std::shared_ptr<CustomFeaturesContext>;
|
||||
using CustomFeaturesContextWeakPtr = std::weak_ptr<CustomFeaturesContext>;
|
||||
} // namespace df
|
||||
Reference in New Issue
Block a user