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