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

Contents of /trunk/pygtk/plot.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2061 - (show annotations) (download) (as text)
Sat Jun 27 15:23:36 2009 UTC (15 years, 3 months ago) by jpye
File MIME type: text/x-c++src
File size: 1458 byte(s)
Add legend_position parameter to plot models.
Add missing 'EXTERNAL' keyword to a4c.lang (for Andre Simon's "highlight")
1 #include "plot.h"
2 #include "curve.h"
3
4 #include <ascend/compiler/plot.h>
5 #include <stdexcept>
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 Plot::Plot(){
22 throw runtime_error("Not allowed");
23 }
24
25 Plot::Plot(const Plot &old) : Instanc(old.i), curves(old.curves){
26 //nothing
27 }
28
29 const string
30 Plot::getTitle() const{
31 return getChild(PLOT_TITLE).getValueAsString();
32 }
33
34 const string
35 Plot::getXLabel() const{
36 return getChild(PLOT_XLABEL).getValueAsString();
37 }
38
39 const string
40 Plot::getYLabel() const{
41 return getChild(PLOT_YLABEL).getValueAsString();
42 }
43
44 const int
45 Plot::getLegendPosition() const{
46 return getChild(PLOT_LEGENDPOSITION).getIntValue();
47 }
48
49 const bool
50 Plot::isXLog() const{
51 return getChild(PLOT_XLOG).getBoolValue();
52 }
53
54 const bool
55 Plot::isYLog() const{
56 return getChild(PLOT_YLOG).getBoolValue();
57 }
58
59 const double
60 Plot::getXLow() const{
61 return getChild(PLOT_XLO).getRealValue();
62 }
63
64 const double
65 Plot::getXHigh() const{
66 return getChild(PLOT_XHI).getRealValue();
67 }
68
69 const double
70 Plot::getYLow() const{
71 return getChild(PLOT_YLO).getRealValue();
72 }
73
74 const double
75 Plot::getYHigh() const{
76 return getChild(PLOT_YHI).getRealValue();
77 }
78

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