/[ascend]/trunk/pygtk/curve.cpp
ViewVC logotype

Annotation of /trunk/pygtk/curve.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 175 - (hide annotations) (download) (as text)
Tue Jan 10 04:27:34 2006 UTC (19 years, 11 months ago) by johnpye
Original Path: trunk/pygtk/interface/curve.cpp
File MIME type: text/x-c++src
File size: 894 byte(s)
More work on adding plotting capability under PyGTK
1 johnpye 175 #include "curve.h"
2    
3     #include <compiler/plot.h>
4    
5     using namespace std;
6    
7     Curve::Curve(const Instanc &i) : Instanc(i){
8     cerr << "Created curve";
9    
10     // may through 'child not found'...
11     Instanc point_array = getChild(PLOT_POINT);
12    
13     vector<Instanc> pa = point_array.getChildren();
14     vector<Instanc>::iterator pai;
15    
16     for(pai = pa.begin(); pai < pa.end() ; ++pai){
17     Instanc xinst = pai->getChild(PLOT_XPOINT);
18     Instanc yinst = pai->getChild(PLOT_YPOINT);
19     if(xinst.isAssigned() && yinst.isAssigned()){
20     x.push_back(xinst.getRealValue());
21     y.push_back(yinst.getRealValue());
22     }
23     }
24     }
25    
26     Curve::Curve(const Curve &old) : Instanc(old.getInternalType()){
27     x = old.x;
28     y = old.y;
29     }
30    
31     Curve::Curve(){
32     throw runtime_error("Explicit empty curve");
33     }
34    
35     const string
36     Curve::getLegend() const{
37     Instanc li = getChild(PLOT_LEGEND);
38     if(li.isAssigned()){
39     return li.getSymbolValue().toString();
40     }
41     return "";
42     }

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22