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 << "// Don't edit this file. This file is generated from xml description.. \n";
150 mFile << "//===== \n";
154 //==========================================================================
155 void bbfy::ParseXML()
160 XMLResults* res = new XMLResults;
161 XMLNode BB = XMLNode::parseFile(mFilename.c_str(),"blackbox",res);
163 if ( res->error != eXMLErrorNone )
165 std::ostringstream str;
166 str << XMLNode::getError(res->error);
167 str << " [line " << res->nLine << ", col "<<res->nColumn<<"]";
169 throw bbfyException(str.str());
174 if (!BB.isAttributeSet("name"))
176 throw bbfyException("Error : <blackbox> tag : no 'name' attribute found (mandatory)");
178 mName = BB.getAttribute("name");
180 if (mVerbose) std::cout << "* Creating BlackBox '"<<mName<<"'"<<std::endl;
187 if (BB.isAttributeSet("type"))
189 std::string bbtype = BB.getAttribute("type");
190 if (bbtype=="standard")
195 else if (bbtype==itkImageToImageFilterString)
197 mType = itkImageToImageFilter;
198 // Looks for <itkparent> tag
199 if (!BB.nChildNode("itkparent"))
201 throw bbfyException("Error : blackbox type '"+itkImageToImageFilterString+"' but no <itkparent> tag found (mandatory)");
203 bbtk::GetTextOrClear(BB.getChildNode("itkparent"),mItkParent);
206 if (BB.isAttributeSet("generic")) mGeneric=true;
208 else if (bbtype == vtkImageAlgorithmString)
210 mType = vtkImageAlgorithm;
211 // Looks for <vtkobject> tag
212 if (!BB.nChildNode("vtkobject"))
214 throw bbfyException("Error : blackbox type '"
215 +vtkImageAlgorithmString
216 +"' but no <vtkobject> tag found (mandatory)");
218 bbtk::GetTextOrClear(BB.getChildNode("vtkobject"),mVtkObject);
221 else if (bbtype == vtkPolyDataAlgorithmString )
223 mType = vtkPolyDataAlgorithm;
224 // Looks for <vtkobject> tag
225 if (!BB.nChildNode("vtkobject"))
227 throw bbfyException("Error : blackbox type '"
228 +vtkPolyDataAlgorithmString
229 +"' but no <vtkobject> tag found (mandatory)");
231 bbtk::GetTextOrClear(BB.getChildNode("vtkobject"),mVtkObject);
236 std::string mess("Error : blackbox type '");
238 mess += "' unknown. Known types :";
239 mess += "'" + itkImageToImageFilterString + "' ";
240 mess += "'" + vtkImageAlgorithmString + "' ";
241 mess += "'" + vtkPolyDataAlgorithmString + "' ";
242 throw bbfyException(mess);
247 if (BB.isAttributeSet("widget"))
250 mParentBlackBox = "bbtk::WxBlackBox";
251 mInclude.push_back("bbtkWxBlackBox.h");
256 mParentBlackBox = "bbtk::AtomicBlackBox";
257 mInclude.push_back("bbtkAtomicBlackBox.h");
262 for (i=0,j=0; i<BB.nChildNode("author"); i++)
265 bbtk::GetTextOrClear(BB.getChildNode("author",&j),val);
270 for (i=0,j=0; i<BB.nChildNode("description"); i++)
273 bbtk::GetTextOrClear(BB.getChildNode("description",&j),val);
278 for (i=0,j=0; i<BB.nChildNode("category"); i++)
281 bbtk::GetTextOrClear(BB.getChildNode("category",&j),val);
286 if (BB.nChildNode("namespace"))
288 bbtk::GetTextOrClear(BB.getChildNode("namespace"),mNamespace);
291 // UserSetDefaultValues body
292 if (BB.nChildNode("defaultValues"))
294 bbtk::GetTextOrClear(BB.getChildNode("defaultValues"),
295 mUserSetDefaultValues);
298 // UserInitializeProcessing body
299 if (BB.nChildNode("initializeProcessing"))
301 bbtk::GetTextOrClear(BB.getChildNode("initializeProcessing"),
302 mUserInitializeProcessing);
305 // UserFinalizeProcessing body
306 if (BB.nChildNode("finalizeProcessing"))
308 bbtk::GetTextOrClear(BB.getChildNode("finalizeProcessing"),
309 mUserFinalizeProcessing);
314 // Template parameters
315 // mNbTemplateParam = BB.nChildNode("template");
317 if ( BB.nChildNode("template") > 0)
319 mTemplateDeclaration = "<";
320 mTemplateImplementation = "<";
322 for (i=0,j=0; i<BB.nChildNode("template")-1; i++)
324 mTemplateDeclaration += "class ";
326 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
327 mTemplateDeclaration += val;
328 mTemplateDeclaration += ",";
329 mTemplateImplementation += val;
330 mTemplateImplementation += ",";
331 mTemplateParam.push_back(val);
333 mTemplateDeclaration += "class ";
335 bbtk::GetTextOrClear(BB.getChildNode("template",&j),val);
336 mTemplateDeclaration += val;
337 mTemplateDeclaration += ">";
338 mTemplateImplementation += val;
339 mTemplateImplementation += ">";
340 mTemplateParam.push_back(val);
344 for (i=0,j=0; i<BB.nChildNode("include"); i++)
347 bbtk::GetTextOrClear(BB.getChildNode("include",&j),val);
348 mInclude.push_back(val);
351 for (i=0,j=0; i<BB.nChildNode("typedef"); i++)
354 bbtk::GetTextOrClear(BB.getChildNode("typedef",&j),val);
355 mTypedef.push_back(val);
359 for (i=0,j=0; i<BB.nChildNode("input"); i++)
362 XMLNode n = BB.getChildNode("input",&j);
363 if (!n.isAttributeSet("name"))
365 throw bbfyException("Error : <input> attribute 'name' not found (mandatory)");
367 io.name = n.getAttribute("name");
368 if (!n.isAttributeSet("type"))
370 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
372 io.type = n.getAttribute("type");
373 if (!n.isAttributeSet("description"))
375 throw bbfyException("Error : <input name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
377 io.descr = n.getAttribute("description");
379 if (n.isAttributeSet("special"))
381 io.special = n.getAttribute("special");
384 if (n.isAttributeSet("nature"))
386 io.nature = n.getAttribute("nature");
389 if (n.isAttributeSet("generic_type"))
391 io.generic_type = n.getAttribute("generic_type");
394 mInput.push_back(io);
398 for (i=0,j=0; i<BB.nChildNode("output"); i++)
401 XMLNode n = BB.getChildNode("output",&j);
402 if (!n.isAttributeSet("name"))
404 throw bbfyException("Error : <output> attribute 'name' not found (mandatory)");
406 io.name = n.getAttribute("name");
407 if (!n.isAttributeSet("type"))
409 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'type' not found (mandatory)");
411 io.type = n.getAttribute("type");
412 if (!n.isAttributeSet("description"))
414 throw bbfyException("Error : <output name=\""+io.name+"\"> attribute 'description' not found (mandatory)");
416 io.descr = n.getAttribute("description");
418 if (n.isAttributeSet("special"))
420 io.special = n.getAttribute("special");
423 if (n.isAttributeSet("nature"))
425 io.nature = n.getAttribute("nature");
428 if (n.isAttributeSet("generic_type"))
430 io.generic_type = n.getAttribute("generic_type");
433 mOutput.push_back(io);
438 // process tag given ?
439 if (BB.nChildNode("process"))
441 bbtk::GetTextOrClear(BB.getChildNode("process"),mProcess);
445 // createwidget tag given ?
446 if (BB.nChildNode("createwidget"))
448 bbtk::GetTextOrClear(BB.getChildNode("createwidget"),mCreateWidget);
457 // OBSOLETE/UNSUPPORTED TAGS
458 // WARN IF OBSOLETE TAGS PROVIDED
459 if (BB.nChildNode("constructor"))
461 std::cout << "WARNING !!! The tag <constructor> is obsolete !!"<<std::endl;
463 if (BB.nChildNode("destructor"))
465 std::cout << "WARNING !!! The tag <destructor> is obsolete !!"<<std::endl;
467 if (BB.nChildNode("copy_constructor"))
469 std::cout << "WARNING !!! The tag <copy_constructor> is obsolete !!"<<std::endl;
475 //==========================================================================
478 //==========================================================================
479 void bbfy::BeginNamespace()
481 // if (mIsInNamespace)
483 mFile << "namespace "<<mNamespace <<"\n{\n\n";
486 //==========================================================================
488 //==========================================================================
489 void bbfy::EndNamespace()
491 // if (mIsInNamespace)
493 mFile << "}\n// EO namespace "<<mNamespace<<"\n\n";
496 //==========================================================================
499 //==========================================================================
500 void bbfy::CreateHeader()
507 if (mVerbose) std::cout << " - Creating header '"<<mHName<<"'"<<std::endl;
508 std::string fullname = mOutputPath + mHName;
509 mFile.open(fullname.c_str());
512 std::string mess("Error : could not open file \"");
513 mess += fullname + "\"";
514 throw bbfyException(mess);
522 mFile << "#ifdef _USE_WXWIDGETS_\n";
525 // Prevent multiple inclusions
526 std::string included("__bb");
527 included += mPackage + mName + "_h_INCLUDED__";
528 mFile << "#ifndef " << included <<"\n";
529 mFile << "#define " << included <<"\n";
532 mFile << "#include \"bb" << mPackage << "_EXPORT.h\"\n";
533 std::vector<std::string>::iterator i;
534 for (i=mInclude.begin(); i!=mInclude.end(); ++i)
536 mFile << "#include \"" << *i <<"\"\n";
538 if (mGeneric) mFile << "#include \"bbitkImage.h\"\n";
541 if (mType == itkImageToImageFilter )
543 mFile << "#include \"bbtkItkBlackBoxMacros.h\"\n";
545 else if ( (mType == vtkImageAlgorithm) ||
546 (mType == vtkPolyDataAlgorithm) )
548 mFile << "#include \"bbtkVtkBlackBoxMacros.h\"\n";
555 // If it is a template class
556 if (mTemplateParam.size() > 0)
558 mFile << "template " << mTemplateDeclaration <<"\n";
561 // Class declaration and parents
562 mFile << "class bb"<<mPackage<<"_EXPORT "<<mName<<"\n";
566 if (mBB.nChildNode("inherits"))
569 for (i=0,j=0; i<mBB.nChildNode("inherits")-1; i++)
572 << mBB.getChildNode("inherits",&j).getText()
576 << mBB.getChildNode("Inherits",&j).getText()
581 if (mType == itkImageToImageFilter )
583 mFile << " public " << mItkParent <<",\n";
586 mFile << " public "<<mParentBlackBox << "\n";
593 if (mType == itkImageToImageFilter)
595 mFile << " BBTK_ITK_BLACK_BOX_INTERFACE("
597 << mParentBlackBox << ","
602 else if ( (mType == vtkImageAlgorithm) ||
603 (mType == vtkPolyDataAlgorithm) )
605 mFile << " BBTK_VTK_BLACK_BOX_INTERFACE("
607 << mParentBlackBox << ","
615 mFile << " BBTK_BLACK_BOX_INTERFACE("
617 << mParentBlackBox << ");\n";
620 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
629 std::vector<IO>::iterator ioi;
630 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
632 if (ioi->special=="")
634 mFile << " BBTK_DECLARE_INPUT("
640 else if (ioi->special=="itk input")
642 mFile << " BBTK_DECLARE_ITK_INPUT("
648 else if (ioi->special=="vtk input")
650 if (mType == vtkImageAlgorithm) {
651 mFile << " BBTK_DECLARE_VTK_IMAGE_ALGORITHM_INPUT("
657 else if (mType == vtkPolyDataAlgorithm) {
658 mFile << " BBTK_DECLARE_POLY_DATA_ALGORITHM_INPUT("
665 else if (ioi->special=="itk parameter")
667 mFile << " BBTK_DECLARE_ITK_PARAM("
673 else if (ioi->special=="vtk parameter")
675 mFile << " BBTK_DECLARE_VTK_PARAM("
683 std::string mess("Error : input '");
685 mess += "', 'special' attribute '";
686 mess += ioi->special;
688 throw bbfyException(mess);
694 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
696 if (ioi->special=="")
698 mFile << " BBTK_DECLARE_OUTPUT("
704 else if (ioi->special=="itk output")
706 mFile << " BBTK_DECLARE_ITK_OUTPUT("
712 else if (ioi->special=="vtk output")
714 mFile << " BBTK_DECLARE_VTK_OUTPUT("
722 std::string mess("Error : output '");
724 mess += "', 'special' attribute '";
725 mess += ioi->special;
727 throw bbfyException(mess);
732 if ((mType == STD)||(mProcess.size()))
734 mFile << " BBTK_PROCESS(Process);\n" ;
735 mFile << " void Process();\n";
737 else if (mType == itkImageToImageFilter)
739 mFile << " BBTK_ITK_PROCESS();\n" ;
741 else if ((mType == vtkImageAlgorithm) ||
742 (mType == vtkPolyDataAlgorithm) )
745 mFile << " BBTK_VTK_PROCESS();\n" ;
751 mFile << " BBTK_CREATE_WIDGET(CreateWidget);\n" ;
752 mFile << " void CreateWidget(wxWindow*);\n";
757 // EO black box declaration
760 // BO black box description
761 if (mTemplateParam.size()==0)
763 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
765 << mParentBlackBox << ");\n";
766 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
768 else if (mTemplateParam.size()==1)
770 mFile << "BBTK_BEGIN_DESCRIBE_TEMPLATE_BLACK_BOX("
772 //<< mParentBlackBox //<< ","
773 // << mTemplateParam[0]
775 mFile << "BBTK_NAME(\"" << mName
776 << "<\"+bbtk::TypeName<" << mTemplateParam[0]
781 throw bbfyException("template bb with more than 1 templ param not impl");
786 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
789 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
792 mFile << "BBTK_CATEGORY(\""<<mCategory<< "\");\n";
794 for (i=mTypedef.begin(); i!=mTypedef.end(); ++i)
800 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
802 if (mTemplateParam.size()>0)
804 mFile << "BBTK_TEMPLATE_INPUT(";
808 mFile << "BBTK_INPUT(";
810 mFile << mName << "," << ioi->name << ",\""
811 << ioi->descr << "\"," << ioi->type << ",\""
812 << ioi->nature<<"\");\n";
816 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
818 if (mTemplateParam.size()>0)
820 mFile << "BBTK_TEMPLATE_OUTPUT(";
824 mFile << "BBTK_OUTPUT(";
826 mFile << mName << "," << ioi->name << ",\""
827 << ioi->descr << "\"," << ioi->type << ",\""
828 << ioi->nature<<"\");\n";
831 // EO black box description
832 if (mTemplateParam.size()==0)
834 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
837 else if (mTemplateParam.size()==1)
839 mFile << "BBTK_END_DESCRIBE_TEMPLATE_BLACK_BOX("
841 // << mTemplateParam[0]
846 throw bbfyException("template bb with more than 1 templ param not impl");
850 // Untemplatization of itk filters
853 WriteGenericITKFilterHeader();
861 // Prevent multiple inclusions
862 mFile << "#endif // " << included <<"\n";
866 mFile << "#endif // _USE_WXWIDGETS_\n";
874 //==========================================================================
878 //==========================================================================
879 void bbfy::WriteGenericITKFilterHeader()
881 mFile << "\n//===================================================\n";
882 mFile << "// Generic \"untemplatized\" filter\n";
883 mFile << "//===================================================\n";
885 // Class declaration and parents
886 mFile << "class /*BBTK_EXPORT*/ "<<mName<<"Generic\n";
888 mFile << " public bbtk::AtomicBlackBox\n";
892 mFile << " BBTK_BLACK_BOX_INTERFACE("
893 << mName << "Generic,bbtk::AtomicBlackBox);\n";
896 std::vector<IO>::iterator ioi;
897 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
899 mFile << " BBTK_DECLARE_INPUT("
907 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
909 mFile << " BBTK_DECLARE_OUTPUT("
917 mFile << " BBTK_PROCESS(ProcessSwitch);\n";
918 mFile << " private :\n";
919 mFile << " inline void ProcessSwitch();\n";
920 mFile << " template <class T, unsigned int D> void Process();\n";
921 // EO black box declaration
926 // BO black box description
927 mFile << "BBTK_BEGIN_DESCRIBE_BLACK_BOX("
928 << mName << "Generic,bbtk::AtomicBlackBox);\n";
929 mFile << "BBTK_NAME(\"" << mName <<"\");\n";
932 mFile << "BBTK_AUTHOR(\""<<mAuthor<< "\");\n";
935 mFile << "BBTK_DESCRIPTION(\""<<mDescription<< "\");\n";
938 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
940 mFile << "BBTK_INPUT(";
941 mFile << mName << "Generic," << ioi->name << ",\""
942 << ioi->descr << "\"," << ioi->generic_type <<");\n";
946 for (ioi=mOutput.begin(); ioi!=mOutput.end(); ++ioi)
948 mFile << "BBTK_OUTPUT(";
949 mFile << mName << "Generic," << ioi->name << ",\""
950 << ioi->descr << "\"," << ioi->generic_type <<");\n";
953 // EO black box description
954 mFile << "BBTK_END_DESCRIBE_BLACK_BOX("
955 << mName << "Generic);\n";
958 //=================================================================
959 // ProcessSwitch implementation
960 mFile << "void "<< mName <<"Generic::ProcessSwitch()\n"
962 << "CALL_FOR_ALL_TYPES_AND_DIM(bbGetInputIn()->GetType(),\n"
963 << " bbGetInputIn()->GetDimension(),\n"
966 //=================================================================
969 //=================================================================
970 // Template process implementation
971 mFile << "template <class T, unsigned int D>\n"
972 << "void "<<mName<<"Generic::Process()\n"
974 << " bbtkDebugMessageInc(\"Kernel\",9,\n"
976 << "Generic::Process<\"<<TypeName<T>()<<\",\"<<D<<\">()\"<<std::endl);\n"
978 << " typedef itk::Image<T,D> ImageType;\n"
979 << " typedef "<<mName<<"<ImageType> FilterType;\n"
981 << " FilterType* f = new FilterType(\"Temp\");\n"
983 << " f->bbSetInputIn( this->bbGetInputIn()->GetImage<T,D>() );\n";
985 for (ioi=mInput.begin(); ioi!=mInput.end(); ++ioi)
987 if (ioi->name == "In") continue;
988 mFile << " f->bbSetInput"<<ioi->name<<" ( this->bbGetInput"
989 << ioi->name << "() );\n";
992 mFile << " f->bbUpdate();\n"
993 << " this->bbSetOutputOut( new itkImage( f->bbGetOutputOut() ) );\n"
994 << " f->UnRegister();\n"
995 << " bbtkDebugDecTab(\"Kernel\",9);\n"
997 //=================================================================
1001 //==========================================================================
1004 //==========================================================================
1005 void bbfy::CreateCode()
1008 mCxxName += mPackage;
1011 if (mVerbose) std::cout << " - Creating code '"<<mCxxName<<"'"<<std::endl;
1012 std::string fullname = mOutputPath + mCxxName;
1013 mFile.open(fullname.c_str());
1016 std::string mess("Error : could not open file \"");
1019 throw bbfyException(mess);
1026 // Header of the class
1027 mFile << "#include \"" << mHName << "\"\n";
1029 // Include Package header
1030 mFile << "#include \"bb"<<mPackage << "Package.h\"\n";
1037 if (mTemplateParam.size()>0)
1040 mFile << "BBTK_BLACK_BOX_TEMPLATE_IMPLEMENTATION("
1042 << mParentBlackBox << ");\n";
1047 mFile << "BBTK_BLACK_BOX_IMPLEMENTATION("
1048 << mName << "Generic,bbtk::AtomicBlackBox);\n";
1050 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1052 << mName << "Generic)\n";
1057 // Non template class
1059 mFile << "BBTK_ADD_BLACK_BOX_TO_PACKAGE("
1064 mFile << "BBTK_BLACK_BOX_IMPLEMENTATION("
1066 << mParentBlackBox << ");\n";
1069 if ((mType == STD)||(mProcess.size()))
1072 mFile << "void "<<mName<<"::Process()\n{\n";
1073 mFile << mProcess << "\n";
1080 mFile << "void "<<mName<<"::CreateWidget(wxWindow* parent)\n{\n";
1081 mFile << mCreateWidget << "\n";
1086 // User Set Default Values
1088 mFile <<"void "<<mName<<"::bbUserSetDefaultValues()"<<std::endl;
1089 mFile << "{"<<std::endl;
1090 if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
1092 mFile << " BBTK_VTK_SET_DEFAULT_VALUES();\n";
1094 mFile << mUserSetDefaultValues << std::endl;
1095 mFile << "}" << std::endl;
1097 // User Initialize Processing
1099 mFile <<"void "<<mName<<"::bbUserInitializeProcessing()"
1101 mFile << "{"<<std::endl;
1102 if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
1104 mFile << " BBTK_VTK_INITIALIZE_PROCESSING();\n";
1106 mFile << mUserInitializeProcessing << std::endl;
1107 mFile << "}" << std::endl;
1109 // User Finalize Processing
1111 mFile <<"void "<<mName<<"::bbUserFinalizeProcessing()"<<std::endl;
1112 mFile << "{"<<std::endl;
1113 if ( (mType == vtkImageAlgorithm) || (mType == vtkPolyDataAlgorithm) )
1115 mFile << " BBTK_VTK_FINALIZE_PROCESSING();\n";
1117 mFile << mUserFinalizeProcessing << std::endl;
1118 mFile << "}" << std::endl;
1130 //==========================================================================
1136 //==========================================================================
1137 int main(int argc, char **argv)
1140 if (argc<2 || argc>5)
1142 std::cerr << "usage : "<< argv[0] <<" xml_file [package_name] [output_path] [-q]" << std::endl;
1148 std::string package("PACKAGE_NAME");
1149 std::string output_path("");
1150 bool verbose = true;
1151 if (argc>2) package = argv[2];
1152 if (argc>3) output_path = argv[3];
1153 if (argc>4) verbose = false;
1155 bbfy B(argv[1],package,output_path,verbose);
1157 catch (bbfyException e)
1159 std::cerr << argv[0] << " " << argv[1] << std::endl
1160 << e.mMessage << std::endl;
1165 //==========================================================================