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

AIDA_PlotterLayout.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:27:52 2002
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 // Constructors, destructor and operator= //
00050 //                                        //
00052 
00053 AIDA_PlotterLayout::AIDA_PlotterLayout()
00054   : rep(0),
00055     ownRep(false)
00056 {
00057   // no-op
00058 }
00059 
00060 
00061 
00062 AIDA_PlotterLayout::AIDA_PlotterLayout(Layout* x, bool b)
00063   : rep(x),
00064     ownRep(b)
00065 {
00066   // no-op
00067 }
00068 
00069 
00070 
00071 
00072 AIDA_PlotterLayout::~AIDA_PlotterLayout()
00073 {
00074   if (ownRep) delete rep;
00075 }
00076 
00077 
00078 
00079 
00080 
00082 //                //
00083 // Public methods //
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 // Private methods //
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 } // end of namespace AIDA_Plotter_Grace
00167 } // end of namespace Anaphe
00168 

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