Index: src/UIElements/CommandLineUI/CommandLineParser.cpp
===================================================================
--- src/UIElements/CommandLineUI/CommandLineParser.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
+++ src/UIElements/CommandLineUI/CommandLineParser.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -0,0 +1,528 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * CommandLineParser.cpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <boost/filesystem.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/program_options.hpp>
+#include <fstream>
+#include <iostream>
+#include <map>
+#include <vector>
+
+#include "Actions/Action.hpp"
+#include "Actions/ActionRegistry.hpp"
+#include "Actions/ActionTraits.hpp"
+#include "Actions/OptionRegistry.hpp"
+#include "Actions/OptionTrait.hpp"
+#include "Actions/Values.hpp"
+#include "Helpers/Assert.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+#include "Patterns/Singleton_impl.hpp"
+
+class element;
+
+using namespace std;
+
+/** boost::program_options validator specialization for VectorValue.
+ * \param &v  reference for return value
+ * \param &values string vector of scanned options
+ * \param *
+ * \param
+ *
+ */
+void validate(boost::any& v, const std::vector<std::string>& values, VectorValue *, int)
+{
+  VectorValue VV;
+  std::vector<std::string> components;
+
+  // split comma-separated values
+  if (values.size() != 1) {
+    cerr <<  "Not one vector but " << values.size() << " given " << endl;
+    throw boost::program_options::validation_error("Unequal to one vector given");
+  }
+  std::string argument(values.at(0));
+  std::string::iterator Aiter = argument.begin();
+  std::string::iterator Biter = argument.begin();
+  for (; Aiter != argument.end(); ++Aiter) {
+    if (*Aiter == ',') {
+      components.push_back(string(Biter,Aiter));
+      do {
+        Aiter++;
+      } while (*Aiter == ' ' || *Aiter == '\t');
+      Biter = Aiter;
+    }
+  }
+  components.push_back(string(Biter,argument.end()));
+
+  if (components.size() != 3) {
+    cerr <<  "Specified vector does not have three components but " << components.size() << endl;
+    throw boost::program_options::validation_error("Specified vector does not have three components");
+  }
+  VV.x = boost::lexical_cast<double>(components.at(0));
+  VV.y = boost::lexical_cast<double>(components.at(1));
+  VV.z = boost::lexical_cast<double>(components.at(2));
+  v = boost::any(VectorValue(VV));
+}
+
+void validate(boost::any& v, const std::vector<std::string>& values, BoxValue *, int)
+{
+  BoxValue BV;
+  std::vector<std::string> components;
+
+  // split comma-separated values
+  if (values.size() != 1) {
+    cerr <<  "Not one vector but " << values.size() << " given " << endl;
+    throw boost::program_options::validation_error("Unequal to one vector given");
+  }
+  std::string argument(values.at(0));
+  std::string::iterator Aiter = argument.begin();
+  std::string::iterator Biter = argument.begin();
+  for (; Aiter != argument.end(); ++Aiter) {
+    if (*Aiter == ',') {
+      components.push_back(string(Biter,Aiter));
+      do {
+        Aiter++;
+      } while (*Aiter == ' ' || *Aiter == '\t');
+      Biter = Aiter;
+    }
+  }
+  components.push_back(string(Biter,argument.end()));
+
+  if (components.size() != 6) {
+    cerr <<  "Specified vector does not have three components but " << components.size() << endl;
+    throw boost::program_options::validation_error("Specified symmetric box matrix does not have six components");
+  }
+  BV.xx = boost::lexical_cast<double>(components.at(0));
+  BV.yx = boost::lexical_cast<double>(components.at(1));
+  BV.yy = boost::lexical_cast<double>(components.at(2));
+  BV.zx = boost::lexical_cast<double>(components.at(3));
+  BV.zy = boost::lexical_cast<double>(components.at(4));
+  BV.zz = boost::lexical_cast<double>(components.at(5));
+  v = boost::any(BoxValue(BV));
+}
+
+/** boost::program_options validator specialization for boost::filesystem::path.
+ * \param &v  reference for return value
+ * \param &values string vector of scanned options
+ * \param *
+ * \param
+ *
+ */
+void validate(boost::any& v, const std::vector<std::string>& values, boost::filesystem::path *, int)
+{
+  boost::filesystem::path filename;
+
+  std::cout << "boost::filesystem::path validator used." << std::endl;
+
+  // split comma-separated values
+  if (values.size() != 1) {
+    cerr <<  "Not one file but " << values.size() << " given " << endl;
+    throw boost::program_options::validation_error("Unequal to one file given");
+  }
+  filename = values.at(0);
+  v = boost::any(boost::filesystem::path(filename));
+}
+
+
+/** Constructor of class CommandLineParser.
+ *
+ */
+CommandLineParser::CommandLineParser() :
+  analysis("Analysis options"),
+  atom("Atom options"),
+  command("Command options"),
+  fragmentation("Fragmentation options"),
+  molecule("Molecule options"),
+  parser("Parser options"),
+  selection("Selection options"),
+  tesselation("Tesselation options"),
+  world("World options"),
+  options("Secondary options")
+{
+  // put all options lists into a lookup
+  CmdParserLookup["analysis"] = &analysis;
+  CmdParserLookup["atom"] = &atom;
+  CmdParserLookup["command"] = &command;
+  CmdParserLookup["edit"] = &edit;
+  CmdParserLookup["fragmentation"] = &fragmentation;
+  CmdParserLookup["molecule"] = &molecule;
+  CmdParserLookup["parser"] = &parser;
+  CmdParserLookup["selection"] = &selection;
+  CmdParserLookup["tesselation"] = &tesselation;
+  CmdParserLookup["world"] = &world;
+  CmdParserLookup["options"] = &options;
+}
+
+/** Destructor of class CommandLineParser.
+ *
+ */
+CommandLineParser::~CommandLineParser()
+{}
+
+/** Initializes command arguments to accept.
+ * Goes through ActionRegistry and puts all actions therein into the map.
+ */
+void CommandLineParser::InitializeCommandArguments()
+{
+  ActionRegistry &AR = ActionRegistry::getInstance();
+  bool ActionAlreadyAdded_flag = false;
+  for (ActionRegistry::const_iterator actioniter = AR.getBeginIter(); actioniter != AR.getEndIter(); ++actioniter) {
+    ActionAlreadyAdded_flag = false;
+    Action* const currentAction = actioniter->second;
+    //std::cout << "Current Action to initialize is: " << actioniter->first << std::endl;
+
+    for (ActionTraits::options_const_iterator optioniter = currentAction->Traits.getBeginIter();
+        optioniter != currentAction->Traits.getEndIter();
+        ++optioniter) {
+      if (optioniter->first == actioniter->first)
+        ActionAlreadyAdded_flag = true;
+      ASSERT( OptionRegistry::getInstance().isOptionPresentByName(optioniter->first),
+          "CommandLineParser::Init() - Option not present in OptionRegistry." );
+      const OptionTrait* const currentOption = OptionRegistry::getInstance().getOptionByName(optioniter->first);
+      // add the option
+      std::cout << "Registering Option "
+          << currentOption->getName()
+          << " with type '" << currentOption->getTypeName() << "' "
+          << " with description '" << currentOption->getDescription() << "' ";
+      if (currentOption->hasShortForm())
+        std::cout << ", with short form " << currentOption->getShortForm();
+      else
+        std::cout << ", with no short form ";
+      if (currentOption->hasDefaultValue())
+        std::cout << ", with default value " << currentOption->getDefaultValue();
+      else
+        std::cout << ", with no default value ";
+      std::cout << std::endl;
+
+      AddOptionToParser(currentOption, (CmdParserLookup["options"]));
+    }
+
+    if (!ActionAlreadyAdded_flag) {
+      // add the action
+      std::cout << "Registering Action "
+          << currentAction->Traits.getName()
+          << " in menu " << currentAction->Traits.getMenuName()
+          << " with type '" << currentAction->Traits.getTypeName() << "' "
+          << " with description '" << currentAction->Traits.getDescription() << "' ";
+      if (currentAction->Traits.hasShortForm())
+        std::cout << ", with short form " << currentAction->Traits.getShortForm();
+      else
+        std::cout << ", with no short form ";
+      if (currentAction->Traits.hasDefaultValue())
+        std::cout << ", with default value " << currentAction->Traits.getDefaultValue();
+      else
+        std::cout << ", with no default value ";
+      std::cout  << std::endl;
+
+      ASSERT(CmdParserLookup.find(currentAction->Traits.getMenuName()) != CmdParserLookup.end(),
+          "CommandLineParser: boost::program_options::options_description for this Action not present.");
+      AddOptionToParser(dynamic_cast<const OptionTrait * const>(&(currentAction->Traits)),(CmdParserLookup[currentAction->Traits.getMenuName()]));
+    }
+  }
+  // note: positioning is not important on the command line
+}
+
+/** Adds an Action or Option to the CommandLineParser.
+ * Note that Action is derived from Option(Trait)
+ *
+ * This ugly switch function is necessary because of the compile-time problem:
+ * po::value<T> has to be instantiated at compile-time however we do know the type not until run-time.
+ * Not even a templated function like po::value<T> getProgramOptionValuefromType() does help, specialized
+ * to each available type, as the signatures of all the functions differ. Hence, they cannot not put into
+ * one type_info -> po::value<T> map ...
+ *
+ * \param *currentOption pointer to Action/Option to add
+ * \param *OptionList program_options list to add to
+ */
+void CommandLineParser::AddOptionToParser(const OptionTrait * const currentOption, po::options_description* OptionList)
+{
+  // check whether dynamic_cast in Init() suceeded
+  ASSERT(currentOption != NULL, "CommandLineParser::AddOptionToParser() - currentOption is NULL!");
+  // add other options
+  std::cout << "Adding Action " << currentOption->getName() << " with type " << currentOption->getType()->name() << " and KeyandShortform " << currentOption->getKeyAndShortForm() << " to CommandLineParser." << std::endl;
+  switch(TypeToEnums.getEnumforType(currentOption->getType())) {
+    default:
+    case TypeEnumContainer::NoneType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(), currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::BooleanType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+            currentOption->hasDefaultValue() ?
+                  po::value < bool >()->default_value(boost::lexical_cast<int>(currentOption->getDefaultValue().c_str())) :
+                  po::value < bool >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::BoxType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < BoxValue >()->default_value(boost::lexical_cast<BoxValue>(currentOption->getDefaultValue().c_str())) :
+                  po::value < BoxValue >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::FileType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < boost::filesystem::path >()->default_value(boost::lexical_cast<boost::filesystem::path>(currentOption->getDefaultValue().c_str())) :
+                  po::value < boost::filesystem::path >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::ListOfFilesType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < std::vector<boost::filesystem::path> >()->default_value(boost::lexical_cast< std::vector<boost::filesystem::path> >(currentOption->getDefaultValue().c_str())) :
+                  po::value < std::vector<boost::filesystem::path> >()->multitoken(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::IntegerType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+            currentOption->hasDefaultValue() ?
+                  po::value < int >()->default_value(boost::lexical_cast<int>(currentOption->getDefaultValue().c_str())) :
+                  po::value < int >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::ListOfIntegersType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < std::vector<int> >()->default_value(boost::lexical_cast< std::vector<int> >(currentOption->getDefaultValue().c_str())) :
+                  po::value < std::vector<int> >()->multitoken(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::DoubleType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+            currentOption->hasDefaultValue() ?
+                  po::value < double >()->default_value(boost::lexical_cast<double>(currentOption->getDefaultValue().c_str())) :
+                  po::value < double >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::ListOfDoublesType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < std::vector<double> >()->default_value(boost::lexical_cast< std::vector<double> >(currentOption->getDefaultValue().c_str())) :
+                  po::value < std::vector<double> >()->multitoken(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::StringType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+            currentOption->hasDefaultValue() ?
+                  po::value < std::string >()->default_value(currentOption->getDefaultValue()) :
+                  po::value < std::string >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::ListOfStringsType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < std::vector<std::string> >()->default_value(boost::lexical_cast< std::vector<std::string> >(currentOption->getDefaultValue().c_str())) :
+                  po::value < std::vector<std::string> >()->multitoken(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::VectorType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < VectorValue >()->default_value(boost::lexical_cast<VectorValue>(currentOption->getDefaultValue().c_str())) :
+                  po::value < VectorValue >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::ListOfVectorsType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < std::vector<VectorValue> >()->default_value(boost::lexical_cast< std::vector<VectorValue> >(currentOption->getDefaultValue().c_str())) :
+                  po::value < std::vector<VectorValue> >()->multitoken(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::MoleculeType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < const molecule * >()->default_value(boost::lexical_cast<const molecule *>(currentOption->getDefaultValue().c_str())) :
+                  po::value < int >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::ListOfMoleculesType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < std::vector<const molecule *> >()->default_value(boost::lexical_cast< std::vector<const molecule *> >(currentOption->getDefaultValue().c_str())) :
+                  po::value < std::vector<int> >()->multitoken(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::AtomType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+            currentOption->hasDefaultValue() ?
+                  po::value < int >()->default_value(boost::lexical_cast<int>(currentOption->getDefaultValue().c_str())) :
+                  po::value < int >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::ListOfAtomsType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < std::vector<const atom *> >()->default_value(boost::lexical_cast< std::vector<const atom *> >(currentOption->getDefaultValue().c_str())) :
+                  po::value < std::vector<int> >()->multitoken(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::ElementType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < const element * >()->default_value(boost::lexical_cast<const element *>(currentOption->getDefaultValue().c_str())) :
+                  po::value < int >(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+    case TypeEnumContainer::ListOfElementsType:
+      OptionList->add_options()
+        (currentOption->getKeyAndShortForm().c_str(),
+//            currentOption->hasDefaultValue() ?
+//                  po::value < std::vector<const element *> >()->default_value(boost::lexical_cast< std::vector<const element *> >(currentOption->getDefaultValue().c_str())) :
+                  po::value < std::vector<int> >()->multitoken(),
+                  currentOption->getDescription().c_str())
+        ;
+      break;
+  }
+}
+
+/** States whether there are command line arguments.
+ * \return true - there are none, false - there is at least one command line argument
+ */
+bool CommandLineParser::isEmpty()
+{
+  return vm.empty();
+}
+
+/** Sets the options.
+ * \param _argc arg count from main()
+ * \param **_argv argument array from main()
+ */
+void CommandLineParser::setOptions(int _argc, char **_argv)
+{
+  argc = _argc;
+  argv = _argv;
+  cmdline_options.add(analysis).add(atom).add(command).add(edit).add(fragmentation).add(molecule).add(parser).add(selection).add(tesselation).add(world).add(options);
+  config_file_options.add(options);
+  visible.add(analysis).add(atom).add(command).add(edit).add(fragmentation).add(molecule).add(parser).add(selection).add(tesselation).add(world).add(options);
+}
+
+/** Parses the command line arguments.
+ * Calls program_options::store() and program_options::notify()
+ */
+void CommandLineParser::Parse()
+{
+  po::store(po::command_line_parser(argc,argv).options(cmdline_options).run(), vm);
+  ifstream input;
+  input.open("example.cfg");
+  if (!input.fail())
+    po::store(po::parse_config_file(input, config_file_options), vm);
+  input.close();
+  po::notify(vm);
+}
+
+/** Scan the argument list for -a or --arguments and store their order for later use.
+ */
+void CommandLineParser::scanforSequenceOfArguments()
+{
+  map <std::string, std::string> ShortFormToActionMap = getShortFormToActionMap();
+  // go through all arguments
+  for (int i=1;i<argc;i++) {
+    (cout << Verbose(1) << "Checking on " << argv[i] << endl);
+    // check whether they
+    if (argv[i][0] == '-') { // .. begin with -
+      (cout << Verbose(1) << "Possible argument: " << argv[i] << endl);
+      if (argv[i][1] == '-') { // .. or --
+        (cout << Verbose(1) << "Putting " << argv[i] << " into the sequence." << endl);
+        SequenceOfActions.push_back(&(argv[i][2]));
+        //  .. and check that next letter is not numeric, if so insert
+      } else if (((argv[i][1] < '0') || (argv[i][1] > '9')) && ((argv[i][1] != '.'))) {
+        map <std::string, std::string>::iterator iter = ShortFormToActionMap.find(&(argv[i][1]));
+        if (iter != ShortFormToActionMap.end()) {
+          (cout << Verbose(1) << "Putting " << iter->second << " for " << iter->first << " into the sequence." << endl);
+          SequenceOfActions.push_back(iter->second);
+        }
+      }
+    }
+  }
+}
+
+/** Makes the Parser parse the command line options with current known options.
+ * \param _argc arg count from main()
+ * \param **_argv argument array from main()
+ */
+void CommandLineParser::Run(int _argc, char **_argv)
+{
+  setOptions(_argc,_argv);
+  Parse();
+  scanforSequenceOfArguments();
+}
+
+/** Go through all Actions and create a map from short form to their token.
+ * \return map from Action's ShortForm to token.
+ */
+std::map <std::string, std::string> CommandLineParser::getShortFormToActionMap()
+{
+  map <std::string, std::string> result;
+
+  ActionRegistry &AR = ActionRegistry::getInstance();
+  for (ActionRegistry::const_iterator iter = AR.getBeginIter(); iter != AR.getEndIter(); ++iter)
+    if ((iter->second)->Traits.hasShortForm()) {
+      ASSERT(result.find((iter->second)->Traits.getShortForm()) == result.end(),
+          "Short form "+std::string((iter->second)->Traits.getShortForm())+
+          " for action "+std::string(iter->first)+" already present from "+
+          std::string(result[(iter->second)->Traits.getShortForm()])+"!");
+      result[(iter->second)->Traits.getShortForm()] = (iter->second)->getName();
+    }
+
+  return result;
+}
+
+CONSTRUCT_SINGLETON(CommandLineParser)
Index: src/UIElements/CommandLineUI/CommandLineParser.hpp
===================================================================
--- src/UIElements/CommandLineUI/CommandLineParser.hpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
+++ src/UIElements/CommandLineUI/CommandLineParser.hpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -0,0 +1,167 @@
+/*
+ * CommandLineParser.hpp
+ *
+ *  Created on: May 8, 2010
+ *      Author: heber
+ */
+
+#ifndef COMMANDLINEPARSER_HPP_
+#define COMMANDLINEPARSER_HPP_
+
+#include <boost/program_options.hpp>
+
+namespace po = boost::program_options;
+
+#include "Patterns/Singleton.hpp"
+#include "UIElements/CommandLineUI/TypeEnumContainer.hpp"
+
+#include <map>
+
+class Action;
+class OptionTrait;
+
+/** This class is a wrapper for boost::program_options.
+ *
+ * <h1> CommandLine Howto </h1>
+ * <h2> Introduction </h2>
+ *
+ * The UIFactory is a base class for the User Interaction. There are three UI specializations:
+ * Text, GUI and CommandLine. Accessing functionality via the CommandLine UI is explained here.
+ *
+ * First, an Action has to be written for the specific functionality. This Action should
+ * be added in Actions/...Action in the respective subdirectory of the following types:
+ *  -# Analysis: Analysis actions like evaluating pair correlation, bonds, ...
+ *  -# Atom: adding, removing, manipulating atoms
+ *  -# Cmd: specifying data bases, verbosity, ...
+ *  -# Fragmentation: fragmenting a system, performing graph analysis, ...
+ *  -# Molecule: adding, removing, manipulating molecules
+ *  -# Parser: Parsing files (loading, saving)
+ *  -# Tesselation: obtaining (non)convex surface of a molecule, embedding, ...
+ *  -# World: Setting Box dimensions, default name of new molecules, ...
+ *
+ *  The CommandLineUIFactory is a specialization of the UIFactory for parsing command
+ *  line parameters, generating and executing actions there from.
+ *
+ *  The idea of the CommandLineFactory is explained elsewhere, here we would like to give a
+ *  receipe for creating new actions.
+ *
+ * <h3>Introducing new actions</h3>
+ *
+ * Let us now introduce what to do if a new action is to be implemented. Here, we use the
+ * CommandLineVersionAction as an example.
+ * This consists if basically three parts:
+ * 1. Create the files, write the classes and make them compilable
+ *   - Create new source and header files in one of the above subfolders in the Actions folder,
+ *     e.g. create VersionAction.cpp and VersionAction.hpp in Actions/Cmd/
+ *   - Give it a sensible class name, the convention is <type><what it does>Action,
+ *     where <type> is basically the naming (written out) of the subdirectory,
+ *     e.g. class CommandLineVersionAction.
+ *   - Add the source and header file to the respective variables in molecuilder/src/Makefile.am,
+ *     e.g. if you add a Cmd action the variables are CMDACTIONSOURCE and CMDACTIONHEADER,
+ *     such that they get compiled.
+ * 2. Add an instance to the CommandLineUIFactory, such that they are known to the UI.
+ *   - Add the header file as an include to UIElements/CommandLineWindow.cpp, e.g.
+ *     #include "Actions/Cmd/VersionAction.hpp"
+ *   - Add an instance of your class to the specific populater-function in
+ *     UIElements/CommandLineWindow.cpp, e.g. for the above Cmd action, add to populateCommandActions()
+ *     add new CommandLineVersionAction().
+ *     This will automatically register in the ActionRegistry.
+ * 3. Give them an option name, short hand an description, such that they can be referenced from
+ *    the command line.
+ *   - think of a new key name, e.g. "version", which is the long form of the command parameter,
+ *     i.e. --version).
+ *   - add this key to every map of MapofActions, i.e. to
+ *     - MapofActions::DescriptionMap: the description which appears as help and tooltip
+ *     - MapofActions::ShortFormMap: the short form of the command parameter (e.g. -v)
+ *     - MapofActions::ValueMap: the value the command parameter has (do not create if it does not need one)
+ *   - If your action requires additional parameters, these need to be added in the same manner as in
+ *     the list item above.
+ *
+ *  Don't forget to write the actual code. :)
+ *
+ * <h3>Writing an action</h3>
+ *
+ *  As you write a new action you may think in terms of the command line, i.e. you want to use this
+ *  new functionality you add by calling molecuilder as: ./molecuilder --super-action foobar.txt, where
+ *  the key of your new action would be "super-action". While this is fine, keep in mind, that your action
+ *  should be useable for the other UI specializations as well, i.e. from the menu and the GUI. Therefore,
+ *  -# Don't use cin to ask the user for input: Use Query...()!
+ *  -# Rather don't use cout/cerrs, but either give Log() or eLog() or use QueryEmpty() if you want to give
+ *     the user specific information what you ask of him.
+ *
+ */
+class CommandLineParser : public Singleton<CommandLineParser> {
+  friend class Singleton<CommandLineParser>;
+public:
+
+  // Parses the command line arguments in CommandLineParser::**argv with currently known options.
+  void Run(int _argc, char **_argv);
+
+  // Initialises all options from ActionRegistry.
+  void InitializeCommandArguments();
+
+  // Checks whether there have been any commands on the command line.
+  bool isEmpty();
+
+  /* boost's program_options are sorted into three categories:
+   * -# generic options: option available to both command line and config
+   * -# config options: only available in the config file
+   * -# hidden options: options which the user is not shown on "help"
+   */
+  po::options_description analysis;
+  po::options_description atom;
+  po::options_description command;
+  po::options_description edit;
+  po::options_description fragmentation;
+  po::options_description molecule;
+  po::options_description parser;
+  po::options_description selection;
+  po::options_description tesselation;
+  po::options_description world;
+  po::options_description options;
+
+  po::options_description visible;
+
+  po::variables_map vm;
+
+  // private sequence of actions as they appeared on the command line
+  std::list<std::string> SequenceOfActions;
+
+private:
+  // private constructor and destructor
+  CommandLineParser();
+  virtual ~CommandLineParser();
+
+  /* The following program_options options_decriptions are used to
+   * generate the various cases and call differently in Parse().
+   */
+  po::options_description cmdline_options;
+  po::options_description config_file_options;
+
+  // adds options to the parser
+  void AddOptionToParser(const OptionTrait * const currentOption, po::options_description* OptionList);
+
+  // creates a map from short forms to action tokens needed to parse command line
+  std::map <std::string, std::string> getShortFormToActionMap();
+
+  // lookup list from "configmenus" to the ones of CommandLineParser
+  std::map< std::string , po::options_description *> CmdParserLookup;
+
+  // Sets the options from the three cases.
+  void setOptions(int _argc, char **_argv);
+
+  // Parses all options from command line and config file
+  void Parse();
+
+  // as boost's program_options does not care about of order of appearance but we do for actions,
+  // we have to have a list and a function to obtain it.
+  void scanforSequenceOfArguments();
+
+  TypeEnumContainer TypeToEnums;
+
+  // argument counter and array passed on from main()
+  int argc;
+  char **argv;
+};
+
+#endif /* COMMANDLINEPARSER_HPP_ */
Index: src/UIElements/CommandLineUI/CommandLineWindow.cpp
===================================================================
--- src/UIElements/CommandLineUI/CommandLineWindow.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/CommandLineWindow.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -28,5 +28,5 @@
 #include "Actions/ActionRegistry.hpp"
 
-#include "CommandLineParser.hpp"
+#include "UIElements/CommandLineUI/CommandLineParser.hpp"
 
 #include <iostream>
Index: src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -26,5 +26,5 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
-#include "CommandLineParser.hpp"
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
Index: src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -24,7 +24,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 #include "World.hpp"
 
Index: src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title, string _description) :
Index: src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -23,8 +23,8 @@
 
 #include "Actions/Values.hpp"
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
 #include "LinearAlgebra/Matrix.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, string _description) :
Index: src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 
Index: src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(string title, string _description) :
Index: src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 #include "element.hpp"
 #include "periodentafel.hpp"
Index: src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 #include "element.hpp"
 #include "periodentafel.hpp"
Index: src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -24,7 +24,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::EmptyCommandLineQuery::EmptyCommandLineQuery(string title, string _description) :
Index: src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery(string title, string _description) :
Index: src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(string title, string _description) :
Index: src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(string title, string _description) :
Index: src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -24,7 +24,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, string _description) :
Index: src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -24,7 +24,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 #include "World.hpp"
 
Index: src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title, string _description) :
Index: src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -22,7 +22,7 @@
 #include "CommandLineUI/CommandLineDialog.hpp"
 
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 
 CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(string title, string _description) :
@@ -34,5 +34,5 @@
 bool CommandLineDialog::StringsCommandLineQuery::handle() {
   if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as< vector<string> >();
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<std::string> >();
     return true;
   } else {
Index: src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -23,7 +23,7 @@
 
 #include "Actions/Values.hpp"
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 #include "LinearAlgebra/Vector.hpp"
 #include "Box.hpp"
Index: src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp	(revision 20d46cdad72d15ed708a6d07cac8d9a32eacb773)
+++ src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -25,7 +25,7 @@
 
 #include "Actions/Values.hpp"
+#include "CommandLineUI/CommandLineParser.hpp"
 #include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "CommandLineParser.hpp"
 #include "World.hpp"
 
Index: src/UIElements/CommandLineUI/TypeEnumContainer.cpp
===================================================================
--- src/UIElements/CommandLineUI/TypeEnumContainer.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
+++ src/UIElements/CommandLineUI/TypeEnumContainer.cpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -0,0 +1,101 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * TypeEnumContainer.cpp
+ *
+ *  Created on: Oct 27, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <boost/filesystem.hpp>
+#include <iosfwd>
+#include <typeinfo>
+#include <vector>
+
+#include "Actions/Values.hpp"
+#include "Helpers/Assert.hpp"
+
+#include "UIElements/CommandLineUI/TypeEnumContainer.hpp"
+
+#include "atom.hpp"
+#include "Box.hpp"
+#include "LinearAlgebra/BoxVector.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "element.hpp"
+#include "molecule.hpp"
+
+/** Constructor for class TypeEnumContainer.
+ * Just fills TypeEnumContainer::TypeEnumMap by hand.
+ */
+TypeEnumContainer::TypeEnumContainer()
+{
+  TypeEnumMap[&typeid(void)] = NoneType;
+  TypeEnumMap[&typeid(bool)] = BooleanType;
+  TypeEnumMap[&typeid(Box)] = BoxType;
+  TypeEnumMap[&typeid(BoxVector)] = VectorType;
+  TypeEnumMap[&typeid(Vector)] = VectorType;
+  TypeEnumMap[&typeid(boost::filesystem::path)] = FileType;
+  TypeEnumMap[&typeid(std::vector<boost::filesystem::path>)] = ListOfFilesType;
+  TypeEnumMap[&typeid(int)] = IntegerType;
+  TypeEnumMap[&typeid(std::vector<int>)] = ListOfIntegersType;
+  TypeEnumMap[&typeid(double)] = DoubleType;
+  TypeEnumMap[&typeid(std::vector<double>)] = ListOfDoublesType;
+  TypeEnumMap[&typeid(std::string)] = StringType;
+  TypeEnumMap[&typeid(std::vector<std::string>)] = ListOfStringsType;
+  TypeEnumMap[&typeid(VectorValue)] = VectorType;
+  TypeEnumMap[&typeid(std::vector<VectorValue>)] = ListOfVectorsType;
+  TypeEnumMap[&typeid(const atom *)] = AtomType;
+  TypeEnumMap[&typeid(std::vector<const atom *>)] = ListOfAtomsType;
+  TypeEnumMap[&typeid(const molecule *)] = MoleculeType;
+  TypeEnumMap[&typeid(std::vector<const molecule *>)] = ListOfMoleculesType;
+  TypeEnumMap[&typeid(const element *)] = ElementType;
+  TypeEnumMap[&typeid(std::vector<const element *>)] = ListOfElementsType;
+
+  ListAllKnownTypes();
+};
+
+/** Destructor for class TypeEnumContainer.
+ * Clears TypeEnumContainer::TypeEnumMap.
+ */
+TypeEnumContainer::~TypeEnumContainer()
+{
+  TypeEnumMap.clear();
+}
+
+/** Destructor for class TypeEnumContainer.
+ * Clears TypeEnumContainer::TypeEnumMap.
+ */
+void TypeEnumContainer::ListAllKnownTypes() const
+{
+  for (type_map::const_iterator iter = TypeEnumMap.begin(); iter != TypeEnumMap.end(); ++iter) {
+    std::cout << " Known type is " << (iter->first)->name() << " or enum " << iter->second << std::endl;
+  }
+  std::cout << "BoxVector type is " << typeid(BoxVector).name() << std::endl;
+  std::cout << "Vector type is " << typeid(Vector).name() << std::endl;
+  std::cout << "VectorValue type is " << typeid(VectorValue).name() << std::endl;
+}
+
+/** Getter for TypeEnumContainer::TypeEnumMap.
+ * Note: \a *_type must be present, is checked by ASSERT().
+ * \param *_type type requested
+ */
+enum TypeEnumContainer::EnumOfTypes TypeEnumContainer::getEnumforType(const std::type_info *_type)
+{
+  std::cout << "Looking for type " << _type->name() << std::endl;
+  ASSERT(TypeEnumMap.find(_type) != TypeEnumMap.end(),
+      "CommandLineParser::getEnumforType() - cannot find the type as enum!.");
+  return (TypeEnumMap[_type]);
+}
+
Index: src/UIElements/CommandLineUI/TypeEnumContainer.hpp
===================================================================
--- src/UIElements/CommandLineUI/TypeEnumContainer.hpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
+++ src/UIElements/CommandLineUI/TypeEnumContainer.hpp	(revision e4afb4b989433224538ab4ba0f471e4573bbeaf2)
@@ -0,0 +1,55 @@
+/*
+ * TypeEnumContainer.hpp
+ *
+ *  Created on: Oct 27, 2010
+ *      Author: heber
+ */
+
+#ifndef TYPEENUMCONTAINER_HPP_
+#define TYPEENUMCONTAINER_HPP_
+
+#include <map>
+#include <typeinfo>
+
+class TypeEnumContainer {
+public:
+  TypeEnumContainer();
+  ~TypeEnumContainer();
+
+  /** Enumeration of all possible input types.
+   *
+   */
+  enum EnumOfTypes { NoneType,
+        BooleanType,
+        BoxType,
+        FileType,
+        ListOfFilesType,
+        IntegerType,
+        ListOfIntegersType,
+        DoubleType,
+        ListOfDoublesType,
+        StringType,
+        ListOfStringsType,
+        VectorType,
+        ListOfVectorsType,
+        AtomType,
+        ListOfAtomsType,
+        MoleculeType,
+        ListOfMoleculesType,
+        ElementType,
+        ListOfElementsType
+  };
+
+  typedef std::map< const std::type_info *, enum EnumOfTypes >  type_map;
+
+  enum EnumOfTypes getEnumforType(const std::type_info *_type);
+
+  void ListAllKnownTypes() const;
+
+private:
+  // type to enum map for AddOptionToParser()
+  type_map TypeEnumMap;
+};
+
+
+#endif /* TYPEENUMCONTAINER_HPP_ */
