PDataArithmetic.h

Go to the documentation of this file.
00001 // Copyright (C) 2005 Dave Griffiths
00002 //
00003 // This program is free software; you can redistribute it and/or modify
00004 // it under the terms of the GNU General Public License as published by
00005 // the Free Software Foundation; either version 2 of the License, or
00006 // (at your option) any later version.
00007 //
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00016 
00017 
00018 #include "PDataOperator.h"
00019 
00020 #ifndef N_PDATA_ARITH_OPERATOR
00021 #define N_PDATA_ARITH_OPERATOR
00022 
00023 using namespace std;
00024 
00025 namespace Fluxus
00026 {
00027 
00033 
00038 class AddOperator : public PDataOperator
00039 {
00040 public:
00041     AddOperator() {}
00042     
00043     template <class S, class T>
00044     static PData *Operate(TypedPData<S> *a, T b)
00045     {
00046         Trace::Stream<<"AddOperator has no operator for types: "<<typeid(a).name()<<" and " 
00047             <<typeid(b).name()<<endl;
00048         return NULL;
00049     }
00050     
00051 };
00052 
00053 template<>
00054 PData *AddOperator::Operate(TypedPData<float> *a, float b);
00055 template<>
00056 PData *AddOperator::Operate(TypedPData<dVector> *a, float b);
00057 template<>
00058 PData *AddOperator::Operate(TypedPData<dVector> *a, dVector b);
00059 template<>
00060 PData *AddOperator::Operate(TypedPData<float> *a, TypedPData<float> *b);
00061 template<>
00062 PData *AddOperator::Operate(TypedPData<dVector> *a, TypedPData<float> *b);
00063 template<>
00064 PData *AddOperator::Operate(TypedPData<dVector> *a, TypedPData<dVector> *b);
00065 
00066 class MultOperator : public PDataOperator
00067 {
00068 public:
00069     MultOperator() {}
00070     
00071     template <class S, class T>
00072     static PData *Operate(TypedPData<S> *a, T b)
00073     {
00074         Trace::Stream<<"MultOperator has no operator for types: "<<typeid(a).name()<<" and "    
00075             <<typeid(b).name()<<endl;
00076         return NULL;
00077     }
00078     
00079 };
00080 
00081 template<>
00082 PData *MultOperator::Operate(TypedPData<float> *a, float b);
00083 template<>
00084 PData *MultOperator::Operate(TypedPData<dVector> *a, float b);
00085 template<>
00086 PData *MultOperator::Operate(TypedPData<dColour> *a, float b);
00087 template<>
00088 PData *MultOperator::Operate(TypedPData<dVector> *a, dVector b);
00089 template<>
00090 PData *MultOperator::Operate(TypedPData<float> *a, TypedPData<float> *b);
00091 template<>
00092 PData *MultOperator::Operate(TypedPData<dVector> *a, TypedPData<float> *b);
00093 template<>
00094 PData *MultOperator::Operate(TypedPData<dVector> *a, TypedPData<dVector> *b);
00095 
00096 class SineOperator : public PDataOperator
00097 {
00098 public:
00099     SineOperator() {}
00100     
00101     template <class S, class T>
00102     static PData *Operate(TypedPData<S> *a, T b)
00103     {
00104         Trace::Stream<<"SineOperator has no operator for types: "<<typeid(a).name()<<" and "    
00105             <<typeid(b).name()<<endl;
00106         return NULL;
00107     }
00108     
00109 };
00110 
00111 template<>
00112 PData *SineOperator::Operate(TypedPData<float> *a, TypedPData<float> *b);
00113 
00114 class CosineOperator : public PDataOperator
00115 {
00116 public:
00117     CosineOperator() {}
00118     
00119     template <class S, class T>
00120     static PData *Operate(TypedPData<S> *a, T b)
00121     {
00122         Trace::Stream<<"CosineOperator has no operator for types: "<<typeid(a).name()<<" and "  
00123             <<typeid(b).name()<<endl;
00124         return NULL;
00125     }
00126     
00127 };
00128 
00129 template<>
00130 PData *CosineOperator::Operate(TypedPData<float> *a, TypedPData<float> *b);
00131 
00132 class ClosestOperator : public PDataOperator
00133 {
00134 public:
00135     ClosestOperator() {}
00136     
00137     template <class S, class T>
00138     static PData *Operate(TypedPData<S> *a, T b)
00139     {
00140         Trace::Stream<<"ClosestOperator has no operator for types: "<<typeid(a).name()<<" and " 
00141             <<typeid(b).name()<<endl;
00142         return NULL;
00143     }
00144     
00145 };
00146 
00147 template<>
00148 PData *ClosestOperator::Operate(TypedPData<dVector> *a, dVector b);
00149 template<>
00150 PData *ClosestOperator::Operate(TypedPData<dVector> *a, float b);
00151 
00152 }
00153 
00154 #endif

Generated on Tue Sep 4 23:22:18 2007 for The Fluxus Renderer (libfluxus) by  doxygen 1.5.1