00001 /*************************************************************************** 00002 seqgradchanparallel.h - description 00003 ------------------- 00004 begin : Thu Apr 22 2004 00005 copyright : (C) 2001 by Thies H. Jochimsen 00006 email : jochimse@cns.mpg.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef SEQGRADCHANPARALLEL_H 00019 #define SEQGRADCHANPARALLEL_H 00020 00021 00022 #include <odinseq/seqgradchanlist.h> 00023 #include <odinseq/seqgradobj.h> 00024 #include <odinseq/seqdriver.h> 00025 00026 00028 00029 00034 class SeqGradChanParallelDriver : public SeqDriverBase { 00035 00036 public: 00037 SeqGradChanParallelDriver() {} 00038 virtual ~SeqGradChanParallelDriver() {} 00039 00040 virtual bool prep_driver(SeqGradChanList* chanlists[3]) const = 0; 00041 00042 virtual STD_string get_program(programContext& context) const = 0; 00043 00044 virtual SeqGradChanParallelDriver* clone_driver() const = 0; 00045 }; 00046 00047 00049 00050 00051 00060 class SeqGradChanParallel : public SeqGradObjInterface { 00061 00062 public: 00063 00067 SeqGradChanParallel(const STD_string& object_label = "unnamedSeqGradChanParallel" ); 00068 00072 SeqGradChanParallel(const SeqGradChanParallel& sgcp); 00073 00077 ~SeqGradChanParallel(); 00078 00082 SeqGradChanParallel& operator = (const SeqGradChanParallel& sgcp); 00083 00087 SeqGradChanParallel& operator /= (SeqGradChan& sgc); 00088 00092 SeqGradChanParallel& operator /= (SeqGradChanList& sgcl); 00093 00094 00095 // overloading virtual function from SeqTreeObj 00096 STD_string get_program(programContext& context) const; 00097 STD_string get_properties() const; 00098 unsigned int event(eventContext& context) const; 00099 void query(queryContext& context) const; 00100 00101 // overloading virtual function from SeqGradInterface 00102 SeqGradInterface& set_strength(float gradstrength); 00103 SeqGradInterface& invert_strength(); 00104 float get_strength() const; 00105 fvector get_gradintegral() const; 00106 double get_gradduration() const; 00107 SeqGradInterface& set_gradrotmatrix(const RotMatrix& matrix); 00108 00109 00110 00114 SeqGradChanParallel& operator += (SeqGradChan& sgc); 00115 00116 00120 SeqGradChanParallel& operator += (SeqGradChanList& sgcl); 00121 00125 SeqGradChanParallel& operator += (SeqGradChanParallel& sgcp); 00126 00127 00131 void clear(); 00132 00133 00134 private: 00135 friend class SeqOperator; 00136 friend class SeqGradChan; 00137 friend class SeqGradChanList; 00138 friend class SeqGradEPI; 00139 friend class SeqEpiKernel; 00140 00141 // overwriting virtual functions from SeqClass 00142 bool prep(); 00143 void clear_container(); 00144 00145 // overwriting virtual functions from SeqGradObjInterface 00146 bool need_gp_terminator() const {return true;} 00147 00148 void padd_channel_with_delay(direction chanNo, double maxdur); 00149 00150 SeqGradChanList* get_gradchan(direction channel) const; 00151 SeqGradChanParallel& set_gradchan(direction channel, SeqGradChanList* sgcl); 00152 00153 mutable SeqDriverInterface<SeqGradChanParallelDriver> paralleldriver; 00154 00155 Handler<SeqGradChanList* > gradchan[3]; 00156 }; 00157 00158 00162 #endif
1.5.6