/* ImLib3D
 * Copyright (c) 2001, ULP-IPB Strasbourg.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
/*! \file XMLImageProcessorsDescription.hpp */
#ifndef _XMLImageProcessorsDescription_hpp
#define _XMLImageProcessorsDescription_hpp

#include<ImLib3D/CppTools.hpp>
#include<ImLib3D/XMLTools.hpp>

namespace XIPD
{


struct ImageProcessorNode
{
	string name;
	string parent;
	string package;
	ImageProcessorNode(XMLNode *node)
	{
		ReadProperty   (name);
		ReadProperty   (parent);
		ReadProperty   (package);
	}
//protected:	ImageProcessorNode(){;}
};

struct Argument
{
	string name;
	string type;
	string direction;
	string ignoreOutput;
	string isOptional;
	string defaultValue;
	string optType;
	Argument(XMLNode *node)
	{
		ReadProperty   (name);
		ReadProperty   (type);
		ReadOptProperty(direction);
		ReadOptProperty(ignoreOutput);
		ReadOptProperty(isOptional);
		ReadOptProperty(defaultValue);
		ReadOptProperty(optType);
	}
//protected:	Argument(){;}
};

struct ImageProcessor
{
	string name;
	string parent;
	string package;
	string type;
	string templateGroup;
	string conditional;
	string shortDescription;
	string longDescription;
	vector<Argument> arguments;
	ImageProcessor(XMLNode *node)
	{
		ReadProperty   (name);
		ReadProperty   (parent);
		ReadProperty   (package);
		ReadProperty   (type);
		ReadOptProperty(templateGroup);
		ReadOptProperty(conditional);
		ReadText(node,"ShortDescription",shortDescription);
		ReadText(node,"LongDescription",longDescription);
		ReadVector(node,"Argument",arguments);
	}
//protected:	ImageProcessor(){;}
};

struct TemplateGroup
{
	string name;
	string templateBase;
	vector<string> types;
	TemplateGroup(XMLNode *node)
	{
		ReadProperty   (name);
		ReadOptProperty(templateBase);
		ReadVector(node,"Type",types);
	}
//protected:	TemplateGroup(){;}
};


struct ArgumentType
{
	string name;
	string type;
	string cmdLineNumber;
	vector<string> listItems;
	ArgumentType(XMLNode *node)
	{
		ReadProperty   (name);
		ReadOptProperty(type);
		ReadOptProperty(cmdLineNumber);
		ReadVector(node,"ListItem",listItems);
	}
//protected:	ArgumentType(){;}
};


struct ImageProcessorsDescription
{
	vector<ImageProcessorNode> imageProcessorNodes;
	vector<ImageProcessor>     imageProcessors;
	vector<TemplateGroup>      templateGroups;
	vector<ArgumentType>       argumentTypes;
	ImageProcessorsDescription(XMLNode *node)
	{
		ReadVector(node,"ImageProcessorNode",imageProcessorNodes);
		ReadVector(node,"ImageProcessor"    ,imageProcessors);
		ReadVector(node,"TemplateGroup"     ,templateGroups);
		ReadVector(node,"ArgumentType"      ,argumentTypes);
	}
protected:	ImageProcessorsDescription(){;}
};
}
#endif // _XMLImageProcessorsDescription_hpp
