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