File: tickset.h

package info (click to toggle)
aoflagger 3.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,000 kB
  • sloc: cpp: 67,891; python: 497; sh: 242; makefile: 22
file content (41 lines) | stat: -rw-r--r-- 844 bytes parent folder | download | duplicates (2)
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
#ifndef TICKSET_H
#define TICKSET_H

#include <string>

#ifndef HAVE_EXP10
#define exp10(x) exp((2.3025850929940456840179914546844) * (x))
#endif

typedef std::pair<double, std::string> Tick;

class TickSet {
 public:
  TickSet() {}
  virtual ~TickSet() {}

  virtual size_t Size() const = 0;
  virtual Tick GetTick(size_t i) const = 0;

  virtual std::unique_ptr<TickSet> Clone() const = 0;

  virtual void DecreaseTicks() {
    if (Size() > 1) {
      Set(Size() - 1);
    }
  }
  virtual void Set(size_t maxSize) = 0;
  virtual void Reset() = 0;
  /**
   * Returns a value scaled according to the axis.
   * Values that are within the min and max will have an axis value of
   * 0 to 1.
   */
  virtual double UnitToAxis(double unitValue) const = 0;
  virtual double AxisToUnit(double axisValue) const = 0;

 protected:
 private:
};

#endif