Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

XMLImageProcessorsDescription.hpp

Go to the documentation of this file.
00001 /* ImLib3D
00002  * Copyright (c) 2001, ULP-IPB Strasbourg.
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or (at
00007  * your option) any later version.
00008  * 
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00017  */
00019 #ifndef _XMLImageProcessorsDescription_hpp
00020 #define _XMLImageProcessorsDescription_hpp
00021 
00022 #include<ImLib3D/CppTools.hpp>
00023 #include<ImLib3D/XMLTools.hpp>
00024 
00025 namespace XIPD
00026 {
00027 
00028 
00029 struct ImageProcessorNode
00030 {
00031     string name;
00032     string parent;
00033     string package;
00034     ImageProcessorNode(xmlpp::Element *node)
00035     {
00036         ReadAttribute   (name);
00037         ReadAttribute   (parent);
00038         ReadAttribute   (package);
00039     }
00040 //protected:    ImageProcessorNode(){;}
00041 };
00042 
00043 struct Argument
00044 {
00045     string name;
00046     string type;
00047     string direction;
00048     string ignoreOutput;
00049     string isOptional;
00050     string defaultValue;
00051     string optType;
00052     Argument(xmlpp::Element *node)
00053     {
00054         ReadAttribute   (name);
00055         ReadAttribute   (type);
00056         ReadOptAttribute(direction);
00057         ReadOptAttribute(ignoreOutput);
00058         ReadOptAttribute(isOptional);
00059         ReadOptAttribute(defaultValue);
00060         ReadOptAttribute(optType);
00061     }
00062 //protected:    Argument(){;}
00063 };
00064 
00065 struct ImageProcessor
00066 {
00067     string name;
00068     string parent;
00069     string package;
00070     string type;
00071     string templateGroup;
00072     string conditional;
00073     string shortDescription;
00074     string longDescription;
00075     vector<Argument> arguments;
00076     ImageProcessor(xmlpp::Element *node)
00077     {
00078         ReadAttribute   (name);
00079         ReadAttribute   (parent);
00080         ReadAttribute   (package);
00081         ReadAttribute   (type);
00082         ReadOptAttribute(templateGroup);
00083         ReadOptAttribute(conditional);
00084         ReadText(node,"ShortDescription",shortDescription);
00085         ReadText(node,"LongDescription",longDescription);
00086         ReadVector(node,"Argument",arguments);
00087     }
00088 //protected:    ImageProcessor(){;}
00089 };
00090 
00091 struct TemplateGroup
00092 {
00093     string name;
00094     string templateBase;
00095     vector<string> types;
00096     TemplateGroup(xmlpp::Element *node)
00097     {
00098         ReadAttribute   (name);
00099         ReadOptAttribute(templateBase);
00100         ReadVector(node,"Type",types);
00101     }
00102 //protected:    TemplateGroup(){;}
00103 };
00104 
00105 
00106 struct ArgumentType
00107 {
00108     string name;
00109     string type;
00110     string cmdLineNumber;
00111     vector<string> listItems;
00112     ArgumentType(xmlpp::Element *node)
00113     {
00114         ReadAttribute   (name);
00115         ReadOptAttribute(type);
00116         ReadOptAttribute(cmdLineNumber);
00117         ReadVector(node,"ListItem",listItems);
00118     }
00119 //protected:    ArgumentType(){;}
00120 };
00121 
00122 
00123 struct ImageProcessorsDescription
00124 {
00125     vector<ImageProcessorNode> imageProcessorNodes;
00126     vector<ImageProcessor>     imageProcessors;
00127     vector<TemplateGroup>      templateGroups;
00128     vector<ArgumentType>       argumentTypes;
00129     ImageProcessorsDescription(xmlpp::Element *node)
00130     {
00131         //RecursiveShowXMLElement(node);
00132         ReadVector(node,"ImageProcessorNode",imageProcessorNodes);
00133         ReadVector(node,"ImageProcessor"    ,imageProcessors);
00134         ReadVector(node,"TemplateGroup"     ,templateGroups);
00135         ReadVector(node,"ArgumentType"      ,argumentTypes);
00136     }
00137 protected:  ImageProcessorsDescription(){;}
00138 };
00139 }
00140 #endif // _XMLImageProcessorsDescription_hpp

Generated on Fri Jun 17 13:36:10 2005 for ImLib3D by  doxygen 1.4.2