NEURON
shapeplt.h
Go to the documentation of this file.
1 #ifndef shapeplot_h
2 #define shapeplot_h
3 
4 
5 #if HAVE_IV
6 #include "shape.h"
7 #endif
8 
9 struct Symbol;
10 class ShapePlotImpl;
11 class SectionList;
12 
13 
15  public:
16  virtual void scale(float min, float max) = 0;
17  virtual const char* varname() const = 0;
18  virtual void* varobj() const = 0;
19  virtual void varobj(void* obj) = 0;
20  virtual void variable(Symbol*) = 0;
21  virtual float low() = 0;
22  virtual float high() = 0;
23  virtual Object* neuron_section_list() = 0;
24  virtual bool has_iv_view() = 0;
25 };
26 
28  public:
30  virtual ~ShapePlotData();
31  virtual void scale(float min, float max);
32  virtual const char* varname() const;
33  virtual void* varobj() const;
34  virtual void varobj(void* obj);
35  virtual void variable(Symbol*);
36  virtual float low();
37  virtual float high();
38  virtual Object* neuron_section_list();
39  virtual bool has_iv_view();
40 
41  private:
43  float lo, hi;
45  void* py_var_;
46 };
47 
48 #if HAVE_IV
49 class ShapePlot: public ShapeScene, public ShapePlotInterface {
50  public:
51  enum { TIME = ShapeScene::EXTRASHAPETOOL, SPACE, SHAPE };
52  ShapePlot(Symbol* = NULL, SectionList* = NULL);
53  virtual ~ShapePlot();
54  virtual void observe(SectionList* = NULL);
55  virtual void erase_all();
56  virtual void draw(Canvas*, const Allocation&) const;
57  virtual void variable(Symbol*);
58  virtual const char* varname() const;
59  virtual void* varobj() const;
60  virtual void varobj(void* obj);
61 
62  virtual void scale(float min, float max);
63  virtual void save_phase1(std::ostream&);
64 
65  virtual void shape_plot();
66 
67  virtual void make_time_plot(Section*, float x);
68  virtual void make_space_plot(Section* s1, float x1, Section* s2, float x2);
69  virtual void flush();
70  virtual void fast_flush();
71  virtual float low();
72  virtual float high();
73  virtual bool has_iv_view();
74  virtual Object* neuron_section_list();
75  void update_ptrs();
76  void has_iv_view(bool);
77 
78  private:
79  ShapePlotImpl* spi_;
80  Object* sl_;
81  bool has_iv_view_;
82  void* py_var_;
83 };
84 
85 class ColorValue: public Resource, public Observable {
86  public:
87  ColorValue();
88  virtual ~ColorValue();
89  void set_scale(float low, float high);
90  const Color* get_color(float) const;
91  const Color* no_value() const;
92  float low() const {
93  return low_;
94  }
95  float high() const {
96  return high_;
97  }
98  Glyph* make_glyph();
99  void colormap(int size, bool global = false);
100  void colormap(int index, int red, int green, int blue);
101 
102  private:
103  float low_, high_;
104  int csize_;
105  const Color** crange_;
106 };
107 
108 class Hinton: public Observer, public FastShape {
109  public:
110  Hinton(double*, Coord xsize, Coord ysize, ShapeScene*);
111  virtual ~Hinton();
112  virtual void request(Requisition&) const;
113  virtual void allocate(Canvas*, const Allocation&, Extension&);
114  virtual void draw(Canvas*, const Allocation&) const;
115  virtual void fast_draw(Canvas*, Coord x, Coord y, bool) const;
116  virtual void update(Observable*);
117 
118  private:
119  double* pd_;
120  const Color* old_;
121  Coord xsize_, ysize_;
122  ShapeScene* ss_;
123 };
124 #endif
125 #endif
#define Color
Definition: _defines.h:74
#define Canvas
Definition: _defines.h:65
#define Coord
Definition: _defines.h:19
#define Glyph
Definition: _defines.h:132
short index
Definition: cabvars.h:10
virtual void fast_draw(Canvas *, Coord x, Coord y, bool) const =0
void update_ptrs()
virtual void save_phase1(std::ostream &)
virtual void draw(Canvas *, const Allocation &) const
virtual const char * varname() const
Definition: shapeplt.cpp:1286
ShapePlotData(Symbol *=NULL, Object *=NULL)
Definition: shapeplt.cpp:1249
virtual ~ShapePlotData()
Definition: shapeplt.cpp:1258
virtual Object * neuron_section_list()
Definition: shapeplt.cpp:1293
float hi
Definition: shapeplt.h:43
Symbol * sym_
Definition: shapeplt.h:42
virtual float low()
Definition: shapeplt.cpp:1268
Object * sl_
Definition: shapeplt.h:44
virtual bool has_iv_view()
Definition: shapeplt.cpp:1264
float lo
Definition: shapeplt.h:43
virtual void scale(float min, float max)
Definition: shapeplt.cpp:1276
void * py_var_
Definition: shapeplt.h:45
virtual float high()
Definition: shapeplt.cpp:1272
virtual void variable(Symbol *)
Definition: shapeplt.cpp:1281
virtual void * varobj() const
Definition: shapeplt.cpp:445
virtual void variable(Symbol *)=0
virtual const char * varname() const =0
virtual Object * neuron_section_list()=0
virtual bool has_iv_view()=0
virtual float low()=0
virtual void * varobj() const =0
virtual void scale(float min, float max)=0
virtual void varobj(void *obj)=0
virtual float high()=0
virtual void observe(SectionList *=NULL)
virtual void flush()
@ EXTRASHAPETOOL
Definition: shape.h:27
virtual void erase_all()
static void update(NrnThread *)
Definition: fadvance.cpp:597
#define SPACE
Definition: fmenu.cpp:133
#define min(a, b)
Definition: matrix.h:157
#define max(a, b)
Definition: matrix.h:154
static double fast_flush(void *v)
Definition: shapeplt.cpp:59
#define NULL
Definition: sptree.h:16
Definition: hocdec.h:227
Definition: model.h:57