mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -16,71 +16,65 @@ class ModelReaderPtr;
|
||||
|
||||
namespace feature
|
||||
{
|
||||
class DataHeader
|
||||
class DataHeader
|
||||
{
|
||||
public:
|
||||
/// @note An order is important here, @see Load function.
|
||||
enum class MapType : uint8_t
|
||||
{
|
||||
public:
|
||||
/// @note An order is important here, @see Load function.
|
||||
enum class MapType : uint8_t
|
||||
{
|
||||
World,
|
||||
WorldCoasts,
|
||||
Country
|
||||
};
|
||||
|
||||
/// Max possible geometry scales. @see arrays in feature_impl.hpp
|
||||
static constexpr size_t kMaxScalesCount = 4;
|
||||
|
||||
DataHeader() = default;
|
||||
explicit DataHeader(std::string const & fileName);
|
||||
explicit DataHeader(FilesContainerR const & cont);
|
||||
|
||||
inline void SetGeometryCodingParams(serial::GeometryCodingParams const & cp)
|
||||
{
|
||||
m_codingParams = cp;
|
||||
}
|
||||
|
||||
inline serial::GeometryCodingParams const & GetDefGeometryCodingParams() const
|
||||
{
|
||||
return m_codingParams;
|
||||
}
|
||||
|
||||
serial::GeometryCodingParams GetGeometryCodingParams(int scaleIndex) const;
|
||||
|
||||
m2::RectD GetBounds() const;
|
||||
void SetBounds(m2::RectD const & r);
|
||||
|
||||
template <size_t N>
|
||||
void SetScales(int const (&arr)[N])
|
||||
{
|
||||
m_scales.assign(arr, arr + N);
|
||||
}
|
||||
|
||||
size_t GetScalesCount() const { return m_scales.size(); }
|
||||
int GetScale(size_t i) const { return static_cast<int>(m_scales[i]); }
|
||||
int GetLastScale() const { return m_scales.back(); }
|
||||
|
||||
std::pair<int, int> GetScaleRange() const;
|
||||
|
||||
void Save(FileWriter & w) const;
|
||||
void Load(FilesContainerR const & cont);
|
||||
|
||||
void SetType(MapType t) { m_type = t; }
|
||||
MapType GetType() const { return m_type; }
|
||||
|
||||
private:
|
||||
void Load(ModelReaderPtr const & r);
|
||||
|
||||
MapType m_type = MapType::World;
|
||||
|
||||
serial::GeometryCodingParams m_codingParams;
|
||||
|
||||
// Rect around region border. Features which cross region border may cross this rect.
|
||||
std::pair<int64_t, int64_t> m_bounds;
|
||||
|
||||
buffer_vector<uint8_t, kMaxScalesCount> m_scales;
|
||||
// Is not used now (see data/countries_meta.txt). Can be reused for something else.
|
||||
buffer_vector<uint8_t, 2> m_langs;
|
||||
World,
|
||||
WorldCoasts,
|
||||
Country
|
||||
};
|
||||
|
||||
std::string DebugPrint(DataHeader::MapType type);
|
||||
/// Max possible geometry scales. @see arrays in feature_impl.hpp
|
||||
static constexpr size_t kMaxScalesCount = 4;
|
||||
|
||||
DataHeader() = default;
|
||||
explicit DataHeader(std::string const & fileName);
|
||||
explicit DataHeader(FilesContainerR const & cont);
|
||||
|
||||
inline void SetGeometryCodingParams(serial::GeometryCodingParams const & cp) { m_codingParams = cp; }
|
||||
|
||||
inline serial::GeometryCodingParams const & GetDefGeometryCodingParams() const { return m_codingParams; }
|
||||
|
||||
serial::GeometryCodingParams GetGeometryCodingParams(int scaleIndex) const;
|
||||
|
||||
m2::RectD GetBounds() const;
|
||||
void SetBounds(m2::RectD const & r);
|
||||
|
||||
template <size_t N>
|
||||
void SetScales(int const (&arr)[N])
|
||||
{
|
||||
m_scales.assign(arr, arr + N);
|
||||
}
|
||||
|
||||
size_t GetScalesCount() const { return m_scales.size(); }
|
||||
int GetScale(size_t i) const { return static_cast<int>(m_scales[i]); }
|
||||
int GetLastScale() const { return m_scales.back(); }
|
||||
|
||||
std::pair<int, int> GetScaleRange() const;
|
||||
|
||||
void Save(FileWriter & w) const;
|
||||
void Load(FilesContainerR const & cont);
|
||||
|
||||
void SetType(MapType t) { m_type = t; }
|
||||
MapType GetType() const { return m_type; }
|
||||
|
||||
private:
|
||||
void Load(ModelReaderPtr const & r);
|
||||
|
||||
MapType m_type = MapType::World;
|
||||
|
||||
serial::GeometryCodingParams m_codingParams;
|
||||
|
||||
// Rect around region border. Features which cross region border may cross this rect.
|
||||
std::pair<int64_t, int64_t> m_bounds;
|
||||
|
||||
buffer_vector<uint8_t, kMaxScalesCount> m_scales;
|
||||
// Is not used now (see data/countries_meta.txt). Can be reused for something else.
|
||||
buffer_vector<uint8_t, 2> m_langs;
|
||||
};
|
||||
|
||||
std::string DebugPrint(DataHeader::MapType type);
|
||||
} // namespace feature
|
||||
|
||||
Reference in New Issue
Block a user