/[ascend]/trunk/pygtk/interface/plot.cpp
ViewVC logotype

Contents of /trunk/pygtk/interface/plot.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 175 - (show annotations) (download) (as text)
Tue Jan 10 04:27:34 2006 UTC (14 years, 6 months ago) by johnpye
File MIME type: text/x-c++src
File size: 1198 byte(s)
More work on adding plotting capability under PyGTK
1 #include "plot.h"
2 #include "curve.h"
3
4 #include <compiler/plot.h>
5
6 #include <iostream>
7 using namespace std;
8
9 Plot::Plot(const Instanc &i) : Instanc(i){
10 cerr << "Creating plot..." << endl;
11 // create Curve objects as required:
12
13 Instanc curve_array = getChild(PLOT_CURVE);
14 vector<Instanc> cc = curve_array.getChildren();
15 vector<Instanc>::iterator cci;
16 for(cci=cc.begin();cci<cc.end(); ++cci){
17 curves.push_back( Curve(*cci) );
18 }
19 }
20
21 const string
22 Plot::getTitle() const{
23 return getChild(PLOT_TITLE).getValueAsString();
24 }
25
26 const string
27 Plot::getXLabel() const{
28 return getChild(PLOT_XLABEL).getValueAsString();
29 }
30
31 const string
32 Plot::getYLabel() const{
33 return getChild(PLOT_YLABEL).getValueAsString();
34 }
35
36 const bool
37 Plot::isXLog() const{
38 return getChild(PLOT_XLOG).getBoolValue();
39 }
40
41 const bool
42 Plot::isYLog() const{
43 return getChild(PLOT_YLOG).getBoolValue();
44 }
45
46 const double
47 Plot::getXLow() const{
48 return getChild(PLOT_XLO).getRealValue();
49 }
50
51 const double
52 Plot::getXHigh() const{
53 return getChild(PLOT_XHI).getRealValue();
54 }
55
56 const double
57 Plot::getYLow() const{
58 return getChild(PLOT_YLO).getRealValue();
59 }
60
61 const double
62 Plot::getYHigh() const{
63 return getChild(PLOT_YHI).getRealValue();
64 }
65

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