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

AIDA_LineStyle.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:43:51 2002
00032 // 
00033 
00034 
00035 
00036 #include "AIDA_LineStyle.h"
00037 #include "GracePlotter/LineStyle.h"
00038 
00039 #include <iostream>
00040 
00041 
00042 namespace Anaphe {
00043 namespace AIDA_Plotter_Grace {
00044 
00045 
00046 
00047 
00049 //                                        //
00050 // Constructors, destructor and operator= //
00051 //                                        //
00053 
00054 AIDA_LineStyle::AIDA_LineStyle()
00055   : rep   (0),
00056     ownRep(false)
00057 {
00058   // no-op
00059 }
00060 
00061 
00062 
00063 AIDA_LineStyle::AIDA_LineStyle(LineStyle* x, bool b)
00064   : rep   (x),
00065     ownRep(b)
00066 {
00067   // no-op
00068 }
00069 
00070 
00071 
00072 
00073 AIDA_LineStyle::~AIDA_LineStyle()
00074 {
00075   if (ownRep) delete rep;
00076 }
00077 
00078 
00079 
00080 
00082 //                //
00083 // Public methods //
00084 //                //
00086 
00087 void AIDA_LineStyle::reset()
00088 {
00089   if (!rep) { 
00090     crisis();
00091     return;
00092   }
00093   rep->reset();
00094 }
00095 
00096 
00097 
00098 
00099 bool AIDA_LineStyle::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_LineStyle::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_LineStyle::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_LineStyle::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_LineStyle::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_LineStyle::color() const
00162 {
00163   if (!rep) { 
00164     crisis();
00165     return "";
00166   }
00167   return rep->color();
00168 }
00169 
00170 
00171 
00172 
00173 double AIDA_LineStyle::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_LineStyle::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_LineStyle::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_LineStyle::availableLineTypes() const
00210 {
00211   if (!rep) { 
00212     crisis();
00213     return std::vector<std::string>();
00214   }
00215   return rep->availableLineTypes();
00216 }
00217 
00218 
00219 
00220 
00221 std::string AIDA_LineStyle::lineType() const
00222 {
00223   if (!rep) { 
00224     crisis();
00225     return "";
00226   }
00227   return rep->lineType();
00228 }
00229 
00230 
00231 
00232 
00233 int AIDA_LineStyle::thickness() const
00234 {
00235   if (!rep) { 
00236     crisis();
00237     return -1;
00238   }
00239   return rep->thickness();
00240 }
00241 
00242 
00243 
00244 
00245 bool AIDA_LineStyle::setLineType(const std::string& newLineType)
00246 {
00247   if (!rep) { 
00248     crisis();
00249     return false;
00250   }
00251   return rep->setLineType(newLineType);
00252 }
00253 
00254 
00255 
00256 
00257 bool AIDA_LineStyle::setThickness(int newThickness)
00258 {
00259   if (!rep) { 
00260     crisis();
00261     return false;
00262   }
00263   return rep->setThickness(newThickness);
00264 }
00265 
00266 
00267 
00268 
00269 void AIDA_LineStyle::setRep(LineStyle& s, bool ownership)
00270 {
00271   if (ownRep) delete rep;
00272   rep = &s;
00273   ownRep = ownership;
00274 }
00275 
00276 
00277 
00278 LineStyle* AIDA_LineStyle::theRep()
00279 {
00280   return rep;
00281 }
00282 
00283 
00284 
00285 
00286 //
00287 // private methods
00288 //
00289 
00290 void AIDA_LineStyle::crisis() const
00291 {
00292   std::cout << "*** AIDA_Plotter_Grace SEVERE ERROR: proxy failure in AIDA_LineStyle" << std::endl; 
00293 }
00294 
00295 
00296 
00297 } // end of namespace AIDA_Plotter_Grace
00298 } // end of namespace Anaphe
00299 

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