NEURON
axis.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <InterViews/observe.h>
4 #include <InterViews/glyph.h>
5 
6 class Scene;
7 
8 class Axis: public Glyph, public Observer {
9  public:
14  Coord x1,
15  Coord x2,
16  Coord pos,
17  int ntic = 1,
18  int nminor = 0,
19  int invert = 0,
20  bool number = true);
21  virtual ~Axis();
22  virtual void save(std::ostream&);
23  virtual void update(Observable*);
24  virtual void size(float&, float&);
25 
26  private:
27  void init(Coord x1,
28  Coord x2,
29  Coord pos = 0.,
30  int ntic = 1,
31  int nminor = 0,
32  int invert = 0,
33  bool number = true);
34  bool set_range();
35  void install();
36  void location();
37 
38  private:
42  double amin_, amax_;
43  int ntic_, nminor_;
44  int invert_;
45  bool number_;
47 };
48 
49 class BoxBackground: public Background {
50  public:
52  virtual ~BoxBackground();
53 
54  virtual void draw(Canvas*, const Allocation&) const;
55  virtual void print(Printer*, const Allocation&) const;
56 
57  private:
58  void draw_help(Canvas*, const Allocation&) const;
59  void tic_label(Coord x, Coord y, Coord val, float x_align, float y_align, Canvas*) const;
60 };
61 
62 class AxisBackground: public Background {
63  public:
65  virtual ~AxisBackground();
66 
67  virtual void draw(Canvas*, const Allocation&) const;
68  virtual void print(Printer*, const Allocation&) const;
69 
70  private:
71  void draw_help(Canvas*, const Allocation&) const;
72  void tic_label(Coord x, Coord y, Coord val, float x_align, float y_align, Canvas*) const;
73 };
#define Background
Definition: _defines.h:41
#define Canvas
Definition: _defines.h:63
#define Coord
Definition: _defines.h:17
#define Printer
Definition: _defines.h:209
#define Glyph
Definition: _defines.h:130
void draw_help(Canvas *, const Allocation &) const
void tic_label(Coord x, Coord y, Coord val, float x_align, float y_align, Canvas *) const
virtual void print(Printer *, const Allocation &) const
virtual void draw(Canvas *, const Allocation &) const
virtual ~AxisBackground()
Definition: axis.h:8
virtual void save(std::ostream &)
Axis(Scene *, DimensionName, Coord x1, Coord x2, Coord pos, int ntic=1, int nminor=0, int invert=0, bool number=true)
int ntic_
Definition: axis.h:43
Axis(Scene *, DimensionName, Coord x1, Coord x2)
double amin_
Definition: axis.h:42
double amax_
Definition: axis.h:42
int invert_
Definition: axis.h:44
void location()
virtual void update(Observable *)
virtual ~Axis()
void install()
DimensionName d_
Definition: axis.h:41
Coord min_
Definition: axis.h:40
Coord pos_
Definition: axis.h:46
bool number_
Definition: axis.h:45
Axis(Scene *, DimensionName)
virtual void size(float &, float &)
Coord max_
Definition: axis.h:40
Scene * s_
Definition: axis.h:39
int nminor_
Definition: axis.h:43
bool set_range()
void init(Coord x1, Coord x2, Coord pos=0., int ntic=1, int nminor=0, int invert=0, bool number=true)
virtual void draw(Canvas *, const Allocation &) const
virtual ~BoxBackground()
void tic_label(Coord x, Coord y, Coord val, float x_align, float y_align, Canvas *) const
virtual void print(Printer *, const Allocation &) const
void draw_help(Canvas *, const Allocation &) const
unsigned int DimensionName
Definition: geometry.h:36
invert
Definition: extdef.h:9