Welcome to mirror list, hosted at ThFree Co, Russian Federation.

data_header.hpp « indexer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 88d5c72f5d8f11e7f80ec800667d8bf338c3ee78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#pragma once

#include "geometry_serialization.hpp"

#include "../geometry/rect2d.hpp"

#include "../std/array.hpp"

#include "../base/start_mem_debug.hpp"


class ModelReaderPtr;
class FileWriter;

namespace feature
{
  /// All file sizes are in bytes
  class DataHeader
  {
    serial::CodingParams m_codingParams;

    pair<int64_t, int64_t> m_bounds;

    array<uint8_t, 4> m_scales;

  public:
    DataHeader();

    /// Zero all fields
    void Reset();

    void SetCodingParams(serial::CodingParams const & params) { m_codingParams = params; }
    serial::CodingParams const & GetCodingParams() const { return m_codingParams; }

    m2::RectD const GetBounds() const;
    void SetBounds(m2::RectD const & r);

    void SetScales(int * arr);
    size_t GetScalesCount() const { return m_scales.size(); }
    int GetScale(int i) const { return m_scales[i]; }
    pair<int, int> GetScaleRange() const;

    /// @name Serialization
    //@{
    void Save(FileWriter & w) const;
    void Load(ModelReaderPtr const & r);
    //@}
  };
}

#include "../base/stop_mem_debug.hpp"