3 file=PARAVIS_CreateClass.cxx
6 echo '#include <iostream>' > $file
7 echo '#include <QString>' >> $file
8 echo '#include "PARAVIS_Gen_i.hh"' >> $file
9 awk '{print "#include \"PARAVIS_Gen_"$1"_i.hh\"";}' $wfile >> $file
11 echo 'PARAVIS::PARAVIS_Base_i* CreateInstance(::vtkObjectBase* Inst, const QString& theClassName)' >> $file
13 awk 'BEGIN {lst="";} {lst=lst" "$1;} END{i=split(lst,arr);for(j=i;j>0;j--) {print " if(theClassName == \""arr[j]"\" || (Inst != NULL && Inst->IsA(\""arr[j]"\")))";print " return new PARAVIS::"arr[j]"_i();"}}' $wfile >> $file
15 echo ' cerr << "The class " << theClassName.toStdString() << " is not created!" << endl;' >> $file
16 echo ' return new PARAVIS::PARAVIS_Base_i();' >> $file