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 "GracePlotter/FillStyle.h"
00037 #include "AIDA_FillStyle.h"
00038 #include <iostream>
00039
00040
00041
00042 namespace Anaphe {
00043 namespace AIDA_Plotter_Grace {
00044
00045
00046
00048
00049
00050
00052
00053 AIDA_FillStyle::AIDA_FillStyle()
00054 : rep (0),
00055 ownRep(false)
00056 {
00057
00058 }
00059
00060
00061
00062
00063 AIDA_FillStyle::AIDA_FillStyle(FillStyle* x, bool owner)
00064 : rep (x),
00065 ownRep(owner)
00066 {
00067
00068 }
00069
00070
00071
00072
00073 AIDA_FillStyle::~AIDA_FillStyle()
00074 {
00075 if (ownRep) delete rep;
00076 }
00077
00078
00079
00080
00082
00083
00084
00086
00087 void AIDA_FillStyle::reset()
00088 {
00089 if (!rep) {
00090 crisis();
00091 return;
00092 }
00093 rep->reset();
00094 }
00095
00096
00097
00098
00099 bool AIDA_FillStyle::setParameter(const std::string& paramName,
00100 const std::string& options)
00101 {
00102 if (!rep) {
00103 crisis();
00104 return false;
00105 }
00106 return rep->setParameter(paramName, options);
00107 }
00108
00109
00110
00111
00112 std::vector<std::string> AIDA_FillStyle::availableParameters() const
00113 {
00114 if (!rep) {
00115 crisis();
00116 return std::vector<std::string>();
00117 }
00118 return rep->availableParameters();
00119 }
00120
00121
00122
00123
00124 std::string AIDA_FillStyle::parameterValue(const std::string& param) const
00125 {
00126 if (!rep) {
00127 crisis();
00128 return "";
00129 }
00130 return rep->parameterValue(param);
00131 }
00132
00133
00134
00135
00136 std::vector<std::string>
00137 AIDA_FillStyle::availableParameterOptions(const std::string& paramName) const
00138 {
00139 if (!rep) {
00140 crisis();
00141 return std::vector<std::string>();
00142 }
00143 return rep->availableOptions(paramName);
00144 }
00145
00146
00147
00148
00149 std::vector<std::string> AIDA_FillStyle::availableColors() const
00150 {
00151 if (!rep) {
00152 crisis();
00153 return std::vector<std::string>();
00154 }
00155 return rep->availableColors();
00156 }
00157
00158
00159
00160
00161 std::string AIDA_FillStyle::color() const
00162 {
00163 if (!rep) {
00164 crisis();
00165 return "";
00166 }
00167 return rep->color();
00168 }
00169
00170
00171
00172
00173 double AIDA_FillStyle::opacity() const
00174 {
00175 if (!rep) {
00176 crisis();
00177 return -1.0;
00178 }
00179 return rep->opacity();
00180 }
00181
00182
00183
00184
00185 bool AIDA_FillStyle::setColor(const std::string & newColor)
00186 {
00187 if (!rep) {
00188 crisis();
00189 return false;
00190 }
00191 return rep->setColor(newColor);
00192 }
00193
00194
00195
00196
00197 bool AIDA_FillStyle::setOpacity(double newOpacity)
00198 {
00199 if (!rep) {
00200 crisis();
00201 return false;
00202 }
00203 return rep->setOpacity(newOpacity);
00204 }
00205
00206
00207
00208
00209 std::vector<std::string> AIDA_FillStyle::availablePatterns() const
00210 {
00211 if (!rep) {
00212 crisis();
00213 return std::vector<std::string>();
00214 }
00215 return rep->availablePatterns();
00216 }
00217
00218
00219
00220
00221 std::string AIDA_FillStyle::pattern() const
00222 {
00223 if (!rep) {
00224 crisis();
00225 return "";
00226 }
00227 return rep->pattern();
00228 }
00229
00230
00231
00232
00233 bool AIDA_FillStyle::setPattern(const std::string& pattern)
00234 {
00235 if (!rep) {
00236 crisis();
00237 return false;
00238 }
00239 return rep->setPattern(pattern);
00240 }
00241
00242
00243
00244
00245
00246 void AIDA_FillStyle::setRep(FillStyle& s, bool ownership)
00247 {
00248 if (ownRep) delete rep;
00249 rep = &s;
00250 ownRep = ownership;
00251 }
00252
00253
00254
00255 FillStyle* AIDA_FillStyle::theRep()
00256 {
00257 return rep;
00258 }
00259
00260
00261
00262
00263
00264
00265
00266 void AIDA_FillStyle::crisis() const
00267 {
00268 std::cout << "*** AIDA_Plotter_Grace SEVERE ERROR: proxy failure in AIDA_FillStyle" << std::endl;
00269 }
00270
00271
00272
00273
00274 }
00275 }
00276