00001
00002
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00030
00031
00032
00033
00034
00035
00036 #include "AIDA_PlotterLayout.h"
00037 #include "GracePlotter/Layout.h"
00038
00039 #include <iostream>
00040
00041
00042 namespace Anaphe {
00043 namespace AIDA_Plotter_Grace {
00044
00045
00046
00048
00049
00050
00052
00053 AIDA_PlotterLayout::AIDA_PlotterLayout()
00054 : rep(0),
00055 ownRep(false)
00056 {
00057
00058 }
00059
00060
00061
00062 AIDA_PlotterLayout::AIDA_PlotterLayout(Layout* x, bool b)
00063 : rep(x),
00064 ownRep(b)
00065 {
00066
00067 }
00068
00069
00070
00071
00072 AIDA_PlotterLayout::~AIDA_PlotterLayout()
00073 {
00074 if (ownRep) delete rep;
00075 }
00076
00077
00078
00079
00080
00082
00083
00084
00086
00087 void AIDA_PlotterLayout::reset()
00088 {
00089 if (!rep) {
00090 crisis();
00091 return;
00092 }
00093 rep->reset();
00094 }
00095
00096
00097
00098
00099 bool AIDA_PlotterLayout::setParameter(const std::string& paramName,
00100 double paramValue)
00101 {
00102 if (!rep) {
00103 crisis();
00104 return false;
00105 }
00106 return rep->setParameterValue(paramName, paramValue);
00107 }
00108
00109
00110
00111
00112 double AIDA_PlotterLayout::parameterValue(const std::string& paramName)
00113 {
00114 if (!rep) {
00115 crisis();
00116 return -1.0;
00117 }
00118 return rep->parameterValue(paramName);
00119 }
00120
00121
00122
00123
00124 std::vector<std::string> AIDA_PlotterLayout::availableParameters() const
00125 {
00126 if (!rep) {
00127 crisis();
00128 return std::vector<std::string>();
00129 }
00130 return rep->availableParameters();
00131 }
00132
00133
00134
00135 Layout* AIDA_PlotterLayout::theRep()
00136 {
00137 return rep;
00138 }
00139
00140
00141
00142 void AIDA_PlotterLayout::setRep(Layout& newRep, bool ownership)
00143 {
00144 if (ownRep) delete rep;
00145 rep = &newRep;
00146 ownRep = ownership;
00147 }
00148
00149
00150
00151
00152
00154
00155
00156
00158
00159 void AIDA_PlotterLayout::crisis() const
00160 {
00161 std::cout << "*** AIDA_Plotter_Grace SEVERE ERROR: proxy failure in AIDA_PlotterLayout" << std::endl;
00162 }
00163
00164
00165
00166 }
00167 }
00168