00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
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
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
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
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
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
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