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: 979b258c39e6ab535d3cf16767cc544fdfd2238d (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
#pragma once

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

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

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


class FileReader;
class FileWriter;

namespace feature
{   
  /// All file sizes are in bytes
  class DataHeader
  {
    int64_t m_base;

    pair<int64_t, int64_t> m_bounds;

    array<uint8_t, 4> m_scales;

  public:
    DataHeader();

    /// Zero all fields
    void Reset();

    void SetBase(m2::PointD const & p);
    int64_t GetBase() const { return m_base; }

    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]; }

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

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