#ifndef _DEF_TRANSLATION_TXX #define _DEF_TRANSLATION_TXX #include "Def_Translation.h" namespace mial { // constructor: template Def_Translation ::Def_Translation() { this->name = "Def_Translation"; } template bool Def_Translation ::run(typename Deformation::deformationIn* i,typename Deformation::DefArgSet* org, std::stringstream *s) { DefArgSet* orgUp = reinterpret_cast(org); typename deformationIn::Pointer in; if(i !=NULL && s != NULL) { Error e; e.msg = "Only one of struct or stream input may be provided."; e.name = "Def_TranslateAll"; throw e; } else if(i !=NULL) in = reinterpret_cast(i); //Typecast the input to its desired form else if( s!= NULL) { in = deformationIn::New(); in->fillFromStream(*s); } else { Error e; e.msg = "Either struct or stream input must be provided."; e.name = "Def_TranslateAll"; throw e; } VType magVec(nDims); magVec.fill(0); //vnl_Matrix tmp = org.nodesF; int numNodes = orgUp->nodesF->rows(); for( unsigned int i=0; iamplitude[i]; //Read in the translation magnitude for each dimension //magVec(i) = 1000; } //Apply the force to the model for( unsigned int i=0; inodesFDef->set_row( i, magVec ); orgUp->nodesV->set_row(i,magVec); } return false; } } // end namespace mial #endif