2 #define _CRT_SECURE_NO_DEPRECATE
12 //==========================================================================
16 bbfyException(const std::string& message) : mMessage(message) {}
20 //==========================================================================
22 const std::string itkImageToImageFilterString = "ITK_ImageToImageFilter";
23 const std::string vtkImageAlgorithmString = "VTK_ImageAlgorithm";
24 const std::string vtkPolyDataAlgorithmString = "VTK_PolyDataAlgorithm";
26 //==========================================================================
30 bbfy(const std::string& filename,
31 const std::string& package = "PACKAGE_NAME",
32 const std::string& output_path = "",
33 bool verbose = false);
35 void CreateBlackBox();
40 void WriteGenericITKFilterHeader();
42 void BeginNamespace();
47 std::string mFilename;
48 std::string mOutputPath;
56 itkImageToImageFilter,
64 std::string mParentBlackBox;
65 std::string mItkParent;
66 std::string mVtkObject;
69 std::string mDescription;
70 std::string mCategory;
72 // bool mIsInNamespace;
73 std::string mNamespace;
74 // int mNbTemplateParam;
75 std::vector<std::string> mTemplateParam;
76 std::string mTemplateDeclaration;
77 std::string mTemplateImplementation;
79 std::vector<std::string> mInclude;
80 std::vector<std::string> mTypedef;
82 std::string mUserSetDefaultValues;
83 std::string mUserInitializeProcessing;
84 std::string mUserFinalizeProcessing;
93 std::string generic_type;
97 std::vector<IO> mInput;
98 std::vector<IO> mOutput;
100 std::string mProcess;
101 std::string mCreateWidget;
106 std::string mCxxName;
111 //==========================================================================
115 //==========================================================================
116 bbfy::bbfy(const std::string& filename,
117 const std::string& package,
118 const std::string& output_path,
123 mFilename = filename;
125 mNamespace = "bb" + mPackage;
127 mOutputPath = output_path;
132 //==========================================================================
134 //==========================================================================
135 void bbfy::CreateBlackBox()
137 // Parse XML input file
139 // Create output files
143 //==========================================================================
145 void bbfy::AlertString()
148 mFile << "//===== \n";
149 mFile << "// Before editing this file, make sure it's a file of your own ";
150 mFile << "(i.e.: it wasn't generated from xml description; if so : your modifications will be lost)\n";
151 mFile << "//===== \n";
155 //==========================================================================
156 void bbfy::ParseXML()
161 XMLResults* res = new XMLResults;
162 XMLNode BB = XMLNode::parseFile(mFilename.c_str(),"blackbox",res);
164 if ( res->error != eXMLErrorNone )
166 std::ostringstream str;
167 str << XMLNode::getError(res->error);
168 str << " [line " << res->nLine << ", col "<<res->nColumn<<"]";
170 throw bbfyException(str.str());
175 if (!BB.isAttributeSet("name"))
177 throw bbfyException("Error : <blackbox> tag : no 'name' attribute found (mandatory)");
179 mName = BB.getAttribute("name");
181 if (mVerbose) std::cout << "* Creating BlackBox '"<<mName<<"'"<<std::endl;
188 if (BB.isAttributeSet("type"))
190 std::string bbtype = BB.getAttribute("type");
191 if (bbtype=="standard")
196 else if (bbtype==itkImageToImageFilterString)
198 mType = itkImageToImageFilter;
199 // Looks for <itkparent> tag
200 if (!BB.nChildNode("itkparent"))
202 throw bbfyException("Error : blackbox type '"+itkImageToImageFilterString+"' but no <itkparent> tag found (mandatory)");
204 bbtk::GetTextOrClear(BB.getChildNode("itkparent"),mItkParent);
207 if (BB.isAttributeSet("generic")) mGeneric=true;
209 else if (bbtype == vtkImageAlgorithmString)
211 mType = vtkImageAlgorithm;
212 // Looks for <vtkobject> tag
213 if (!BB.nChildNode("vtkobject"))
215 throw bbfyException("Error : blackbox type '"
216 +vtkImageAlgorithmString
217 +"' but no <vtkobject> tag found (mandatory)");
219 bbtk::GetTextOrClear(BB.getChildNode("vtkobject"),mVtkObject);
222 else if (bbtype == vtkPolyDataAlgorithmString )
224 mType = vtkPolyDataAlgorithm;
225 // Looks for <vtkobject> tag
226 if (!BB.nChildNode("vtkobject"))
228 throw bbfyException("Error : blackbox type '"
229 +vtkPolyDataAlgorithmString
230 +"' but no <vtkobject> tag found (mandatory)");
232 bbtk::GetTextOrClear(BB.getChildNode("vtkobject"),mVtkObject);
237 std::string mess("Error : blackbox type '");
239 mess += "' unknown. Known types :";
240 mess += "'" + itkImageToImageFilterString + "' ";
241 mess += "'" + vtkImageAlgorithmString + "' ";
242 mess += "'" + vtkPolyDataAlgorithmString + "' ";
243 throw bbfyException(mess);
248 if (BB.isAttributeSet("widget"))
251 mParentBlackBox = "bbtk::WxBlackBox";
252 mInclude.push_back("bbtkWxBlackBox.h");
257 mParentBlackBox = "bbtk::AtomicBlackBox";
258 mInclude.push_back("bbtkAtomicBlackBox.h");
263 for (i=0,j=0; i<BB.nChildNode("author"); i++)
266 bbtk::GetTextOrClear(BB.getChildNode("author",&j),val);
271 for (i=0,j=0; i<BB.nChildNode("description"); i++)
274 bbtk::GetTextOrClear(BB.getChildNode("description",&j),val);
279 for (i=0,j=0; i<BB.nChildNode("category"); i++)
282 bbtk::GetTextOrClear(BB.getChildNode("category",&j),val);
287 if (BB.nChildNode("namespace"))
289 bbtk::GetTextOrClear(BB.getChildNode("namespace"),mNamespace);
292 // UserSetDefaultValues body
293 if (BB.nChildNode("defaultValues"))
295 bbtk::GetTextOrClear(BB.getChildNode("defaultValues"),
296 mUserSetDefaultValues);
299 // UserInitializeProcessing body
300 if (BB.nChildNode("initializeProcessing"))
302 bbtk::GetTextOrClear(BB.getChildNode("initializeProcessing"),
303 mUserInitializeProcessing);
306 // UserFinalizeProcessing body
307 if (BB.nChildNode("finalizeProcessing"))
309 bbtk::GetTextOrClear(BB.getChildNode("finalizeProcessing"),
310 mUserFinalizeProcessing);
315 // Template parameters
316 // mNbTemplateParam = BB.nChildNode("template");
318 if ( BB.nChildNode("template") > 0)
320 mTemplateDeclaration = "<";
321 mTemplateImplementation = "<";
323 for (i=0,j=0; i<BB.nChildNode("template")-1; i++)
325 mTemplateDeclaration += "class ";
327 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
328 mTemplateDeclaration += val;
329 mTemplateDeclaration += ",";
330 mTemplateImplementation += val;
331 mTemplateImplementation += ",";
332 mTemplateParam.push_back(val);
334 mTemplateDeclaration += "class ";
336 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
337 mTemplateDeclaration += val;
338 mTemplateDeclaration += ">";
339 mTemplateImplementation += val;
340 mTemplateImplementation += ">";
341 mTemplateParam.push_back(val);
345 for (i=0,j=0; i<BB.nChildNode("include"); i++)
348 bbtk::GetTextOrClear(BB.getChildNode("include",&j),val);
349 mInclude.push_back(val);
352 for (i=0,j=0; i<BB.nChildNode("typedef"); i++)
355 bbtk::GetTextOrClear(BB.getChildNode("typedef",&j),val);
356 mTypedef.push_back(val);
360 for (i=0,j=0; i<BB.nChildNode("input"); i++)
363 XMLNode n = BB.getChildNode("input",&j);
364 if (!n.isAttributeSet("name"))
366 throw bbfyException("Error : <input> attribute 'name' not found (mandatory)");
368 io.name = n.getAttribute("name");
369 if (!n.isAttributeSet("type"))
371 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
373 io.type = n.getAttribute("type");
374 if (!n.isAttributeSet("description"))
376 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
378 io.descr = n.getAttribute("description");
380 if (n.isAttributeSet("special"))
382 io.special = n.getAttribute("special");
385 if (n.isAttributeSet("nature"))
387 io.nature = n.getAttribute("nature");
390 if (n.isAttributeSet("generic_type"))
392 io.generic_type = n.getAttribute("generic_type");
395 mInput.push_back(io);
399 for (i=0,j=0; i<BB.nChildNode("output"); i++)
402 XMLNode n = BB.getChildNode("output",&j);
403 if (!n.isAttributeSet("name"))
405 throw bbfyException("Error : <output> attribute 'name' not found (mandatory)");
407 io.name = n.getAttribute("name");
408 if (!n.isAttributeSet("type"))
410 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
412 io.type = n.getAttribute("type");
413 if (!n.isAttributeSet("description"))
415 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
417 io.descr = n.getAttribute("description");
419 if (n.isAttributeSet("special"))
421 io.special = n.getAttribute("special");
424 if (n.isAttributeSet("nature"))
426 io.nature = n.getAttribute("nature");
429 if (n.isAttributeSet("generic_type"))
431 io.generic_type = n.getAttribute("generic_type");
434 mOutput.push_back(io);
439 // process tag given ?
440 if (BB.nChildNode("process"))
442 bbtk::GetTextOrClear(BB.getChildNode("process"),mProcess);
446 // createwidget tag given ?
447 if (BB.nChildNode("createwidget"))
449 bbtk::GetTextOrClear(BB.getChildNode("createwidget"),mCreateWidget);
458 // OBSOLETE/UNSUPPORTED TAGS
459 // WARN IF OBSOLETE TAGS PROVIDED
460 if (BB.nChildNode("constructor"))
462 std::cout << "WARNING !!! The tag <constructor> is obsolete !!"<<std::endl;
464 if (BB.nChildNode("destructor"))
466 std::cout << "WARNING !!! The tag <destructor> is obsolete !!"<<std::endl;
468 if (BB.nChildNode("copy_constructor"))
470 std::cout << "WARNING !!! The tag <copy_constructor> is obsolete !!"<<std::endl;
476 //==========================================================================
479 //==========================================================================
480 void bbfy::BeginNamespace()
482 // if (mIsInNamespace)
484 mFile << "namespace "<<mNamespace <<"\n{\n\n";
487 //==========================================================================
489 //==========================================================================
490 void bbfy::EndNamespace()
492 // if (mIsInNamespace)
494 mFile << "}\n// EO namespace "<<mNamespace<<"\n\n";
497 //==========================================================================
500 //==========================================================================
501 void bbfy::CreateHeader()
508 if (mVerbose) std::cout << " - Creating header '"<<mHName<<"'"<<std::endl;
509 std::string fullname = mOutputPath + mHName;
510 mFile.open(fullname.c_str());
513 std::string mess("Error : could not open file \"");
514 mess += fullname + "\"";
515 throw bbfyException(mess);
523 mFile << "#ifdef _USE_WXWIDGETS_\n";
526 // Prevent multiple inclusions
527 std::string included("__bb");
528 included += mPackage + mName + "_h_INCLUDED__";
529 mFile << "#ifndef " << included <<"\n";
530 mFile << "#define " << included <<"\n";
533 mFile << "#include \"bb" << mPackage << "_EXPORT.h\"\n";
534 std::vector<std::string>::iterator i;
535 for (i=mInclude.begin(); i!=mInclude.end(); ++i)
537 mFile << "#include \"" << *i <<"\"\n";
539 if (mGeneric) mFile << "#include \"bbitkImage.h\"\n";
542 if (mType == itkImageToImageFilter )
544 mFile << "#include \"bbtkItkBlackBoxMacros.h\"\n";
546 else if ( (mType == vtkImageAlgorithm) ||
547 (mType == vtkPolyDataAlgorithm) )
549 mFile << "#include \"bbtkVtkBlackBoxMacros.h\"\n";
556 // If it is a template class
557 if (mTemplateParam.size() > 0)
559 mFile << "template " << mTemplateDeclaration <<"\n";
562 // Class declaration and parents
563 mFile << "class bb"<<mPackage<<"_EXPORT "<<mName<<"\n";
567 if (mBB.nChildNode("inherits"))
570 for (i=0,j=0; i<mBB.nChildNode("inherits")-1; i++)
573 << mBB.getChildNode("inherits",&j).getText()
577 << mBB.getChildNode("Inherits",&j).getText()
582 if (mType == itkImageToImageFilter )
584 mFile << " public " << mItkParent <<",\n";
587 mFile << " public "<<mParentBlackBox << "\n";
594 if (mType == itkImageToImageFilter)
596 mFile << " BBTK_ITK_BLACK_BOX_INTERFACE("
598 << mParentBlackBox << ","
603 else if ( (mType == vtkImageAlgorithm) ||
604 (mType == vtkPolyDataAlgorithm) )
606 mFile << " BBTK_VTK_BLACK_BOX_INTERFACE("
608 << mParentBlackBox << ","
616 mFile << " BBTK_BLACK_BOX_INTERFACE("
618 << mParentBlackBox << ");\n";
621 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
630 std::vector<IO>::iterator ioi;
631 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
633 if (ioi->special=="")
635 mFile << " BBTK_DECLARE_INPUT("
641 else if (ioi->special=="itk input")
643 mFile << " BBTK_DECLARE_ITK_INPUT("
649 else if (ioi->special=="vtk input")
651 if (mType == vtkImageAlgorithm) {
652 mFile << " BBTK_DECLARE_VTK_IMAGE_ALGORITHM_INPUT("
658 else if (mType == vtkPolyDataAlgorithm) {
659 mFile << " BBTK_DECLARE_POLY_DATA_ALGORITHM_INPUT("
666 else if (ioi->special=="itk parameter")
668 mFile << " BBTK_DECLARE_ITK_PARAM("
674 else if (ioi->special=="vtk parameter")
676 mFile << " BBTK_DECLARE_VTK_PARAM("
684 std::string mess("Error : input '");
686 mess += "', 'special' attribute '";
687 mess += ioi->special;
689 throw bbfyException(mess);
695 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
697 if (ioi->special=="")
699 mFile << " BBTK_DECLARE_OUTPUT("
705 else if (ioi->special=="itk output")
707 mFile << " BBTK_DECLARE_ITK_OUTPUT("
713 else if (ioi->special=="vtk output")
715 mFile << " BBTK_DECLARE_VTK_OUTPUT("
723 std::string mess("Error : output '");
725 mess += "', 'special' attribute '";
726 mess += ioi->special;
728 throw bbfyException(mess);
733 if ((mType == STD)||(mProcess.size()))
735 mFile << " BBTK_PROCESS(Process);\n" ;
736 mFile << " void Process();\n";
738 else if (mType == itkImageToImageFilter)
740 mFile << " BBTK_ITK_PROCESS();\n" ;
742 else if ((mType == vtkImageAlgorithm) ||
743 (mType == vtkPolyDataAlgorithm) )
746 mFile << " BBTK_VTK_PROCESS();\n" ;
752 mFile << " BBTK_CREATE_WIDGET(CreateWidget);\n" ;
753 mFile << " void CreateWidget(wxWindow*);\n";
758 // EO black box declaration
761 // BO black box description
762 if (mTemplateParam.size()==0)
764 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
766 << mParentBlackBox << ");\n";
767 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
769 else if (mTemplateParam.size()==1)
771 mFile << "BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX("
773 //<< mParentBlackBox //<< ","
774 // << mTemplateParam[0]
776 mFile << "BBTK_NAME(\"" << mName
777 << "<\"+bbtk::TypeName<" << mTemplateParam[0]
782 throw bbfyException("template bb with more than 1 templ param not impl");
787 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
790 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
793 mFile << "BBTK_CATEGORY(\""<<mCategory<< "\");\n";
795 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
801 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
803 if (mTemplateParam.size()>0)
805 mFile << "BBTK_TEMPLATE_INPUT(";
809 mFile << "BBTK_INPUT(";
811 mFile << mName << "," << ioi->name << ",\""
812 << ioi->descr << "\"," << ioi->type << ",\""
813 << ioi->nature<<"\");\n";
817 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
819 if (mTemplateParam.size()>0)
821 mFile << "BBTK_TEMPLATE_OUTPUT(";
825 mFile << "BBTK_OUTPUT(";
827 mFile << mName << "," << ioi->name << ",\""
828 << ioi->descr << "\"," << ioi->type << ",\""
829 << ioi->nature<<"\");\n";
832 // EO black box description
833 if (mTemplateParam.size()==0)
835 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
838 else if (mTemplateParam.size()==1)
840 mFile << "BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX("
842 // << mTemplateParam[0]
847 throw bbfyException("template bb with more than 1 templ param not impl");
851 // Untemplatization of itk filters
854 WriteGenericITKFilterHeader();
862 // Prevent multiple inclusions
863 mFile << "#endif // " << included <<"\n";
867 mFile << "#endif // _USE_WXWIDGETS_\n";
875 //==========================================================================
879 //==========================================================================
880 void bbfy::WriteGenericITKFilterHeader()
882 mFile << "\n//===================================================\n";
883 mFile << "// Generic \"untemplatized\" filter\n";
884 mFile << "//===================================================\n";
886 // Class declaration and parents
887 mFile << "class /*BBTK_EXPORT*/ "<<mName<<"Generic\n";
889 mFile << " public bbtk::AtomicBlackBox\n";
893 mFile << " BBTK_BLACK_BOX_INTERFACE("
894 << mName << "Generic,bbtk::AtomicBlackBox);\n";
897 std::vector<IO>::iterator ioi;
898 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
900 mFile << " BBTK_DECLARE_INPUT("
908 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
910 mFile << " BBTK_DECLARE_OUTPUT("
918 mFile << " BBTK_PROCESS(ProcessSwitch);\n";
919 mFile << " private :\n";
920 mFile << " inline void ProcessSwitch();\n";
921 mFile << " template <class T, unsigned int D> void Process();\n";
922 // EO black box declaration
927 // BO black box description
928 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
929 << mName << "Generic,bbtk::AtomicBlackBox);\n";
930 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
933 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
936 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
939 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
941 mFile << "BBTK_INPUT(";
942 mFile << mName << "Generic," << ioi->name << ",\""
943 << ioi->descr << "\"," << ioi->generic_type <<");\n";
947 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
949 mFile << "BBTK_OUTPUT(";
950 mFile << mName << "Generic," << ioi->name << ",\""
951 << ioi->descr << "\"," << ioi->generic_type <<");\n";
954 // EO black box description
955 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
956 << mName << "Generic);\n";
959 //=================================================================
960 // ProcessSwitch implementation
961 mFile << "void "<< mName <<"Generic::ProcessSwitch()\n"
963 << "CALL_FOR_ALL_TYPES_AND_DIM(bbGetInputIn()->GetType(),\n"
964 << " bbGetInputIn()->GetDimension(),\n"
967 //=================================================================
970 //=================================================================
971 // Template process implementation
972 mFile << "template <class T, unsigned int D>\n"
973 << "void "<<mName<<"Generic::Process()\n"
975 << " bbtkDebugMessageInc(\"Kernel\",9,\n"
977 << "Generic::Process<\"<<TypeName<T>()<<\",\"<<D<<\">()\"<<std::endl);\n"
979 << " typedef itk::Image<T,D> ImageType;\n"
980 << " typedef "<<mName<<"<ImageType> FilterType;\n"
982 << " FilterType* f = new FilterType(\"Temp\");\n"
984 << " f->bbSetInputIn( this->bbGetInputIn()->GetImage<T,D>() );\n";
986 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
988 if (ioi->name == "In") continue;
989 mFile << " f->bbSetInput"<<ioi->name<<" ( this->bbGetInput"
990 << ioi->name << "() );\n";
993 mFile << " f->bbUpdate();\n"
994 << " this->bbSetOutputOut( new itkImage( f->bbGetOutputOut() ) );\n"
995 << " f->UnRegister();\n"
996 << " bbtkDebugDecTab(\"Kernel\",9);\n"
998 //=================================================================
1002 //==========================================================================
1005 //==========================================================================
1006 void bbfy::CreateCode()
1009 mCxxName += mPackage;
1012 if (mVerbose) std::cout << " - Creating code '"<<mCxxName<<"'"<<std::endl;
1013 std::string fullname = mOutputPath + mCxxName;
1014 mFile.open(fullname.c_str());
1017 std::string mess("Error : could not open file \"");
1020 throw bbfyException(mess);
1027 // Header of the class
1028 mFile << "#include \"" << mHName << "\"\n";
1030 // Include Package header
1031 mFile << "#include \"bb"<<mPackage << "Package.h\"\n";
1038 if (mTemplateParam.size()>0)
1041 mFile << "BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION("
1043 << mParentBlackBox << ");\n";
1048 mFile << "BBTK_BLACK_BOX_IMPLEMENTATION("
1049 << mName << "Generic,bbtk::AtomicBlackBox);\n";
1051 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1053 << mName << "Generic)\n";
1058 // Non template class
1060 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1065 mFile << "BBTK_BLACK_BOX_IMPLEMENTATION("
1067 << mParentBlackBox << ");\n";
1070 if ((mType == STD)||(mProcess.size()))
1073 mFile << "void "<<mName<<"::Process()\n{\n";
1074 mFile << mProcess << "\n";
1081 mFile << "void "<<mName<<"::CreateWidget(wxWindow* parent)\n{\n";
1082 mFile << mCreateWidget << "\n";
1087 // User Set Default Values
1089 mFile <<"void "<<mName<<"::bbUserSetDefaultValues()"<<std::endl;
1090 mFile << "{"<<std::endl;
1091 if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
1093 mFile << " BBTK_VTK_SET_DEFAULT_VALUES();\n";
1095 mFile << mUserSetDefaultValues << std::endl;
1096 mFile << "}" << std::endl;
1098 // User Initialize Processing
1100 mFile <<"void "<<mName<<"::bbUserInitializeProcessing()"
1102 mFile << "{"<<std::endl;
1103 if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
1105 mFile << " BBTK_VTK_INITIALIZE_PROCESSING();\n";
1107 mFile << mUserInitializeProcessing << std::endl;
1108 mFile << "}" << std::endl;
1110 // User Finalize Processing
1112 mFile <<"void "<<mName<<"::bbUserFinalizeProcessing()"<<std::endl;
1113 mFile << "{"<<std::endl;
1114 if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
1116 mFile << " BBTK_VTK_FINALIZE_PROCESSING();\n";
1118 mFile << mUserFinalizeProcessing << std::endl;
1119 mFile << "}" << std::endl;
1131 //==========================================================================
1137 //==========================================================================
1138 int main(int argc, char **argv)
1141 if (argc<2 || argc>5)
1143 std::cerr << "usage : "<< argv[0] <<" xml_file [package_name] [output_path] [-q]" << std::endl;
1149 std::string package("PACKAGE_NAME");
1150 std::string output_path("");
1151 bool verbose = true;
1152 if (argc>2) package = argv[2];
1153 if (argc>3) output_path = argv[3];
1154 if (argc>4) verbose = false;
1156 bbfy B(argv[1],package,output_path,verbose);
1158 catch (bbfyException e)
1160 std::cerr << argv[0] << " " << argv[1] << std::endl
1161 << e.mMessage << std::endl;
1166 //==========================================================================