#include #include #include #include #include BOOL readInFile(const String &pathFileName,PureVector &srcPairs); int main(int argc,char **argv) { PureVector srcPairs; PureVector dstPairs; CatmullRom splineGen; FileIO writeFile; String strOutLine; String srcFile; String dstFile; if(3!=argc) { ::printf("Fortis Spline Generator Copyright(c) 1998\n"); ::printf("USAGE: spline \n"); ::printf("where:\n"); ::printf(" contains point pair list (ie)\n"); ::printf(" 1.00,4.356\n"); ::printf(" 2.00,4.467\n"); ::printf(" 4.00,4.393\n"); ::printf(" 8.00,4.393\n"); ::printf(" 20.00,4.393\n"); ::printf(" 40.00,4.393\n"); ::printf(" 120.00,4.393\n"); ::printf(" is output destination\n"); ::printf("* Don't forget to comma delimit the source file.\n"); ::printf("* Keep in mind, the first number in the last line\n"); ::printf(" is used to determine the size of the output data set.\n"); return 1; } if(!readInFile(argv[1],srcPairs)) { ::printf(String("Error reading ")+String(argv[1])); return 1; } dstPairs.size(srcPairs[srcPairs.size()-1].column()); for(int index=1;index<=dstPairs.size();index++)dstPairs[index-1].column(index); splineGen.performSpline(srcPairs,dstPairs); writeFile.open(argv[2],FileIO::GenericWrite,FileIO::FileShareRead,FileIO::CreateAlways); for(index=0;index &srcPairs) { FileIO inFile; String strLine; int numEntries(0); inFile.open(pathFileName); if(!inFile.isOkay())return FALSE; while(inFile.readLine(strLine)) { if(strLine.isNull())break; numEntries++; } if(!numEntries)return FALSE; inFile.rewind(); srcPairs.size(numEntries); for(int index=0;index