Main Page   Namespace List   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

AIDA_FillStyle.cpp

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00004 //                                                                     //
00005 //  This library is free software; you can redistribute it and/or      //
00006 //  modify it under the terms of the GNU Lesser General Public         //
00007 //  License as published by the Free Software Foundation; either       //
00008 //  version 2.1 of the License, or (at your option) any later version. //
00009 //                                                                     //
00010 //  This library is distributed in the hope that it will be useful,    //
00011 //  but WITHOUT ANY WARRANTY; without even the implied warranty of     //
00012 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   //
00013 //  Lesser General Public License for more details.                    //
00014 //                                                                     //
00015 //  You should have received a copy of the GNU Lesser General Public   //
00016 //  License along with this library (see file COPYING); if not, write  //
00017 //  to the Free Software Foundation, Inc., 59 Temple Place, Suite      //
00018 //  330, Boston, MA 02111-1307 USA, or contact the author.             //
00019 //                                                                     //
00021 
00030 // 
00031 // Created by user sang on Sun Oct  6 17:40:06 2002
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 // Constructors, destructor and operator= //
00050 //                                        //
00052 
00053 AIDA_FillStyle::AIDA_FillStyle()
00054   : rep   (0),
00055     ownRep(false)
00056 {
00057   // no-op
00058 }
00059 
00060 
00061 
00062 
00063 AIDA_FillStyle::AIDA_FillStyle(FillStyle* x, bool owner)
00064   : rep   (x),
00065     ownRep(owner)
00066 {
00067   // no-op
00068 }
00069 
00070 
00071 
00072 
00073 AIDA_FillStyle::~AIDA_FillStyle()
00074 {
00075   if (ownRep) delete rep;
00076 }
00077 
00078 
00079 
00080 
00082 //                //
00083 // Public methods //
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 // private methods
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 } // end of namespace AIDA_Plotter_Grace
00275 } // end of namespace Anaphe
00276 

Generated on Tue Jan 28 13:30:44 2003 for Anaphe_AIDA_Plotter_Grace by doxygen1.2.16