X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fappli%2Fbbfy%2Fbbfy.cpp;h=dce426a908dcd6538865332f9e9f692a85630a94;hb=6bfa05367895a6a7cdb78e708a080818c314e906;hp=8123db20035a61d81195550b62097b2039284ad6;hpb=32f28c419e0c356a18a288af2ea6ffdd32a259ca;p=bbtk.git diff --git a/kernel/appli/bbfy/bbfy.cpp b/kernel/appli/bbfy/bbfy.cpp index 8123db2..dce426a 100644 --- a/kernel/appli/bbfy/bbfy.cpp +++ b/kernel/appli/bbfy/bbfy.cpp @@ -3,7 +3,7 @@ #endif #include -#include "xmlParser.h" +#include "bbtkXML.h" #include #include #include @@ -139,27 +139,6 @@ void bbfy::CreateBlackBox() //========================================================================== -//========================================================================== -void GetTextOrClear(const XMLNode& node, std::string& var) -{ - if (node.nText()>0) - { - var = node.getText(); - } - else if (node.nClear()>0) - { - var = node.getClear().lpszValue; - } - else - { - std::string mess("Error : element <"); - mess += node.getName(); - mess += "> : no text nor
 clear tag found";
-      throw bbfyException(mess);
-    }
-}
-//==========================================================================
-
 
 //==========================================================================
 void bbfy::ParseXML()
@@ -207,7 +186,7 @@ void bbfy::ParseXML()
 	    {
 	      throw bbfyException("Error : blackbox type '"+itkImageToImageFilterString+"' but no  tag found (mandatory)");
 	    }
-	  GetTextOrClear(BB.getChildNode("itkparent"),mItkParent);
+	  bbtk::GetTextOrClear(BB.getChildNode("itkparent"),mItkParent);
 	  // 
 	  mGeneric = false;
 	  if (BB.isAttributeSet("generic")) mGeneric=true;
@@ -222,7 +201,7 @@ void bbfy::ParseXML()
 				  +vtkImageAlgorithmString
 				  +"' but no  tag found (mandatory)");
 	    }
-	  GetTextOrClear(BB.getChildNode("vtkparent"),mVtkParent);
+	  bbtk::GetTextOrClear(BB.getChildNode("vtkparent"),mVtkParent);
 	  // 
 	}
     else if (bbtype == vtkPolyDataAlgorithmString )
@@ -235,7 +214,7 @@ void bbfy::ParseXML()
 				  +vtkPolyDataAlgorithmString
 				  +"' but no  tag found (mandatory)");
 	    }
-	  GetTextOrClear(BB.getChildNode("vtkparent"),mVtkParent);
+	  bbtk::GetTextOrClear(BB.getChildNode("vtkparent"),mVtkParent);
 	  // 
 	}
      else 
@@ -269,7 +248,7 @@ void bbfy::ParseXML()
   for (i=0,j=0; i