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

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

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