Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 57a6ea1a91e89f394ecb0bdcf58b45e3ca1587e9)
+++ src/Makefile.am	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -129,4 +129,37 @@
 				  
 QTUISOURCE = allmocs.moc.cpp \
+  UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/FileQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/IntQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/StringQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp \
+  UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp \
+  UIElements/Qt4/Query/AtomQtQuery.cpp \
+  UIElements/Qt4/Query/AtomsQtQuery.cpp \
+  UIElements/Qt4/Query/BooleanQtQuery.cpp \
+  UIElements/Qt4/Query/BoxQtQuery.cpp \
+  UIElements/Qt4/Query/DoubleQtQuery.cpp \
+  UIElements/Qt4/Query/DoublesQtQuery.cpp \
+  UIElements/Qt4/Query/ElementQtQuery.cpp \
+  UIElements/Qt4/Query/ElementsQtQuery.cpp \
+  UIElements/Qt4/Query/EmptyQtQuery.cpp \
+  UIElements/Qt4/Query/FileQtQuery.cpp \
+  UIElements/Qt4/Query/IntQtQuery.cpp \
+  UIElements/Qt4/Query/IntsQtQuery.cpp \
+  UIElements/Qt4/Query/MoleculeQtQuery.cpp \
+  UIElements/Qt4/Query/MoleculesQtQuery.cpp \
+  UIElements/Qt4/Query/StringQtQuery.cpp \
+  UIElements/Qt4/Query/StringsQtQuery.cpp \
+  UIElements/Qt4/Query/VectorQtQuery.cpp \
+  UIElements/Qt4/Query/VectorsQtQuery.cpp \
 	UIElements/Qt4/QtMainWindow.cpp \
 	UIElements/Qt4/QtDialog.cpp \
@@ -138,5 +171,8 @@
 	UIElements/Views/Qt4/QtStatusBar.cpp
              
-QTUIHEADER = ${QTUIMOC_HEADER} UIElements/Qt4/QtUIFactory.hpp
+QTUIHEADER = \
+  ${QTUIMOC_HEADER} \
+  UIElements/Qt4/Pipe/QtQueryListPipe.hpp \
+  UIElements/Qt4/QtUIFactory.hpp
 
 QTUI_DEFS =
Index: src/UIElements/CommandLineUI/CommandLineDialog.cpp
===================================================================
--- src/UIElements/CommandLineUI/CommandLineDialog.cpp	(revision 57a6ea1a91e89f394ecb0bdcf58b45e3ca1587e9)
+++ src/UIElements/CommandLineUI/CommandLineDialog.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -20,30 +20,6 @@
 #include "Helpers/MemDebug.hpp"
 
-#include <iostream>
-#include <vector>
-
-#include <Descriptors/AtomDescriptor.hpp>
-#include <Descriptors/AtomIdDescriptor.hpp>
-#include <Descriptors/MoleculeDescriptor.hpp>
-#include <Descriptors/MoleculeIdDescriptor.hpp>
 #include "CommandLineUI/CommandLineDialog.hpp"
 
-#include "Actions/Values.hpp"
-
-#include "element.hpp"
-#include "periodentafel.hpp"
-#include "CommandLineParser.hpp"
-#include "defs.hpp"
-#include "Helpers/Log.hpp"
-#include "LinearAlgebra/Matrix.hpp"
-#include "periodentafel.hpp"
-#include "Helpers/Verbose.hpp"
-#include "World.hpp"
-#include "Box.hpp"
-
-#include "atom.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "LinearAlgebra/Vector.hpp"
 
 using namespace std;
@@ -132,348 +108,4 @@
 
 /************************** Query Infrastructure ************************/
-
-CommandLineDialog::EmptyCommandLineQuery::EmptyCommandLineQuery(string title, string _description) :
-    Dialog::EmptyQuery(title, _description)
-{}
-
-CommandLineDialog::EmptyCommandLineQuery::~EmptyCommandLineQuery() {}
-
-bool CommandLineDialog::EmptyCommandLineQuery::handle() {
-  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
-  return true;
-}
-
-CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(string title, string _description) :
-    Dialog::IntQuery(title, _description)
-{}
-
-CommandLineDialog::IntCommandLineQuery::~IntCommandLineQuery() {}
-
-bool CommandLineDialog::IntCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<int>();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integer for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(string title, string _description) :
-    Dialog::IntsQuery(title, _description)
-{}
-
-CommandLineDialog::IntsCommandLineQuery::~IntsCommandLineQuery() {}
-
-bool CommandLineDialog::IntsCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integers for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title, string _description) :
-    Dialog::BooleanQuery(title, _description)
-{}
-
-CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {}
-
-bool CommandLineDialog::BooleanCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<bool>();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing boolean for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title, string _description) :
-    Dialog::StringQuery(title, _description)
-{}
-
-CommandLineDialog::StringCommandLineQuery::~StringCommandLineQuery() {}
-
-bool CommandLineDialog::StringCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<string>();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing string for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(string title, string _description) :
-    Dialog::StringsQuery(title, _description)
-{}
-
-CommandLineDialog::StringsCommandLineQuery::~StringsCommandLineQuery() {}
-
-bool CommandLineDialog::StringsCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as< vector<string> >();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing strings for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(string title, string _description) :
-    Dialog::DoubleQuery(title, _description)
-{}
-
-CommandLineDialog::DoubleCommandLineQuery::~DoubleCommandLineQuery() {}
-
-bool CommandLineDialog::DoubleCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as<double>();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing double for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(string title, string _description) :
-    Dialog::DoublesQuery(title, _description)
-{}
-
-CommandLineDialog::DoublesCommandLineQuery::~DoublesCommandLineQuery() {}
-
-bool CommandLineDialog::DoublesCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing doubles for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(string title, string _description) :
-    Dialog::AtomQuery(title, _description)
-{}
-
-CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {}
-
-bool CommandLineDialog::AtomCommandLineQuery::handle() {
-  int IdxOfAtom = -1;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
-    tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atom for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery(string title, string _description) :
-    Dialog::AtomsQuery(title, _description)
-{}
-
-CommandLineDialog::AtomsCommandLineQuery::~AtomsCommandLineQuery() {}
-
-bool CommandLineDialog::AtomsCommandLineQuery::handle() {
-  std::vector<int> IdxOfAtom;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
-    for (std::vector<int>::iterator iter = IdxOfAtom.begin(); iter != IdxOfAtom.end(); ++iter) {
-      temp = World::getInstance().getAtom(AtomById(*iter));
-      if (temp)
-        tmp.push_back(temp);
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atoms for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, string _description) :
-    Dialog::MoleculeQuery(title, _description)
-{}
-
-CommandLineDialog::MoleculeCommandLineQuery::~MoleculeCommandLineQuery() {}
-
-bool CommandLineDialog::MoleculeCommandLineQuery::handle() {
-  int IdxOfMol = -1;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>();
-    tmp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecule for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery(string title, string _description) :
-    Dialog::MoleculesQuery(title, _description)
-{}
-
-CommandLineDialog::MoleculesCommandLineQuery::~MoleculesCommandLineQuery() {}
-
-bool CommandLineDialog::MoleculesCommandLineQuery::handle() {
-  std::vector<int> IdxOfMol;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
-    for (std::vector<int>::iterator iter = IdxOfMol.begin(); iter != IdxOfMol.end(); ++iter) {
-      temp = World::getInstance().getMolecule(MoleculeById(*iter));
-      if (temp)
-        tmp.push_back(temp);
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecules for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(string title, bool _check, string _description) :
-    Dialog::VectorQuery(title,_check, _description)
-{}
-
-CommandLineDialog::VectorCommandLineQuery::~VectorCommandLineQuery()
-{}
-
-bool CommandLineDialog::VectorCommandLineQuery::handle() {
-  VectorValue temp;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >();
-    tmp[0] = temp.x;
-    tmp[1] = temp.y;
-    tmp[2] = temp.z;
-    if ((check) && (!World::getInstance().getDomain().isInside(tmp))) {
-      DoeLog(1) && (eLog() << Verbose(1) << "Vector " << tmp << " would be outside of box domain." << endl);
-      return false;
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vector for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(string title, bool _check, string _description) :
-    Dialog::VectorsQuery(title,_check, _description)
-{}
-
-CommandLineDialog::VectorsCommandLineQuery::~VectorsCommandLineQuery()
-{}
-
-bool CommandLineDialog::VectorsCommandLineQuery::handle() {
-  std::vector<VectorValue> temporary;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >();
-    for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) {
-      temp[0] = (*iter).x;
-      temp[1] = (*iter).y;
-      temp[2] = (*iter).z;
-      if ((!check) || (World::getInstance().getDomain().isInside(temp)))
-        tmp.push_back(temp);
-      else
-        DoeLog(1) && (eLog() << Verbose(1) << "Vector " << temp << " would be outside of box domain." << endl);
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vectors for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, string _description) :
-    Dialog::BoxQuery(title, _description)
-{}
-
-CommandLineDialog::BoxCommandLineQuery::~BoxCommandLineQuery()
-{}
-
-bool CommandLineDialog::BoxCommandLineQuery::handle() {
-  BoxValue temp;
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    temp = CommandLineParser::getInstance().vm[getTitle()].as< BoxValue >();
-    Matrix M;
-    M.set(0,0, temp.xx);
-    M.set(0,1, temp.yx);
-    M.set(0,2, temp.zx);
-    M.set(1,0, temp.yx);
-    M.set(1,1, temp.yy);
-    M.set(1,2, temp.zy);
-    M.set(2,0, temp.zx);
-    M.set(2,1, temp.zy);
-    M.set(2,2, temp.zz);
-    tmp.setM(M);
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing symmetric box matrix for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, string _description) :
-    Dialog::ElementQuery(title, _description)
-{}
-
-CommandLineDialog::ElementCommandLineQuery::~ElementCommandLineQuery()
-{}
-
-bool CommandLineDialog::ElementCommandLineQuery::handle() {
-  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
-  periodentafel *periode = World::getInstance().getPeriode();
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    int Z = CommandLineParser::getInstance().vm[getTitle()].as< int >();
-    tmp = periode->FindElement(Z);
-    ASSERT(tmp != NULL, "Invalid element specified in ElementCommandLineQuery");
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing element for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery(string title, string _description) :
-    Dialog::ElementsQuery(title, _description)
-{}
-
-CommandLineDialog::ElementsCommandLineQuery::~ElementsCommandLineQuery()
-{}
-
-bool CommandLineDialog::ElementsCommandLineQuery::handle() {
-  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
-  periodentafel *periode = World::getInstance().getPeriode();
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >();
-    for (vector<int>::iterator ZRunner = AllElements.begin(); ZRunner != AllElements.end(); ++ZRunner) {
-      temp = periode->FindElement(*ZRunner);
-      ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery");
-      tmp.push_back(temp);
-    }
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing elements for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
-CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery(string title, string _description) :
-    Dialog::FileQuery(title, _description)
-{}
-
-CommandLineDialog::FileCommandLineQuery::~FileCommandLineQuery() {}
-
-bool CommandLineDialog::FileCommandLineQuery::handle() {
-  if (CommandLineParser::getInstance().vm.count(getTitle())) {
-    tmp = CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >();
-    return true;
-  } else {
-    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing string for " << getTitle() << "." << endl);
-    return false;
-  }
-}
-
+/*       ---> shifted to folder Query                                   */
+/************************************************************************/
Index: src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/AtomCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "CommandLineParser.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+#include "Box.hpp"
+
+using namespace std;
+
+CommandLineDialog::AtomCommandLineQuery::AtomCommandLineQuery(string title, string _description) :
+    Dialog::AtomQuery(title, _description)
+{}
+
+CommandLineDialog::AtomCommandLineQuery::~AtomCommandLineQuery() {}
+
+bool CommandLineDialog::AtomCommandLineQuery::handle() {
+  int IdxOfAtom = -1;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    tmp = World::getInstance().getAtom(AtomById(IdxOfAtom));
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atom for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/AtomsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "World.hpp"
+
+CommandLineDialog::AtomsCommandLineQuery::AtomsCommandLineQuery(string title, string _description) :
+    Dialog::AtomsQuery(title, _description)
+{}
+
+CommandLineDialog::AtomsCommandLineQuery::~AtomsCommandLineQuery() {}
+
+bool CommandLineDialog::AtomsCommandLineQuery::handle() {
+  std::vector<int> IdxOfAtom;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfAtom = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
+    for (std::vector<int>::iterator iter = IdxOfAtom.begin(); iter != IdxOfAtom.end(); ++iter) {
+      temp = World::getInstance().getAtom(AtomById(*iter));
+      if (temp)
+        tmp.push_back(temp);
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing atoms for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/BooleanCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+/*
+ * BooleanCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::BooleanCommandLineQuery::BooleanCommandLineQuery(string title, string _description) :
+    Dialog::BooleanQuery(title, _description)
+{}
+
+CommandLineDialog::BooleanCommandLineQuery::~BooleanCommandLineQuery() {}
+
+bool CommandLineDialog::BooleanCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<bool>();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing boolean for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/BoxCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+/*
+ * BoxCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Actions/Values.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::BoxCommandLineQuery::BoxCommandLineQuery(string title, string _description) :
+    Dialog::BoxQuery(title, _description)
+{}
+
+CommandLineDialog::BoxCommandLineQuery::~BoxCommandLineQuery()
+{}
+
+bool CommandLineDialog::BoxCommandLineQuery::handle() {
+  BoxValue temp;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temp = CommandLineParser::getInstance().vm[getTitle()].as< BoxValue >();
+    Matrix M;
+    M.set(0,0, temp.xx);
+    M.set(0,1, temp.yx);
+    M.set(0,2, temp.zx);
+    M.set(1,0, temp.yx);
+    M.set(1,1, temp.yy);
+    M.set(1,2, temp.zy);
+    M.set(2,0, temp.zx);
+    M.set(2,1, temp.zy);
+    M.set(2,2, temp.zz);
+    tmp.setM(M);
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing symmetric box matrix for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/DoubleCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+/*
+ * DoubleCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+
+CommandLineDialog::DoubleCommandLineQuery::DoubleCommandLineQuery(string title, string _description) :
+    Dialog::DoubleQuery(title, _description)
+{}
+
+CommandLineDialog::DoubleCommandLineQuery::~DoubleCommandLineQuery() {}
+
+bool CommandLineDialog::DoubleCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<double>();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing double for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/DoublesCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+/*
+ * DoublesCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::DoublesCommandLineQuery::DoublesCommandLineQuery(string title, string _description) :
+    Dialog::DoublesQuery(title, _description)
+{}
+
+CommandLineDialog::DoublesCommandLineQuery::~DoublesCommandLineQuery() {}
+
+bool CommandLineDialog::DoublesCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<double> >();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing doubles for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,51 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+CommandLineDialog::ElementCommandLineQuery::ElementCommandLineQuery(string title, string _description) :
+    Dialog::ElementQuery(title, _description)
+{}
+
+CommandLineDialog::ElementCommandLineQuery::~ElementCommandLineQuery()
+{}
+
+bool CommandLineDialog::ElementCommandLineQuery::handle() {
+  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
+  periodentafel *periode = World::getInstance().getPeriode();
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    int Z = CommandLineParser::getInstance().vm[getTitle()].as< int >();
+    tmp = periode->FindElement(Z);
+    ASSERT(tmp != NULL, "Invalid element specified in ElementCommandLineQuery");
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing element for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/ElementsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+CommandLineDialog::ElementsCommandLineQuery::ElementsCommandLineQuery(string title, string _description) :
+    Dialog::ElementsQuery(title, _description)
+{}
+
+CommandLineDialog::ElementsCommandLineQuery::~ElementsCommandLineQuery()
+{}
+
+bool CommandLineDialog::ElementsCommandLineQuery::handle() {
+  // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector?
+  periodentafel *periode = World::getInstance().getPeriode();
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    vector<int> AllElements = CommandLineParser::getInstance().vm[getTitle()].as< vector<int> >();
+    for (vector<int>::iterator ZRunner = AllElements.begin(); ZRunner != AllElements.end(); ++ZRunner) {
+      temp = periode->FindElement(*ZRunner);
+      ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery");
+      tmp.push_back(temp);
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing elements for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/EmptyCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+/*
+ * EmptyCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::EmptyCommandLineQuery::EmptyCommandLineQuery(string title, string _description) :
+    Dialog::EmptyQuery(title, _description)
+{}
+
+CommandLineDialog::EmptyCommandLineQuery::~EmptyCommandLineQuery() {}
+
+bool CommandLineDialog::EmptyCommandLineQuery::handle() {
+  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
+  return true;
+}
+
Index: src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/FileCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+/*
+ * FileCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::FileCommandLineQuery::FileCommandLineQuery(string title, string _description) :
+    Dialog::FileQuery(title, _description)
+{}
+
+CommandLineDialog::FileCommandLineQuery::~FileCommandLineQuery() {}
+
+bool CommandLineDialog::FileCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as< boost::filesystem::path >();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing string for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/IntCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+/*
+ * IntCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::IntCommandLineQuery::IntCommandLineQuery(string title, string _description) :
+    Dialog::IntQuery(title, _description)
+{}
+
+CommandLineDialog::IntCommandLineQuery::~IntCommandLineQuery() {}
+
+bool CommandLineDialog::IntCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integer for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/IntsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+/*
+ * IntsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::IntsCommandLineQuery::IntsCommandLineQuery(string title, string _description) :
+    Dialog::IntsQuery(title, _description)
+{}
+
+CommandLineDialog::IntsCommandLineQuery::~IntsCommandLineQuery() {}
+
+bool CommandLineDialog::IntsCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing integers for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/MoleculeCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculeCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::MoleculeCommandLineQuery::MoleculeCommandLineQuery(string title, string _description) :
+    Dialog::MoleculeQuery(title, _description)
+{}
+
+CommandLineDialog::MoleculeCommandLineQuery::~MoleculeCommandLineQuery() {}
+
+bool CommandLineDialog::MoleculeCommandLineQuery::handle() {
+  int IdxOfMol = -1;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as<int>();
+    tmp = World::getInstance().getMolecule(MoleculeById(IdxOfMol));
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecule for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/MoleculesCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculesCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "World.hpp"
+
+CommandLineDialog::MoleculesCommandLineQuery::MoleculesCommandLineQuery(string title, string _description) :
+    Dialog::MoleculesQuery(title, _description)
+{}
+
+CommandLineDialog::MoleculesCommandLineQuery::~MoleculesCommandLineQuery() {}
+
+bool CommandLineDialog::MoleculesCommandLineQuery::handle() {
+  std::vector<int> IdxOfMol;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    IdxOfMol = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<int> >();
+    for (std::vector<int>::iterator iter = IdxOfMol.begin(); iter != IdxOfMol.end(); ++iter) {
+      temp = World::getInstance().getMolecule(MoleculeById(*iter));
+      if (temp)
+        tmp.push_back(temp);
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing molecules for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/StringCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+/*
+ * StringCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::StringCommandLineQuery::StringCommandLineQuery(string title, string _description) :
+    Dialog::StringQuery(title, _description)
+{}
+
+CommandLineDialog::StringCommandLineQuery::~StringCommandLineQuery() {}
+
+bool CommandLineDialog::StringCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as<string>();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing string for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/StringsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+/*
+ * StringsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+
+CommandLineDialog::StringsCommandLineQuery::StringsCommandLineQuery(string title, string _description) :
+    Dialog::StringsQuery(title, _description)
+{}
+
+CommandLineDialog::StringsCommandLineQuery::~StringsCommandLineQuery() {}
+
+bool CommandLineDialog::StringsCommandLineQuery::handle() {
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    tmp = CommandLineParser::getInstance().vm[getTitle()].as< vector<string> >();
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing strings for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/VectorCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Actions/Values.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "Box.hpp"
+#include "World.hpp"
+
+CommandLineDialog::VectorCommandLineQuery::VectorCommandLineQuery(string title, bool _check, string _description) :
+    Dialog::VectorQuery(title,_check, _description)
+{}
+
+CommandLineDialog::VectorCommandLineQuery::~VectorCommandLineQuery()
+{}
+
+bool CommandLineDialog::VectorCommandLineQuery::handle() {
+  VectorValue temp;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temp = CommandLineParser::getInstance().vm[getTitle()].as< VectorValue >();
+    tmp[0] = temp.x;
+    tmp[1] = temp.y;
+    tmp[2] = temp.z;
+    if ((check) && (!World::getInstance().getDomain().isInside(tmp))) {
+      DoeLog(1) && (eLog() << Verbose(1) << "Vector " << tmp << " would be outside of box domain." << endl);
+      return false;
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vector for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp
===================================================================
--- src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/CommandLineUI/Query/VectorsCommandLineQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorsCommandLineQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <vector>
+
+#include "CommandLineUI/CommandLineDialog.hpp"
+
+#include "Actions/Values.hpp"
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "CommandLineParser.hpp"
+#include "World.hpp"
+
+CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(string title, bool _check, string _description) :
+    Dialog::VectorsQuery(title,_check, _description)
+{}
+
+CommandLineDialog::VectorsCommandLineQuery::~VectorsCommandLineQuery()
+{}
+
+bool CommandLineDialog::VectorsCommandLineQuery::handle() {
+  std::vector<VectorValue> temporary;
+  if (CommandLineParser::getInstance().vm.count(getTitle())) {
+    temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector<VectorValue> >();
+    for(std::vector<VectorValue>::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) {
+      temp[0] = (*iter).x;
+      temp[1] = (*iter).y;
+      temp[2] = (*iter).z;
+      if ((!check) || (World::getInstance().getDomain().isInside(temp)))
+        tmp.push_back(temp);
+      else
+        DoeLog(1) && (eLog() << Verbose(1) << "Vector " << temp << " would be outside of box domain." << endl);
+    }
+    return true;
+  } else {
+    DoeLog(1) && (eLog() << Verbose(1) << "CommandLineUI parsing error: Missing vectors for " << getTitle() << "." << endl);
+    return false;
+  }
+}
+
Index: src/UIElements/Dialog.cpp
===================================================================
--- src/UIElements/Dialog.cpp	(revision 57a6ea1a91e89f394ecb0bdcf58b45e3ca1587e9)
+++ src/UIElements/Dialog.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -23,12 +23,13 @@
 #include "Actions/ValueStorage.hpp"
 
+#include "Helpers/Log.hpp"
 #include "Helpers/Verbose.hpp"
-#include "atom.hpp"
-#include "Box.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "LinearAlgebra/BoxVector.hpp"
-#include "LinearAlgebra/Vector.hpp"
-#include "LinearAlgebra/Matrix.hpp"
+
+class Atom;
+class Box;
+class element;
+class Matrix;
+class molecule;
+class Vector;
 
 using namespace std;
@@ -185,240 +186,5 @@
 }
 
-/****************** Query types Infrastructure **************************/
-
-// Base class
-Dialog::Query::Query(string _title, string _description) :
-    title(_title),
-    description(_description)
-{}
-
-Dialog::Query::~Query() {}
-
-const std::string Dialog::Query::getTitle() const{
-  return title;
-}
-
-const std::string Dialog::Query::getDescription() const{
-  return description;
-}
-// empty Queries
-
-Dialog::EmptyQuery::EmptyQuery(string title, std::string description) :
-    Query(title, description)
-{}
-
-Dialog::EmptyQuery::~EmptyQuery() {}
-
-void Dialog::EmptyQuery::setResult() {
-}
-
-// Int Queries
-
-Dialog::IntQuery::IntQuery(string title, std::string description) :
-    Query(title, description)
-{}
-
-Dialog::IntQuery::~IntQuery() {}
-
-void Dialog::IntQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Ints Queries
-
-Dialog::IntsQuery::IntsQuery(string title, std::string description) :
-    Query(title, description)
-{}
-
-Dialog::IntsQuery::~IntsQuery() {}
-
-void Dialog::IntsQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Bool Queries
-
-Dialog::BooleanQuery::BooleanQuery(string title,std::string description) :
-    Query(title, description)
-{}
-
-Dialog::BooleanQuery::~BooleanQuery() {}
-
-void Dialog::BooleanQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// String Queries
-
-Dialog::StringQuery::StringQuery(string title,std::string _description) :
-    Query(title, _description)
-{}
-
-Dialog::StringQuery::~StringQuery() {};
-
-void Dialog::StringQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Strings Queries
-
-Dialog::StringsQuery::StringsQuery(string title,std::string _description) :
-    Query(title, _description)
-{}
-
-Dialog::StringsQuery::~StringsQuery() {};
-
-void Dialog::StringsQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Double Queries
-
-Dialog::DoubleQuery::DoubleQuery(string title, std::string _description) :
-    Query(title, _description)
-{}
-
-Dialog::DoubleQuery::~DoubleQuery() {};
-
-void Dialog::DoubleQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Doubles Queries
-
-Dialog::DoublesQuery::DoublesQuery(string title, std::string _description) :
-    Query(title, _description)
-{}
-
-Dialog::DoublesQuery::~DoublesQuery() {};
-
-void Dialog::DoublesQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-
-// Atom Queries
-
-Dialog::AtomQuery::AtomQuery(string title, std::string _description) :
-    Query(title, _description),
-    tmp(0)
-{}
-
-Dialog::AtomQuery::~AtomQuery() {}
-
-void Dialog::AtomQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Atoms Queries
-
-Dialog::AtomsQuery::AtomsQuery(string title, std::string _description) :
-    Query(title, _description),
-    tmp(0)
-{}
-
-Dialog::AtomsQuery::~AtomsQuery() {}
-
-void Dialog::AtomsQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Molecule Queries
-
-Dialog::MoleculeQuery::MoleculeQuery(string title, std::string _description) :
-    Query(title, _description),
-    tmp(0)
-{}
-
-Dialog::MoleculeQuery::~MoleculeQuery() {}
-
-void Dialog::MoleculeQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Molecules Queries
-
-Dialog::MoleculesQuery::MoleculesQuery(string title, std::string _description) :
-    Query(title, _description),
-    tmp(0)
-{}
-
-Dialog::MoleculesQuery::~MoleculesQuery() {}
-
-void Dialog::MoleculesQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Vector Queries
-
-Dialog::VectorQuery::VectorQuery(std::string title,bool _check, std::string _description) :
-  Query(title, _description),
-  check(_check)
-{}
-
-Dialog::VectorQuery::~VectorQuery()
-{}
-
-void Dialog::VectorQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Vectors Queries
-
-Dialog::VectorsQuery::VectorsQuery(std::string title,bool _check, std::string _description) :
-  Query(title, _description),
-  check(_check)
-{}
-
-Dialog::VectorsQuery::~VectorsQuery()
-{}
-
-void Dialog::VectorsQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Box Queries
-
-Dialog::BoxQuery::BoxQuery(std::string title, std::string _description) :
-  Query(title, _description)
-{}
-
-Dialog::BoxQuery::~BoxQuery()
-{}
-
-void Dialog::BoxQuery::setResult() {
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Element Queries
-Dialog::ElementQuery::ElementQuery(std::string title, std::string _description) :
-  Query(title, _description)
-  {}
-
-Dialog::ElementQuery::~ElementQuery(){}
-
-void Dialog::ElementQuery::setResult(){
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// Elements Queries
-Dialog::ElementsQuery::ElementsQuery(std::string title, std::string _description) :
-  Query(title, _description)
-  {}
-
-Dialog::ElementsQuery::~ElementsQuery(){}
-
-void Dialog::ElementsQuery::setResult(){
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
-
-// File Queries
-Dialog::FileQuery::FileQuery(std::string title, std::string _description) :
-  Query(title, _description)
-  {}
-
-Dialog::FileQuery::~FileQuery(){}
-
-void Dialog::FileQuery::setResult(){
-  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
-}
+/************************** Query Infrastructure ************************/
+/*       ---> shifted to folder Query                                   */
+/************************************************************************/
Index: src/UIElements/Makefile.am
===================================================================
--- src/UIElements/Makefile.am	(revision 57a6ea1a91e89f394ecb0bdcf58b45e3ca1587e9)
+++ src/UIElements/Makefile.am	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -41,4 +41,23 @@
   ${TEXTUISOURCE} \
   ${VIEWSOURCE} \
+  Query/AtomQuery.cpp \
+  Query/AtomsQuery.cpp \
+  Query/BooleanQuery.cpp \
+  Query/BoxQuery.cpp \
+  Query/DoubleQuery.cpp \
+  Query/DoublesQuery.cpp \
+  Query/ElementQuery.cpp \
+  Query/ElementsQuery.cpp \
+  Query/EmptyQuery.cpp \
+  Query/FileQuery.cpp \
+  Query/IntQuery.cpp \
+  Query/IntsQuery.cpp \
+  Query/MoleculeQuery.cpp \
+  Query/MoleculesQuery.cpp \
+  Query/Query.cpp \
+  Query/StringQuery.cpp \
+  Query/StringsQuery.cpp \
+  Query/VectorQuery.cpp \
+  Query/VectorsQuery.cpp \
   Dialog.cpp \
   MainWindow.cpp
@@ -54,4 +73,22 @@
 
 TEXTUISOURCE = \
+  TextUI/Query/AtomsTextQuery.cpp \
+  TextUI/Query/AtomTextQuery.cpp \
+  TextUI/Query/BooleanTextQuery.cpp \
+  TextUI/Query/BoxTextQuery.cpp \
+  TextUI/Query/DoubleTextQuery.cpp \
+  TextUI/Query/DoublesTextQuery.cpp \
+  TextUI/Query/ElementTextQuery.cpp \
+  TextUI/Query/ElementsTextQuery.cpp \
+  TextUI/Query/EmptyTextQuery.cpp \
+  TextUI/Query/FileTextQuery.cpp \
+  TextUI/Query/IntTextQuery.cpp \
+  TextUI/Query/IntsTextQuery.cpp \
+  TextUI/Query/MoleculesTextQuery.cpp \
+  TextUI/Query/MoleculeTextQuery.cpp \
+  TextUI/Query/StringTextQuery.cpp \
+  TextUI/Query/StringsTextQuery.cpp \
+  TextUI/Query/VectorTextQuery.cpp \
+  TextUI/Query/VectorsTextQuery.cpp \
   TextUI/TextDialog.cpp \
   TextUI/TextStatusIndicator.cpp \
@@ -65,4 +102,22 @@
 
 COMMANDLINEUISOURCE = \
+  CommandLineUI/Query/AtomCommandLineQuery.cpp \
+  CommandLineUI/Query/AtomsCommandLineQuery.cpp \
+  CommandLineUI/Query/BooleanCommandLineQuery.cpp \
+  CommandLineUI/Query/BoxCommandLineQuery.cpp \
+  CommandLineUI/Query/DoubleCommandLineQuery.cpp \
+  CommandLineUI/Query/DoublesCommandLineQuery.cpp \
+  CommandLineUI/Query/ElementCommandLineQuery.cpp \
+  CommandLineUI/Query/ElementsCommandLineQuery.cpp \
+  CommandLineUI/Query/EmptyCommandLineQuery.cpp \
+  CommandLineUI/Query/FileCommandLineQuery.cpp \
+  CommandLineUI/Query/IntCommandLineQuery.cpp \
+  CommandLineUI/Query/IntsCommandLineQuery.cpp \
+  CommandLineUI/Query/MoleculeCommandLineQuery.cpp \
+  CommandLineUI/Query/MoleculesCommandLineQuery.cpp \
+  CommandLineUI/Query/StringCommandLineQuery.cpp \
+  CommandLineUI/Query/StringsCommandLineQuery.cpp \
+  CommandLineUI/Query/VectorCommandLineQuery.cpp \
+  CommandLineUI/Query/VectorsCommandLineQuery.cpp \
   CommandLineUI/CommandLineDialog.cpp \
   CommandLineUI/CommandLineStatusIndicator.cpp \
Index: src/UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/AtomQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Helpers/MemDebug.hpp"
+#include "World.hpp"
+
+
+AtomQtQueryPipe::AtomQtQueryPipe(atom **_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+AtomQtQueryPipe::~AtomQtQueryPipe()
+{}
+
+void AtomQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  (*content) = World::getInstance().getAtom(AtomById(idx));
+  dialog->update();
+}
+
+
Index: src/UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/AtomsQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomsQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <vector>
+
+#include <Qt/qlistwidget.h>
+
+#include "Descriptors/AtomIdDescriptor.hpp"
+#include "Helpers/MemDebug.hpp"
+#include "World.hpp"
+
+
+AtomsQtQueryPipe::AtomsQtQueryPipe(std::vector<atom *>*_content, QtDialog *_dialog, QListWidget *_theList) :
+  content(_content),
+  dialog(_dialog),
+  theList(_theList)
+{}
+
+AtomsQtQueryPipe::~AtomsQtQueryPipe()
+{}
+
+void AtomsQtQueryPipe::update() {
+  // clear target and put all atoms therein
+  (*content).clear();
+  for (std::set<atom *>::iterator iter = currentList.begin(); iter != currentList.end(); ++iter)
+    (*content).push_back(*iter);
+  dialog->update();
+}
+
+void AtomsQtQueryPipe::add() {
+  QList<QListWidgetItem *> items = theList->selectedItems();
+  for (QList<QListWidgetItem *>::iterator iter = items.begin();iter != items.end();++iter) {
+    const int index = (*iter)->text().toInt();
+    atom *Walker = World::getInstance().getAtom(AtomById(index));
+    if (Walker) {
+      (*content).push_back(Walker);
+      currentList.insert(Walker);
+      if (lookup.find(index) != lookup.end())
+        lookup.insert(pair<int, atom*>(index, Walker));
+    }
+  }
+  update();
+}
+
+void AtomsQtQueryPipe::remove() {
+  QList<QListWidgetItem *> items = theList->selectedItems();
+  for (QList<QListWidgetItem *>::iterator iter = items.begin();iter != items.end();++iter) {
+    const int index = (*iter)->text().toInt();
+    atom *Walker = World::getInstance().getAtom(AtomById(index));
+    if (Walker) {
+      currentList.erase(Walker);
+    }
+  }
+  update();
+}
+
+
Index: src/UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/BooleanQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+/*
+ * BooleanQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+BooleanQtQueryPipe::BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox) :
+  content(_content),
+  dialog(_dialog),
+  booleanComboBox(_booleanComboBox)
+{}
+
+BooleanQtQueryPipe::~BooleanQtQueryPipe()
+{}
+
+void BooleanQtQueryPipe::update() {
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/BoxQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+/*
+ * BoxQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+#include <Qt/qtablewidget.h>
+
+#include "LinearAlgebra/Matrix.hpp"
+#include "Box.hpp"
+
+BoxQtQueryPipe::BoxQtQueryPipe(Box &_content, QtDialog *_dialog, QTableWidget *_inputTable) :
+  content(_content),
+  dialog(_dialog),
+  inputTable(_inputTable)
+{
+  tmpM = new Matrix();
+  tmpM->zero();
+}
+
+BoxQtQueryPipe::~BoxQtQueryPipe()
+{
+  delete tmpM;
+}
+
+void BoxQtQueryPipe::update(int row, int column)
+{
+  tmpM->at(row, column) = inputTable->item(row, column)->text().toDouble();
+  content.setM(*tmpM);
+  dialog->update();
+}
+
+
Index: src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/DoubleQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+/*
+ * DoubleQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+DoubleQtQueryPipe::DoubleQtQueryPipe(double *_content, QtDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+DoubleQtQueryPipe::~DoubleQtQueryPipe()
+{}
+
+void DoubleQtQueryPipe::update(double newDbl) {
+  (*content) = newDbl;
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/ElementQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+
+ElementQtQueryPipe::ElementQtQueryPipe(const element **_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+ElementQtQueryPipe::~ElementQtQueryPipe()
+{}
+
+void ElementQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  *content = World::getInstance().getPeriode()->FindElement(idx);
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/ElementsQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,48 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementsQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <vector>
+
+#include <Qt/qcombobox.h>
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+
+ElementsQtQueryPipe::ElementsQtQueryPipe(std::vector<const element *>*_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+ElementsQtQueryPipe::~ElementsQtQueryPipe()
+{}
+
+void ElementsQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  const element *elemental = World::getInstance().getPeriode()->FindElement(idx);
+  if(elemental)
+    (*content).push_back(elemental);
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/EmptyQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+/*
+ * EmptyQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+EmptyQtQueryPipe::EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel) :
+  dialog(_dialog),
+  textLabel(_textLabel)
+{}
+
+EmptyQtQueryPipe::~EmptyQtQueryPipe()
+{}
+
+void EmptyQtQueryPipe::update() {
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/FileQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/FileQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/FileQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+/*
+ * FileQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <iostream>
+#include <boost/filesystem.hpp>
+
+#include <Qt/qcombobox.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qpushbutton.h>
+
+
+FileQtQueryPipe::FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) :
+  content(_content),
+  dialog(_dialog),
+  filenameLineEdit(_filenameLineEdit),
+  filedialogButton(_filedialogButton)
+{
+  theFileDialog = NULL;
+}
+
+FileQtQueryPipe::~FileQtQueryPipe()
+{
+  if (theFileDialog != NULL)
+    delete theFileDialog;
+}
+
+void FileQtQueryPipe::update() {
+  QStringList ListOfFilenames = theFileDialog->selectedFiles();
+  std::cout << "Selected File is " << ListOfFilenames.at(0).toStdString() << std::endl;
+  (*content) = ListOfFilenames.at(0).toStdString();
+  filenameLineEdit->setText(QString::fromStdString((*content).string()));
+  dialog->update();
+}
+
+void FileQtQueryPipe::showFileDialog() {
+  filedialogButton->setFlat(true);
+  if (theFileDialog == NULL) {
+    theFileDialog = new QFileDialog(NULL, tr("Open input file"), QString(), tr("ParallelCarParrinello (*.conf);;MassivelyParallelQuantumChemistry (*.mpqc);;ParticleDataBase (*.pdb);;XYZ (*.xyz)"));
+    theFileDialog->setAcceptMode(QFileDialog::AcceptOpen);
+    theFileDialog->setFileMode(QFileDialog::ExistingFile);
+    theFileDialog->setViewMode(QFileDialog::List);
+  }
+  theFileDialog->exec();
+
+  update();
+  filedialogButton->setFlat(false);
+}
+
+
Index: src/UIElements/Qt4/Pipe/IntQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/IntQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/IntQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+/*
+ * IntQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+IntQtQueryPipe::IntQtQueryPipe(int *_content, QtDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+IntQtQueryPipe::~IntQtQueryPipe()
+{}
+
+void IntQtQueryPipe::update(int newInt) {
+  (*content) = newInt;
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/MoleculeQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculeQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+#include "Descriptors/MoleculeIdDescriptor.hpp"
+#include "World.hpp"
+
+
+MoleculeQtQueryPipe::MoleculeQtQueryPipe(molecule **_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+MoleculeQtQueryPipe::~MoleculeQtQueryPipe()
+{}
+
+void MoleculeQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  (*content) = World::getInstance().getMolecule(MoleculeById(idx));
+  dialog->update();
+}
+
+
Index: src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/MoleculesQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculesQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <vector>
+
+#include <Qt/qcombobox.h>
+
+#include "Descriptors/MoleculeIdDescriptor.hpp"
+#include "World.hpp"
+
+
+MoleculesQtQueryPipe::MoleculesQtQueryPipe(std::vector<molecule *>*_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+MoleculesQtQueryPipe::~MoleculesQtQueryPipe()
+{}
+
+void MoleculesQtQueryPipe::update(int newIndex) {
+  QVariant data = theBox->itemData(newIndex);
+  int idx = data.toInt();
+  molecule *mol = World::getInstance().getMolecule(MoleculeById(idx));
+  if (mol)
+    (*content).push_back(mol);
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp
===================================================================
--- src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/QtQueryListPipe.hpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,78 @@
+/*
+ * QtQueryListPipe.hpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifndef QTQUERYLISTPIPE_HPP_
+#define QTQUERYLISTPIPE_HPP_
+
+template<typename T> QtQueryListPipe<T>::QtQueryListPipe(std::vector<T> *_content, QtDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton) :
+  content(_content),
+  dialog(_dialog),
+  inputBox(_inputBox),
+  inputList(_inputList),
+  AddButton(_AddButton),
+  RemoveButton(_RemoveButton)
+{}
+
+template<typename T> QtQueryListPipe<T>::~QtQueryListPipe()
+{}
+
+template<typename T> void QtQueryListPipe<T>::IntegerEntered(const QString&)
+{
+  AddButton->setEnabled(true);
+}
+
+template<typename T> void QtQueryListPipe<T>::IntegerSelected()
+{
+  if (inputList->selectedItems().empty())
+    RemoveButton->setEnabled(false);
+  else
+    RemoveButton->setEnabled(true);
+}
+
+template<typename T> void QtQueryListPipe<T>::AddInteger() {
+  // type-check
+  std::string text = inputBox->text().toStdString();
+  int number = 0;
+  try {
+    number = boost::lexical_cast<int>(text);
+  } catch (boost::bad_lexical_cast&) {
+    return;
+  };
+  // add item to both
+  inputList->addItem(QString(number));
+  AddValue(number);
+}
+
+template<typename T> void QtQueryListPipe<T>::AddValue(T item) {
+  content->push_back(item);
+
+  dialog->update();
+}
+
+template<typename T> void QtQueryListPipe<T>::RemoveInteger() {
+  QList<QListWidgetItem *> items = inputList->selectedItems();
+  for (QList<QListWidgetItem *>::iterator iter = items.begin(); !items.empty(); iter = items.begin()) {
+    // obtain which position item has (by making it current item)
+    inputList->setCurrentItem(*iter);
+    // remove
+    QtQueryListPipe<T>::RemoteRow(inputList->currentRow()); // template parameters needs to be known, such that compiler knows which to call
+    inputList->removeItemWidget(*iter);
+  }
+}
+
+template<typename T> void QtQueryListPipe<T>::RemoveRow(int row) {
+  int counter = 0;
+  typename std::vector<T>::iterator iter = content->begin();
+  for (; iter != content->end(); ++iter)
+    if (counter++ == row)
+      break;
+  if (iter != content->end())
+      content->erase(iter);
+}
+
+
+#endif /*  QTQUERYLISTPIPE_HPP_  */
Index: src/UIElements/Qt4/Pipe/StringQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/StringQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/StringQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+/*
+ * StringQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <string>
+
+#include <Qt/qcombobox.h>
+
+
+StringQtQueryPipe::StringQtQueryPipe(string *_content, QtDialog *_dialog) :
+  content(_content),
+  dialog(_dialog)
+{}
+
+StringQtQueryPipe::~StringQtQueryPipe()
+{}
+
+void StringQtQueryPipe::update(const QString& newText) {
+  content->assign(newText.toStdString());
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/VectorQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <Qt/qcombobox.h>
+
+
+VectorQtQueryPipe::VectorQtQueryPipe(Vector *_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+VectorQtQueryPipe::~VectorQtQueryPipe()
+{}
+
+void VectorQtQueryPipe::update() {
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp
===================================================================
--- src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Pipe/VectorsQtQueryPipe.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorsQtQueryPipe.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include <vector>
+
+#include <Qt/qcombobox.h>
+
+
+VectorsQtQueryPipe::VectorsQtQueryPipe(std::vector<Vector> *_content, QtDialog *_dialog, QComboBox *_theBox) :
+  content(_content),
+  dialog(_dialog),
+  theBox(_theBox)
+{}
+
+VectorsQtQueryPipe::~VectorsQtQueryPipe()
+{}
+
+void VectorsQtQueryPipe::update() {
+  dialog->update();
+}
+
Index: src/UIElements/Qt4/QtDialog.cpp
===================================================================
--- src/UIElements/Qt4/QtDialog.cpp	(revision 57a6ea1a91e89f394ecb0bdcf58b45e3ca1587e9)
+++ src/UIElements/Qt4/QtDialog.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -20,34 +20,9 @@
 #include "UIElements/Qt4/QtDialog.hpp"
 
-#include <boost/lexical_cast.hpp>
-
-#include <string>
-#include <sstream>
-#include <limits>
-
-#include <QtGui/QDoubleSpinBox>
+#include <QtGui/QDialogButtonBox>
+#include <Qt/qpushbutton.h>
 #include <Qt/qboxlayout.h>
-#include <Qt/qcombobox.h>
-#include <Qt/qdialogbuttonbox.h>
-#include <Qt/qlabel.h>
-#include <Qt/qlineedit.h>
-#include <Qt/qlistwidget.h>
-#include <Qt/qpushbutton.h>
-#include <Qt/qspinbox.h>
-#include <Qt/qtablewidget.h>
-
-#include <boost/lexical_cast.hpp>
 
 #include "Helpers/MemDebug.hpp"
-
-#include "World.hpp"
-#include "periodentafel.hpp"
-#include "atom.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "Descriptors/AtomIdDescriptor.hpp"
-#include "Descriptors/MoleculeIdDescriptor.hpp"
-#include "LinearAlgebra/Matrix.hpp"
-#include "Box.hpp"
 
 
@@ -189,1000 +164,9 @@
 }
 
-/************************** Query Objects *******************************/
+/************************** Query Infrastructure ************************/
+/*       ---> shifted to folder Query                                   */
+/************************************************************************/
 
-QtDialog::BoxQtQuery::BoxQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::BoxQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-
-  // init input table
-  inputTable = new QTableWidget(3,3, _dialog);
-  QStringList CoordinateList;
-  CoordinateList << "x" << "y" << "z";
-  inputTable->setHorizontalHeaderLabels(CoordinateList);
-  inputTable->setVerticalHeaderLabels(CoordinateList);
-
-  pipe = new BoxQtQueryPipe(tmp,_dialog, inputTable);
-
-  // fill the box with current matrix
-  const Matrix &domain = World::getInstance().getDomain().getM();
-  for (int i=0;i<3;i++)
-    for (int j=0;j<3;j++) {
-      QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg(domain.at(i,j)));
-      inputTable->setItem(i,j,newItem);
-      pipe->update(i,j);
-    }
-
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputTable);
-
-  connect(inputTable,SIGNAL(cellChanged(int,int)),pipe,SLOT(update(int,int)));
-}
-
-QtDialog::BoxQtQuery::~BoxQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::BoxQtQuery::handle() {
-  return true;
-}
-
-
-QtDialog::AtomQtQuery::AtomQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::AtomQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QComboBox();
-  inputBox->insertItem(-1, QString("no atom"));
-  std::vector<atom *> atoms = World::getInstance().getAllAtoms();
-  for (std::vector<atom *>::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
-    inputBox->insertItem((*iter)->getNr(),QString::fromStdString((*iter)->getName()));
-
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new AtomQtQueryPipe(&tmp,_dialog, inputBox);
-  pipe->update(inputBox->currentIndex());
-  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
-}
-
-QtDialog::AtomQtQuery::~AtomQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::AtomQtQuery::handle() {
-  return true;
-}
-
-
-QtDialog::AtomsQtQuery::AtomsQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::AtomsQuery(_title),
-    parent(_parent)
-{
-  QHBoxLayout * thisHLayout = new QHBoxLayout();
-  QVBoxLayout * thisV1Layout = new QVBoxLayout();
-  QVBoxLayout * thisV2Layout = new QVBoxLayout();
-
-  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
-  QLabel *inputLabel = new QLabel("Enter to add");
-  QListWidget* inputList = new QListWidget();
-  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
-  std::vector<atom *> atoms = World::getInstance().getAllAtoms();
-  for (std::vector<atom *>::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
-    inputBox->insertItem((*iter)->getNr(),QString((*iter)->getNr()));
-
-  QLineEdit* inputBox = new QLineEdit();
-  inputLabel->setBuddy(inputBox);
-  titleLabel->setBuddy(inputList);
-  QPushButton* AddButton = new QPushButton("Add");
-  AddButton->setEnabled(false);
-  QPushButton* RemoveButton = new QPushButton("Remove");
-  RemoveButton->setEnabled(false);
-
-  thisV1Layout->addWidget(titleLabel);
-  thisV1Layout->addWidget(inputList);
-  thisV2Layout->addWidget(inputLabel);
-  thisV2Layout->addWidget(inputBox);
-  thisV2Layout->addWidget(AddButton);
-  thisV2Layout->addWidget(RemoveButton);
-  parent->addLayout(thisHLayout);
-  thisHLayout->addLayout(thisV1Layout);
-  thisHLayout->addLayout(thisV2Layout);
-
-  pipe = new AtomsQtQueryPipe(&tmp,_dialog,inputList);
-  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
-  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(add()));
-  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(remove()));
-}
-
-QtDialog::AtomsQtQuery::~AtomsQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::AtomsQtQuery::handle() {
-  return true;
-}
-
-QtDialog::IntQtQuery::IntQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::IntQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QSpinBox();
-  inputBox->setValue(0);
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new IntQtQueryPipe(&tmp,_dialog);
-  pipe->update(inputBox->value());
-  connect(inputBox,SIGNAL(valueChanged(int)),pipe,SLOT(update(int)));
-}
-
-QtDialog::IntQtQuery::~IntQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::IntQtQuery::handle() {
-  return true;
-}
-
-
-QtDialog::IntsQtQuery::IntsQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::IntsQuery(_title),
-    parent(_parent)
-{
-  QHBoxLayout * thisHLayout = new QHBoxLayout();
-  QVBoxLayout * thisV1Layout = new QVBoxLayout();
-  QVBoxLayout * thisV2Layout = new QVBoxLayout();
-
-  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
-  QLabel *inputLabel = new QLabel("Enter to add");
-  QListWidget* inputList = new QListWidget();
-  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
-  QLineEdit* inputBox = new QLineEdit();
-  inputLabel->setBuddy(inputBox);
-  titleLabel->setBuddy(inputList);
-  QPushButton* AddButton = new QPushButton("Add");
-  AddButton->setEnabled(false);
-  QPushButton* RemoveButton = new QPushButton("Remove");
-  RemoveButton->setEnabled(false);
-
-  thisV1Layout->addWidget(titleLabel);
-  thisV1Layout->addWidget(inputList);
-  thisV2Layout->addWidget(inputLabel);
-  thisV2Layout->addWidget(inputBox);
-  thisV2Layout->addWidget(AddButton);
-  thisV2Layout->addWidget(RemoveButton);
-  parent->addLayout(thisHLayout);
-  thisHLayout->addLayout(thisV1Layout);
-  thisHLayout->addLayout(thisV2Layout);
-
-  pipe = new QtQueryListPipe<int>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
-  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
-  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
-  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
-  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));
-}
-
-QtDialog::IntsQtQuery::~IntsQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::IntsQtQuery::handle() {
-  return true;
-}
-
-
-QtDialog::DoubleQtQuery::DoubleQtQuery(string title,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::DoubleQuery(title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QDoubleSpinBox();
-  inputBox->setValue(0);
-  inputBox->setRange(-numeric_limits<double>::max(),numeric_limits<double>::max());
-  inputBox->setDecimals(3);
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new DoubleQtQueryPipe(&tmp,_dialog);
-  pipe->update(inputBox->value());
-  connect(inputBox,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
-}
-
-QtDialog::DoubleQtQuery::~DoubleQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::DoubleQtQuery::handle() {
-  return true;
-}
-
-
-QtDialog::DoublesQtQuery::DoublesQtQuery(string title,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::DoublesQuery(title),
-    parent(_parent)
-{
-  QHBoxLayout * thisHLayout = new QHBoxLayout();
-  QVBoxLayout * thisV1Layout = new QVBoxLayout();
-  QVBoxLayout * thisV2Layout = new QVBoxLayout();
-
-  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
-  QLabel *inputLabel = new QLabel("Enter to add");
-  QListWidget* inputList = new QListWidget();
-  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
-  QLineEdit* inputBox = new QLineEdit();
-  inputLabel->setBuddy(inputBox);
-  titleLabel->setBuddy(inputList);
-  QPushButton* AddButton = new QPushButton("Add");
-  AddButton->setEnabled(false);
-  QPushButton* RemoveButton = new QPushButton("Remove");
-  RemoveButton->setEnabled(false);
-
-  thisV1Layout->addWidget(titleLabel);
-  thisV1Layout->addWidget(inputList);
-  thisV2Layout->addWidget(inputLabel);
-  thisV2Layout->addWidget(inputBox);
-  thisV2Layout->addWidget(AddButton);
-  thisV2Layout->addWidget(RemoveButton);
-  parent->addLayout(thisHLayout);
-  thisHLayout->addLayout(thisV1Layout);
-  thisHLayout->addLayout(thisV2Layout);
-
-  pipe = new QtQueryListPipe<double>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
-  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
-  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
-  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
-  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));}
-
-QtDialog::DoublesQtQuery::~DoublesQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::DoublesQtQuery::handle() {
-  return true;
-}
-
-
-QtDialog::StringQtQuery::StringQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::StringQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QLineEdit();
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new StringQtQueryPipe(&tmp,_dialog);
-  pipe->update(inputBox->text());
-  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(update(const QString&)));
-}
-
-QtDialog::StringQtQuery::~StringQtQuery()
-{
-  delete pipe;
-}
-
-// All values besides the empty std::string are valid
-bool QtDialog::StringQtQuery::handle()
-{
-  return tmp!="";
-}
-
-QtDialog::StringsQtQuery::StringsQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::StringsQuery(_title),
-    parent(_parent)
-{
-  QHBoxLayout * thisHLayout = new QHBoxLayout();
-  QVBoxLayout * thisV1Layout = new QVBoxLayout();
-  QVBoxLayout * thisV2Layout = new QVBoxLayout();
-
-  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
-  QLabel *inputLabel = new QLabel("Enter to add");
-  QListWidget* inputList = new QListWidget();
-  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
-  QLineEdit* inputBox = new QLineEdit();
-  inputLabel->setBuddy(inputBox);
-  titleLabel->setBuddy(inputList);
-  QPushButton* AddButton = new QPushButton("Add");
-  AddButton->setEnabled(false);
-  QPushButton* RemoveButton = new QPushButton("Remove");
-  RemoveButton->setEnabled(false);
-
-  thisV1Layout->addWidget(titleLabel);
-  thisV1Layout->addWidget(inputList);
-  thisV2Layout->addWidget(inputLabel);
-  thisV2Layout->addWidget(inputBox);
-  thisV2Layout->addWidget(AddButton);
-  thisV2Layout->addWidget(RemoveButton);
-  parent->addLayout(thisHLayout);
-  thisHLayout->addLayout(thisV1Layout);
-  thisHLayout->addLayout(thisV2Layout);
-
-  pipe = new QtQueryListPipe<std::string>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
-  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
-  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
-  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
-  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));}
-
-QtDialog::StringsQtQuery::~StringsQtQuery()
-{
-  delete pipe;
-}
-
-// All values besides the empty std::string are valid
-bool QtDialog::StringsQtQuery::handle()
-{
-  // dissect by ","
-  std::string::iterator olditer = temp.begin();
-  for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
-    if (*iter == ' ') {
-      tmp.push_back(string(iter, olditer));
-      olditer = iter;
-    }
-  }
-  if (olditer != temp.begin())  // insert last part also
-    tmp.push_back(string(olditer, temp.end()));
-
-  return temp!="";
-}
-
-QtDialog::MoleculeQtQuery::MoleculeQtQuery(string _title, QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::MoleculeQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QComboBox();
-  // add all molecules to the combo box
-  vector<molecule*> molecules = World::getInstance().getAllMolecules();
-  for(vector<molecule*>::iterator iter  = molecules.begin();
-      iter != molecules.end();
-      ++iter) {
-    std::stringstream sstr;
-    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
-    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
-  }
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new MoleculeQtQueryPipe(&tmp,_dialog,inputBox);
-  pipe->update(inputBox->currentIndex());
-  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
-}
-
-QtDialog::MoleculeQtQuery::~MoleculeQtQuery()
-{
-  delete pipe;
-}
-
-// Handling is easy, since the GUI makes it impossible to select invalid values
-bool QtDialog::MoleculeQtQuery::handle()
-{
-  return true;
-}
-
-QtDialog::MoleculesQtQuery::MoleculesQtQuery(string _title, QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::MoleculesQuery(_title),
-    parent(_parent)
-{
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QComboBox();
-  // add all molecules to the combo box
-  vector<molecule*> molecules = World::getInstance().getAllMolecules();
-  for(vector<molecule*>::iterator iter  = molecules.begin();
-      iter != molecules.end();
-      ++iter) {
-    std::stringstream sstr;
-    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
-    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
-  }
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new MoleculesQtQueryPipe(&tmp,_dialog,inputBox);
-  pipe->update(inputBox->currentIndex());
-  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
-}
-
-QtDialog::MoleculesQtQuery::~MoleculesQtQuery()
-{
-  delete pipe;
-}
-
-// Handling is easy, since the GUI makes it impossible to select invalid values
-bool QtDialog::MoleculesQtQuery::handle()
-{
-  return true;
-}
-
-QtDialog::VectorQtQuery::VectorQtQuery(std::string title, bool _check,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::VectorQuery(title,_check),
-    parent(_parent)
-{
-  mainLayout= new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  mainLayout->addWidget(titleLabel);
-  subLayout = new QVBoxLayout();
-  mainLayout->addLayout(subLayout);
-  QComboBox* inputBox = new QComboBox();
-  coordLayout = new QHBoxLayout();
-  subLayout->addLayout(coordLayout);
-  coordLabel = new QLabel(QString("x,y,z"));
-  coordLayout->addWidget(coordLabel);
-  coordInput = new QDoubleSpinBox();
-//  coordInput->setRange(0,M.at(i,i));
-  coordInput->setDecimals(3);
-  coordLayout->addWidget(coordInput);
-  pipe = new VectorQtQueryPipe(&(tmp),_dialog,inputBox);
-  //pipe->update(coordInput->value());
-  connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
-  parent->addLayout(mainLayout);
-}
-
-QtDialog::VectorQtQuery::~VectorQtQuery()
-{}
-
-bool QtDialog::VectorQtQuery::handle() {
-  return true;
-}
-
-
-QtDialog::VectorsQtQuery::VectorsQtQuery(std::string title, bool _check,QBoxLayout *_parent,QtDialog *_dialog) :
-    Dialog::VectorsQuery(title,_check),
-    parent(_parent)
-{
-  mainLayout= new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  mainLayout->addWidget(titleLabel);
-  subLayout = new QVBoxLayout();
-  mainLayout->addLayout(subLayout);
-  QComboBox* inputBox = new QComboBox();
-  coordLayout = new QHBoxLayout();
-  subLayout->addLayout(coordLayout);
-  coordLabel = new QLabel(QString("x,y,z"));
-  coordLayout->addWidget(coordLabel);
-  coordInput = new QDoubleSpinBox();
-//  coordInput->setRange(0,M.at(i,i));
-  coordInput->setDecimals(3);
-  coordLayout->addWidget(coordInput);
-  pipe = new VectorsQtQueryPipe(&(tmp),_dialog,inputBox);
-  //pipe->update(coordInput->value());
-  connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
-  parent->addLayout(mainLayout);
-}
-
-QtDialog::VectorsQtQuery::~VectorsQtQuery()
-{}
-
-bool QtDialog::VectorsQtQuery::handle() {
-  return true;
-}
-
-
-QtDialog::ElementQtQuery::ElementQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
-    Dialog::ElementQuery(_title),
-    parent(_parent)
-{
-  periodentafel *periode = World::getInstance().getPeriode();
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QComboBox();
-  for(periodentafel::const_iterator iter = periode->begin();
-      iter!=periode->end();
-      ++iter)
-  {
-    std::stringstream sstr;
-    sstr << (*iter).first << "\t" << (*iter).second->getName();
-    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
-  }
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new ElementQtQueryPipe(&tmp,_dialog,inputBox);
-  pipe->update(inputBox->currentIndex());
-  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
-}
-
-QtDialog::ElementQtQuery::~ElementQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::ElementQtQuery::handle(){
-  return true;
-}
-
-
-QtDialog::ElementsQtQuery::ElementsQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
-    Dialog::ElementsQuery(_title),
-    parent(_parent)
-{
-  periodentafel *periode = World::getInstance().getPeriode();
-  thisLayout = new QHBoxLayout();
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-  inputBox = new QComboBox();
-  for(periodentafel::const_iterator iter = periode->begin();
-      iter!=periode->end();
-      ++iter)
-  {
-    std::stringstream sstr;
-    sstr << (*iter).first << "\t" << (*iter).second->getName();
-    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
-  }
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(inputBox);
-
-  pipe = new ElementsQtQueryPipe(&tmp,_dialog,inputBox);
-  pipe->update(inputBox->currentIndex());
-  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
-}
-
-QtDialog::ElementsQtQuery::~ElementsQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::ElementsQtQuery::handle(){
-  return true;
-}
-
-QtDialog::EmptyQtQuery::EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
-    Dialog::EmptyQuery(_title),
-    parent(_parent)
-{
-  titleLabel = new QLabel(QString(getTitle().c_str()));
-
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-
-  pipe = new EmptyQtQueryPipe(_dialog,titleLabel);
-}
-
-QtDialog::EmptyQtQuery::~EmptyQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::EmptyQtQuery::handle(){
-  return true;
-}
-
-
-QtDialog::BooleanQtQuery::BooleanQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
-    Dialog::BooleanQuery(_title),
-    parent(_parent)
-{
-  titleLabel = new QLabel(QString(getTitle().c_str()),_dialog);
-  booleanComboBox = new QComboBox(_dialog);
-  booleanComboBox->insertItem(1, QString("true"));
-  booleanComboBox->insertItem(0, QString("false"));
-
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(titleLabel);
-  thisLayout->addWidget(booleanComboBox);
-
-  pipe = new BooleanQtQueryPipe(&tmp,_dialog,booleanComboBox);
-  connect(booleanComboBox, SIGNAL(currentIndexChanged()), pipe, SLOT(update()));
-}
-
-QtDialog::BooleanQtQuery::~BooleanQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::BooleanQtQuery::handle(){
-  return true;
-}
-
-
-QtDialog::FileQtQuery::FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
-    Dialog::FileQuery(_title),
-    parent(_parent)
-{
-
-  filenameLineEdit = new QLineEdit(_dialog);
-  filenameLineEdit->setText(QString());
-  filenameLineEdit->setReadOnly(true);
-
-  filenameLabel = new QLabel(QString("Input file:"));
-  filenameLabel->setBuddy(filenameLineEdit);
-
-  filedialogButton = new QPushButton("&Choose", _dialog);
-
-  pipe = new FileQtQueryPipe(&tmp,_dialog,filenameLineEdit,filedialogButton);
-
-  thisLayout = new QHBoxLayout();
-  parent->addLayout(thisLayout);
-  thisLayout->addWidget(filenameLabel);
-  thisLayout->addWidget(filenameLineEdit);
-  thisLayout->addWidget(filedialogButton);
-
-  QObject::connect(filedialogButton,SIGNAL(clicked()),pipe,SLOT(showFileDialog()));
-}
-
-QtDialog::FileQtQuery::~FileQtQuery()
-{
-  delete pipe;
-}
-
-bool QtDialog::FileQtQuery::handle(){
-  return true;
-}
-
-/*************************** Plumbing *******************************/
-
-
-template<typename T> QtQueryListPipe<T>::QtQueryListPipe(std::vector<T> *_content, QtDialog *_dialog, QLineEdit *_inputBox, QListWidget *_inputList, QPushButton *_AddButton, QPushButton *_RemoveButton) :
-  content(_content),
-  dialog(_dialog),
-  inputBox(_inputBox),
-  inputList(_inputList),
-  AddButton(_AddButton),
-  RemoveButton(_RemoveButton)
-{}
-
-template<typename T> QtQueryListPipe<T>::~QtQueryListPipe()
-{}
-
-template<typename T> void QtQueryListPipe<T>::IntegerEntered(const QString&)
-{
-  AddButton->setEnabled(true);
-}
-
-template<typename T> void QtQueryListPipe<T>::IntegerSelected()
-{
-  if (inputList->selectedItems().empty())
-    RemoveButton->setEnabled(false);
-  else
-    RemoveButton->setEnabled(true);
-}
-
-template<typename T> void QtQueryListPipe<T>::AddInteger() {
-  // type-check
-  std::string text = inputBox->text().toStdString();
-  int number = 0;
-  try {
-    number = boost::lexical_cast<int>(text);
-  } catch (boost::bad_lexical_cast&) {
-    return;
-  };
-  // add item to both
-  inputList->addItem(QString(number));
-  AddValue(number);
-}
-
-template<typename T> void QtQueryListPipe<T>::AddValue(T item) {
-  content->push_back(item);
-
-  dialog->update();
-}
-
-template<typename T> void QtQueryListPipe<T>::RemoveInteger() {
-  QList<QListWidgetItem *> items = inputList->selectedItems();
-  for (QList<QListWidgetItem *>::iterator iter = items.begin(); !items.empty(); iter = items.begin()) {
-    // obtain which position item has (by making it current item)
-    inputList->setCurrentItem(*iter);
-    // remove
-    QtQueryListPipe<T>::RemoteRow(inputList->currentRow()); // template parameters needs to be known, such that compiler knows which to call
-    inputList->removeItemWidget(*iter);
-  }
-}
-
-template<typename T> void QtQueryListPipe<T>::RemoveRow(int row) {
-  int counter = 0;
-  typename std::vector<T>::iterator iter = content->begin();
-  for (; iter != content->end(); ++iter)
-    if (counter++ == row)
-      break;
-  if (iter != content->end())
-      content->erase(iter);
-}
-
-
-StringQtQueryPipe::StringQtQueryPipe(string *_content, QtDialog *_dialog) :
-  content(_content),
-  dialog(_dialog)
-{}
-
-StringQtQueryPipe::~StringQtQueryPipe()
-{}
-
-void StringQtQueryPipe::update(const QString& newText) {
-  content->assign(newText.toStdString());
-  dialog->update();
-}
-
-IntQtQueryPipe::IntQtQueryPipe(int *_content, QtDialog *_dialog) :
-  content(_content),
-  dialog(_dialog)
-{}
-
-IntQtQueryPipe::~IntQtQueryPipe()
-{}
-
-void IntQtQueryPipe::update(int newInt) {
-  (*content) = newInt;
-  dialog->update();
-}
-
-DoubleQtQueryPipe::DoubleQtQueryPipe(double *_content, QtDialog *_dialog) :
-  content(_content),
-  dialog(_dialog)
-{}
-
-DoubleQtQueryPipe::~DoubleQtQueryPipe()
-{}
-
-void DoubleQtQueryPipe::update(double newDbl) {
-  (*content) = newDbl;
-  dialog->update();
-}
-
-VectorQtQueryPipe::VectorQtQueryPipe(Vector *_content, QtDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-VectorQtQueryPipe::~VectorQtQueryPipe()
-{}
-
-void VectorQtQueryPipe::update() {
-  dialog->update();
-}
-
-VectorsQtQueryPipe::VectorsQtQueryPipe(std::vector<Vector> *_content, QtDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-VectorsQtQueryPipe::~VectorsQtQueryPipe()
-{}
-
-void VectorsQtQueryPipe::update() {
-  dialog->update();
-}
-
-BoxQtQueryPipe::BoxQtQueryPipe(Box &_content, QtDialog *_dialog, QTableWidget *_inputTable) :
-  content(_content),
-  dialog(_dialog),
-  inputTable(_inputTable)
-{
-  tmpM = new Matrix();
-  tmpM->zero();
-}
-
-BoxQtQueryPipe::~BoxQtQueryPipe()
-{
-  delete tmpM;
-}
-
-void BoxQtQueryPipe::update(int row, int column)
-{
-  tmpM->at(row, column) = inputTable->item(row, column)->text().toDouble();
-  content.setM(*tmpM);
-  dialog->update();
-}
-
-
-AtomQtQueryPipe::AtomQtQueryPipe(atom **_content, QtDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-AtomQtQueryPipe::~AtomQtQueryPipe()
-{}
-
-void AtomQtQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  (*content) = World::getInstance().getAtom(AtomById(idx));
-  dialog->update();
-}
-
-
-AtomsQtQueryPipe::AtomsQtQueryPipe(std::vector<atom *>*_content, QtDialog *_dialog, QListWidget *_theList) :
-  content(_content),
-  dialog(_dialog),
-  theList(_theList)
-{}
-
-AtomsQtQueryPipe::~AtomsQtQueryPipe()
-{}
-
-void AtomsQtQueryPipe::update() {
-  // clear target and put all atoms therein
-  (*content).clear();
-  for (std::set<atom *>::iterator iter = currentList.begin(); iter != currentList.end(); ++iter)
-    (*content).push_back(*iter);
-  dialog->update();
-}
-
-void AtomsQtQueryPipe::add() {
-  QList<QListWidgetItem *> items = theList->selectedItems();
-  for (QList<QListWidgetItem *>::iterator iter = items.begin();iter != items.end();++iter) {
-    const int index = (*iter)->text().toInt();
-    atom *Walker = World::getInstance().getAtom(AtomById(index));
-    if (Walker) {
-      (*content).push_back(Walker);
-      currentList.insert(Walker);
-      if (lookup.find(index) != lookup.end())
-        lookup.insert(pair<int, atom*>(index, Walker));
-    }
-  }
-  update();
-}
-
-void AtomsQtQueryPipe::remove() {
-  QList<QListWidgetItem *> items = theList->selectedItems();
-  for (QList<QListWidgetItem *>::iterator iter = items.begin();iter != items.end();++iter) {
-    const int index = (*iter)->text().toInt();
-    atom *Walker = World::getInstance().getAtom(AtomById(index));
-    if (Walker) {
-      currentList.erase(Walker);
-    }
-  }
-  update();
-}
-
-
-MoleculeQtQueryPipe::MoleculeQtQueryPipe(molecule **_content, QtDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-MoleculeQtQueryPipe::~MoleculeQtQueryPipe()
-{}
-
-void MoleculeQtQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  (*content) = World::getInstance().getMolecule(MoleculeById(idx));
-  dialog->update();
-}
-
-
-MoleculesQtQueryPipe::MoleculesQtQueryPipe(std::vector<molecule *>*_content, QtDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-MoleculesQtQueryPipe::~MoleculesQtQueryPipe()
-{}
-
-void MoleculesQtQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  molecule *mol = World::getInstance().getMolecule(MoleculeById(idx));
-  if (mol)
-    (*content).push_back(mol);
-  dialog->update();
-}
-
-ElementQtQueryPipe::ElementQtQueryPipe(const element **_content, QtDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-ElementQtQueryPipe::~ElementQtQueryPipe()
-{}
-
-void ElementQtQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  *content = World::getInstance().getPeriode()->FindElement(idx);
-  dialog->update();
-}
-
-ElementsQtQueryPipe::ElementsQtQueryPipe(std::vector<const element *>*_content, QtDialog *_dialog, QComboBox *_theBox) :
-  content(_content),
-  dialog(_dialog),
-  theBox(_theBox)
-{}
-
-ElementsQtQueryPipe::~ElementsQtQueryPipe()
-{}
-
-void ElementsQtQueryPipe::update(int newIndex) {
-  QVariant data = theBox->itemData(newIndex);
-  int idx = data.toInt();
-  const element *elemental = World::getInstance().getPeriode()->FindElement(idx);
-  if(elemental)
-    (*content).push_back(elemental);
-  dialog->update();
-}
-
-EmptyQtQueryPipe::EmptyQtQueryPipe(QtDialog *_dialog, QLabel *_textLabel) :
-  dialog(_dialog),
-  textLabel(_textLabel)
-{}
-
-EmptyQtQueryPipe::~EmptyQtQueryPipe()
-{}
-
-void EmptyQtQueryPipe::update() {
-  dialog->update();
-}
-
-BooleanQtQueryPipe::BooleanQtQueryPipe(const bool *_content, QtDialog *_dialog, QComboBox *_booleanComboBox) :
-  content(_content),
-  dialog(_dialog),
-  booleanComboBox(_booleanComboBox)
-{}
-
-BooleanQtQueryPipe::~BooleanQtQueryPipe()
-{}
-
-void BooleanQtQueryPipe::update() {
-  dialog->update();
-}
-
-FileQtQueryPipe::FileQtQueryPipe(boost::filesystem::path *_content, QtDialog *_dialog, QLineEdit *_filenameLineEdit, QPushButton *_filedialogButton) :
-  content(_content),
-  dialog(_dialog),
-  filenameLineEdit(_filenameLineEdit),
-  filedialogButton(_filedialogButton)
-{
-  theFileDialog = NULL;
-}
-
-FileQtQueryPipe::~FileQtQueryPipe()
-{
-  if (theFileDialog != NULL)
-    delete theFileDialog;
-}
-
-void FileQtQueryPipe::update() {
-  QStringList ListOfFilenames = theFileDialog->selectedFiles();
-  std::cout << "Selected File is " << ListOfFilenames.at(0).toStdString() << std::endl;
-  (*content) = ListOfFilenames.at(0).toStdString();
-  filenameLineEdit->setText(QString::fromStdString((*content).string()));
-  dialog->update();
-}
-
-void FileQtQueryPipe::showFileDialog() {
-  filedialogButton->setFlat(true);
-  if (theFileDialog == NULL) {
-    theFileDialog = new QFileDialog(NULL, tr("Open input file"), QString(), tr("ParallelCarParrinello (*.conf);;MassivelyParallelQuantumChemistry (*.mpqc);;ParticleDataBase (*.pdb);;XYZ (*.xyz)"));
-    theFileDialog->setAcceptMode(QFileDialog::AcceptOpen);
-    theFileDialog->setFileMode(QFileDialog::ExistingFile);
-    theFileDialog->setViewMode(QFileDialog::List);
-  }
-  theFileDialog->exec();
-
-  update();
-  filedialogButton->setFlat(false);
-}
-
-
-
+/*************************** Pipe Infrastructure ************************/
+/*       ---> shifted to folder Pipe                                    */
+/************************************************************************/
Index: src/UIElements/Qt4/QtDialog.hpp
===================================================================
--- src/UIElements/Qt4/QtDialog.hpp	(revision 57a6ea1a91e89f394ecb0bdcf58b45e3ca1587e9)
+++ src/UIElements/Qt4/QtDialog.hpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -206,5 +206,6 @@
       QBoxLayout *thisLayout;
       QLabel *titleLabel;
-      QComboBox *inputBox;
+      QLabel *inputLabel;
+      QListWidget *inputList;
 
       AtomsQtQueryPipe *pipe;
Index: src/UIElements/Qt4/Query/AtomQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/AtomQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/AtomQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "atom.hpp"
+#include "World.hpp"
+
+QtDialog::AtomQtQuery::AtomQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::AtomQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  inputBox->insertItem(-1, QString("no atom"));
+  std::vector<atom *> atoms = World::getInstance().getAllAtoms();
+  for (std::vector<atom *>::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
+    inputBox->insertItem((*iter)->getNr(),QString::fromStdString((*iter)->getName()));
+
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new AtomQtQueryPipe(&tmp,_dialog, inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::AtomQtQuery::~AtomQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::AtomQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/AtomsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/AtomsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/AtomsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qlistwidget.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "atom.hpp"
+#include "World.hpp"
+
+
+QtDialog::AtomsQtQuery::AtomsQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::AtomsQuery(_title),
+    parent(_parent)
+{
+  QHBoxLayout * thisHLayout = new QHBoxLayout();
+  QVBoxLayout * thisV1Layout = new QVBoxLayout();
+  QVBoxLayout * thisV2Layout = new QVBoxLayout();
+
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputLabel = new QLabel("Enter to add");
+  inputList = new QListWidget();
+  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  std::vector<atom *> atoms = World::getInstance().getAllAtoms();
+  for (std::vector<atom *>::const_iterator iter = atoms.begin(); iter != atoms.end(); ++iter)
+    inputList->insertItem((*iter)->getNr(),QString((*iter)->getNr()));
+
+  QLineEdit* inputBox = new QLineEdit();
+  inputLabel->setBuddy(inputBox);
+  titleLabel->setBuddy(inputList);
+  QPushButton* AddButton = new QPushButton("Add");
+  AddButton->setEnabled(false);
+  QPushButton* RemoveButton = new QPushButton("Remove");
+  RemoveButton->setEnabled(false);
+
+  thisV1Layout->addWidget(titleLabel);
+  thisV1Layout->addWidget(inputList);
+  thisV2Layout->addWidget(inputLabel);
+  thisV2Layout->addWidget(inputBox);
+  thisV2Layout->addWidget(AddButton);
+  thisV2Layout->addWidget(RemoveButton);
+  parent->addLayout(thisHLayout);
+  thisHLayout->addLayout(thisV1Layout);
+  thisHLayout->addLayout(thisV2Layout);
+
+  pipe = new AtomsQtQueryPipe(&tmp,_dialog,inputList);
+  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
+  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(add()));
+  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(remove()));
+}
+
+QtDialog::AtomsQtQuery::~AtomsQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::AtomsQtQuery::handle() {
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/BooleanQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/BooleanQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/BooleanQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+/*
+ * BooleanQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::BooleanQtQuery::BooleanQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::BooleanQuery(_title),
+    parent(_parent)
+{
+  titleLabel = new QLabel(QString(getTitle().c_str()),_dialog);
+  booleanComboBox = new QComboBox(_dialog);
+  booleanComboBox->insertItem(1, QString("true"));
+  booleanComboBox->insertItem(0, QString("false"));
+
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(booleanComboBox);
+
+  pipe = new BooleanQtQueryPipe(&tmp,_dialog,booleanComboBox);
+  connect(booleanComboBox, SIGNAL(currentIndexChanged()), pipe, SLOT(update()));
+}
+
+QtDialog::BooleanQtQuery::~BooleanQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::BooleanQtQuery::handle(){
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/BoxQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/BoxQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/BoxQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+/*
+ * BoxQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qtablewidget.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "LinearAlgebra/Matrix.hpp"
+#include "World.hpp"
+
+QtDialog::BoxQtQuery::BoxQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::BoxQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+
+  // init input table
+  inputTable = new QTableWidget(3,3, _dialog);
+  QStringList CoordinateList;
+  CoordinateList << "x" << "y" << "z";
+  inputTable->setHorizontalHeaderLabels(CoordinateList);
+  inputTable->setVerticalHeaderLabels(CoordinateList);
+
+  pipe = new BoxQtQueryPipe(tmp,_dialog, inputTable);
+
+  // fill the box with current matrix
+  const Matrix &domain = World::getInstance().getDomain().getM();
+  for (int i=0;i<3;i++)
+    for (int j=0;j<3;j++) {
+      QTableWidgetItem *newItem = new QTableWidgetItem(tr("%1").arg(domain.at(i,j)));
+      inputTable->setItem(i,j,newItem);
+      pipe->update(i,j);
+    }
+
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputTable);
+
+  connect(inputTable,SIGNAL(cellChanged(int,int)),pipe,SLOT(update(int,int)));
+}
+
+QtDialog::BoxQtQuery::~BoxQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::BoxQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/DoubleQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/DoubleQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/DoubleQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+/*
+ * DoubleQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <QtGui/QDoubleSpinBox>
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::DoubleQtQuery::DoubleQtQuery(string title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::DoubleQuery(title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QDoubleSpinBox();
+  inputBox->setValue(0);
+  inputBox->setRange(-numeric_limits<double>::max(),numeric_limits<double>::max());
+  inputBox->setDecimals(3);
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new DoubleQtQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->value());
+  connect(inputBox,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
+}
+
+QtDialog::DoubleQtQuery::~DoubleQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::DoubleQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/DoublesQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/DoublesQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/DoublesQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+
+/*
+ * DoublesQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qlistwidget.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+#include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
+
+
+QtDialog::DoublesQtQuery::DoublesQtQuery(string title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::DoublesQuery(title),
+    parent(_parent)
+{
+  QHBoxLayout * thisHLayout = new QHBoxLayout();
+  QVBoxLayout * thisV1Layout = new QVBoxLayout();
+  QVBoxLayout * thisV2Layout = new QVBoxLayout();
+
+  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
+  QLabel *inputLabel = new QLabel("Enter to add");
+  QListWidget* inputList = new QListWidget();
+  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  QLineEdit* inputBox = new QLineEdit();
+  inputLabel->setBuddy(inputBox);
+  titleLabel->setBuddy(inputList);
+  QPushButton* AddButton = new QPushButton("Add");
+  AddButton->setEnabled(false);
+  QPushButton* RemoveButton = new QPushButton("Remove");
+  RemoveButton->setEnabled(false);
+
+  thisV1Layout->addWidget(titleLabel);
+  thisV1Layout->addWidget(inputList);
+  thisV2Layout->addWidget(inputLabel);
+  thisV2Layout->addWidget(inputBox);
+  thisV2Layout->addWidget(AddButton);
+  thisV2Layout->addWidget(RemoveButton);
+  parent->addLayout(thisHLayout);
+  thisHLayout->addLayout(thisV1Layout);
+  thisHLayout->addLayout(thisV2Layout);
+
+  pipe = new QtQueryListPipe<double>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
+  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
+  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
+  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));}
+
+QtDialog::DoublesQtQuery::~DoublesQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::DoublesQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/ElementQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/ElementQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/ElementQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+QtDialog::ElementQtQuery::ElementQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::ElementQuery(_title),
+    parent(_parent)
+{
+  periodentafel *periode = World::getInstance().getPeriode();
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  for(periodentafel::const_iterator iter = periode->begin();
+      iter!=periode->end();
+      ++iter)
+  {
+    std::stringstream sstr;
+    sstr << (*iter).first << "\t" << (*iter).second->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new ElementQtQueryPipe(&tmp,_dialog,inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::ElementQtQuery::~ElementQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::ElementQtQuery::handle(){
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/ElementsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/ElementsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/ElementsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+
+QtDialog::ElementsQtQuery::ElementsQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::ElementsQuery(_title),
+    parent(_parent)
+{
+  periodentafel *periode = World::getInstance().getPeriode();
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  for(periodentafel::const_iterator iter = periode->begin();
+      iter!=periode->end();
+      ++iter)
+  {
+    std::stringstream sstr;
+    sstr << (*iter).first << "\t" << (*iter).second->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter).first));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new ElementsQtQueryPipe(&tmp,_dialog,inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::ElementsQtQuery::~ElementsQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::ElementsQtQuery::handle(){
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/EmptyQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/EmptyQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/EmptyQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+/*
+ * EmptyQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::EmptyQtQuery::EmptyQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::EmptyQuery(_title),
+    parent(_parent)
+{
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+
+  pipe = new EmptyQtQueryPipe(_dialog,titleLabel);
+}
+
+QtDialog::EmptyQtQuery::~EmptyQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::EmptyQtQuery::handle(){
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/FileQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/FileQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/FileQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+/*
+ * FileQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::FileQtQuery::FileQtQuery(std::string _title, QBoxLayout *_parent, QtDialog *_dialog) :
+    Dialog::FileQuery(_title),
+    parent(_parent)
+{
+
+  filenameLineEdit = new QLineEdit(_dialog);
+  filenameLineEdit->setText(QString());
+  filenameLineEdit->setReadOnly(true);
+
+  filenameLabel = new QLabel(QString("Input file:"));
+  filenameLabel->setBuddy(filenameLineEdit);
+
+  filedialogButton = new QPushButton("&Choose", _dialog);
+
+  pipe = new FileQtQueryPipe(&tmp,_dialog,filenameLineEdit,filedialogButton);
+
+  thisLayout = new QHBoxLayout();
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(filenameLabel);
+  thisLayout->addWidget(filenameLineEdit);
+  thisLayout->addWidget(filedialogButton);
+
+  QObject::connect(filedialogButton,SIGNAL(clicked()),pipe,SLOT(showFileDialog()));
+}
+
+QtDialog::FileQtQuery::~FileQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::FileQtQuery::handle(){
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/IntQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/IntQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/IntQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+/*
+ * IntQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qspinbox.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::IntQtQuery::IntQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::IntQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QSpinBox();
+  inputBox->setValue(0);
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new IntQtQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->value());
+  connect(inputBox,SIGNAL(valueChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::IntQtQuery::~IntQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::IntQtQuery::handle() {
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/IntsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/IntsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/IntsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+/*
+ * IntsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qlistwidget.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+#include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
+
+
+QtDialog::IntsQtQuery::IntsQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::IntsQuery(_title),
+    parent(_parent)
+{
+  QHBoxLayout * thisHLayout = new QHBoxLayout();
+  QVBoxLayout * thisV1Layout = new QVBoxLayout();
+  QVBoxLayout * thisV2Layout = new QVBoxLayout();
+
+  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
+  QLabel *inputLabel = new QLabel("Enter to add");
+  QListWidget* inputList = new QListWidget();
+  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  QLineEdit* inputBox = new QLineEdit();
+  inputLabel->setBuddy(inputBox);
+  titleLabel->setBuddy(inputList);
+  QPushButton* AddButton = new QPushButton("Add");
+  AddButton->setEnabled(false);
+  QPushButton* RemoveButton = new QPushButton("Remove");
+  RemoveButton->setEnabled(false);
+
+  thisV1Layout->addWidget(titleLabel);
+  thisV1Layout->addWidget(inputList);
+  thisV2Layout->addWidget(inputLabel);
+  thisV2Layout->addWidget(inputBox);
+  thisV2Layout->addWidget(AddButton);
+  thisV2Layout->addWidget(RemoveButton);
+  parent->addLayout(thisHLayout);
+  thisHLayout->addLayout(thisV1Layout);
+  thisHLayout->addLayout(thisV2Layout);
+
+  pipe = new QtQueryListPipe<int>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
+  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
+  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
+  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));
+}
+
+QtDialog::IntsQtQuery::~IntsQtQuery()
+{
+  delete pipe;
+}
+
+bool QtDialog::IntsQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/MoleculeQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/MoleculeQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/MoleculeQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculeQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "molecule.hpp"
+#include "World.hpp"
+
+
+QtDialog::MoleculeQtQuery::MoleculeQtQuery(string _title, QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::MoleculeQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  // add all molecules to the combo box
+  vector<molecule*> molecules = World::getInstance().getAllMolecules();
+  for(vector<molecule*>::iterator iter  = molecules.begin();
+      iter != molecules.end();
+      ++iter) {
+    std::stringstream sstr;
+    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new MoleculeQtQueryPipe(&tmp,_dialog,inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::MoleculeQtQuery::~MoleculeQtQuery()
+{
+  delete pipe;
+}
+
+// Handling is easy, since the GUI makes it impossible to select invalid values
+bool QtDialog::MoleculeQtQuery::handle()
+{
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/MoleculesQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/MoleculesQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/MoleculesQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculesQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+#include "molecule.hpp"
+#include "World.hpp"
+
+
+QtDialog::MoleculesQtQuery::MoleculesQtQuery(string _title, QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::MoleculesQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QComboBox();
+  // add all molecules to the combo box
+  vector<molecule*> molecules = World::getInstance().getAllMolecules();
+  for(vector<molecule*>::iterator iter  = molecules.begin();
+      iter != molecules.end();
+      ++iter) {
+    std::stringstream sstr;
+    sstr << (*iter)->IndexNr << "\t" << (*iter)->getName();
+    inputBox->addItem(QString(sstr.str().c_str()),QVariant((*iter)->IndexNr));
+  }
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new MoleculesQtQueryPipe(&tmp,_dialog,inputBox);
+  pipe->update(inputBox->currentIndex());
+  connect(inputBox,SIGNAL(currentIndexChanged(int)),pipe,SLOT(update(int)));
+}
+
+QtDialog::MoleculesQtQuery::~MoleculesQtQuery()
+{
+  delete pipe;
+}
+
+// Handling is easy, since the GUI makes it impossible to select invalid values
+bool QtDialog::MoleculesQtQuery::handle()
+{
+  return true;
+}
+
Index: src/UIElements/Qt4/Query/StringQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/StringQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/StringQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+/*
+ * StringQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::StringQtQuery::StringQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::StringQuery(_title),
+    parent(_parent)
+{
+  thisLayout = new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  inputBox = new QLineEdit();
+  parent->addLayout(thisLayout);
+  thisLayout->addWidget(titleLabel);
+  thisLayout->addWidget(inputBox);
+
+  pipe = new StringQtQueryPipe(&tmp,_dialog);
+  pipe->update(inputBox->text());
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(update(const QString&)));
+}
+
+QtDialog::StringQtQuery::~StringQtQuery()
+{
+  delete pipe;
+}
+
+// All values besides the empty std::string are valid
+bool QtDialog::StringQtQuery::handle()
+{
+  return tmp!="";
+}
+
Index: src/UIElements/Qt4/Query/StringsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/StringsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/StringsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+
+/*
+ * StringsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <Qt/qboxlayout.h>
+#include <Qt/qlabel.h>
+#include <Qt/qlineedit.h>
+#include <Qt/qlistwidget.h>
+#include <Qt/qpushbutton.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+#include "UIElements/Qt4/Pipe/QtQueryListPipe.hpp"
+
+
+QtDialog::StringsQtQuery::StringsQtQuery(string _title,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::StringsQuery(_title),
+    parent(_parent)
+{
+  QHBoxLayout * thisHLayout = new QHBoxLayout();
+  QVBoxLayout * thisV1Layout = new QVBoxLayout();
+  QVBoxLayout * thisV2Layout = new QVBoxLayout();
+
+  QLabel *titleLabel = new QLabel(QString(getTitle().c_str()));
+  QLabel *inputLabel = new QLabel("Enter to add");
+  QListWidget* inputList = new QListWidget();
+  inputList->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  QLineEdit* inputBox = new QLineEdit();
+  inputLabel->setBuddy(inputBox);
+  titleLabel->setBuddy(inputList);
+  QPushButton* AddButton = new QPushButton("Add");
+  AddButton->setEnabled(false);
+  QPushButton* RemoveButton = new QPushButton("Remove");
+  RemoveButton->setEnabled(false);
+
+  thisV1Layout->addWidget(titleLabel);
+  thisV1Layout->addWidget(inputList);
+  thisV2Layout->addWidget(inputLabel);
+  thisV2Layout->addWidget(inputBox);
+  thisV2Layout->addWidget(AddButton);
+  thisV2Layout->addWidget(RemoveButton);
+  parent->addLayout(thisHLayout);
+  thisHLayout->addLayout(thisV1Layout);
+  thisHLayout->addLayout(thisV2Layout);
+
+  pipe = new QtQueryListPipe<std::string>(&tmp,_dialog,inputBox,inputList,AddButton,RemoveButton);
+  connect(inputBox,SIGNAL(textChanged(const QString&)),pipe,SLOT(IntegerEntered(const QString&)));
+  connect(inputList,SIGNAL(itemSelectionChanged()),pipe,SLOT(IntegerSelected()));
+  connect(AddButton,SIGNAL(Clicked()),pipe,SLOT(AddValue()));
+  connect(RemoveButton,SIGNAL(Clicked()),pipe,SLOT(RemoveRow()));}
+
+QtDialog::StringsQtQuery::~StringsQtQuery()
+{
+  delete pipe;
+}
+
+// All values besides the empty std::string are valid
+bool QtDialog::StringsQtQuery::handle()
+{
+  // dissect by ","
+  std::string::iterator olditer = temp.begin();
+  for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
+    if (*iter == ' ') {
+      tmp.push_back(string(iter, olditer));
+      olditer = iter;
+    }
+  }
+  if (olditer != temp.begin())  // insert last part also
+    tmp.push_back(string(olditer, temp.end()));
+
+  return temp!="";
+}
+
Index: src/UIElements/Qt4/Query/VectorQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/VectorQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/VectorQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <QtGui/QDoubleSpinBox>
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::VectorQtQuery::VectorQtQuery(std::string title, bool _check,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::VectorQuery(title,_check),
+    parent(_parent)
+{
+  mainLayout= new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  mainLayout->addWidget(titleLabel);
+  subLayout = new QVBoxLayout();
+  mainLayout->addLayout(subLayout);
+  QComboBox* inputBox = new QComboBox();
+  coordLayout = new QHBoxLayout();
+  subLayout->addLayout(coordLayout);
+  coordLabel = new QLabel(QString("x,y,z"));
+  coordLayout->addWidget(coordLabel);
+  coordInput = new QDoubleSpinBox();
+//  coordInput->setRange(0,M.at(i,i));
+  coordInput->setDecimals(3);
+  coordLayout->addWidget(coordInput);
+  pipe = new VectorQtQueryPipe(&(tmp),_dialog,inputBox);
+  //pipe->update(coordInput->value());
+  connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
+  parent->addLayout(mainLayout);
+}
+
+QtDialog::VectorQtQuery::~VectorQtQuery()
+{}
+
+bool QtDialog::VectorQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Qt4/Query/VectorsQtQuery.cpp
===================================================================
--- src/UIElements/Qt4/Query/VectorsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Qt4/Query/VectorsQtQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorsQtQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <QtGui/QDoubleSpinBox>
+#include <Qt/qboxlayout.h>
+#include <Qt/qcombobox.h>
+#include <Qt/qlabel.h>
+
+#include "Helpers/MemDebug.hpp"
+
+#include "UIElements/Qt4/QtDialog.hpp"
+
+
+QtDialog::VectorsQtQuery::VectorsQtQuery(std::string title, bool _check,QBoxLayout *_parent,QtDialog *_dialog) :
+    Dialog::VectorsQuery(title,_check),
+    parent(_parent)
+{
+  mainLayout= new QHBoxLayout();
+  titleLabel = new QLabel(QString(getTitle().c_str()));
+  mainLayout->addWidget(titleLabel);
+  subLayout = new QVBoxLayout();
+  mainLayout->addLayout(subLayout);
+  QComboBox* inputBox = new QComboBox();
+  coordLayout = new QHBoxLayout();
+  subLayout->addLayout(coordLayout);
+  coordLabel = new QLabel(QString("x,y,z"));
+  coordLayout->addWidget(coordLabel);
+  coordInput = new QDoubleSpinBox();
+//  coordInput->setRange(0,M.at(i,i));
+  coordInput->setDecimals(3);
+  coordLayout->addWidget(coordInput);
+  pipe = new VectorsQtQueryPipe(&(tmp),_dialog,inputBox);
+  //pipe->update(coordInput->value());
+  connect(coordInput,SIGNAL(valueChanged(double)),pipe,SLOT(update(double)));
+  parent->addLayout(mainLayout);
+}
+
+QtDialog::VectorsQtQuery::~VectorsQtQuery()
+{}
+
+bool QtDialog::VectorsQtQuery::handle() {
+  return true;
+}
+
+
Index: src/UIElements/Query/AtomQuery.cpp
===================================================================
--- src/UIElements/Query/AtomQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/AtomQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+// Atom Queries
+Dialog::AtomQuery::AtomQuery(string title, std::string _description) :
+    Query(title, _description),
+    tmp(0)
+{}
+
+Dialog::AtomQuery::~AtomQuery() {}
+
+void Dialog::AtomQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/AtomsQuery.cpp
===================================================================
--- src/UIElements/Query/AtomsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/AtomsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Atoms Queries
+Dialog::AtomsQuery::AtomsQuery(string title, std::string _description) :
+    Query(title, _description),
+    tmp(0)
+{}
+
+Dialog::AtomsQuery::~AtomsQuery() {}
+
+void Dialog::AtomsQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/BooleanQuery.cpp
===================================================================
--- src/UIElements/Query/BooleanQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/BooleanQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * BooleanQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Bool Queries
+Dialog::BooleanQuery::BooleanQuery(string title,std::string description) :
+    Query(title, description)
+{}
+
+Dialog::BooleanQuery::~BooleanQuery() {}
+
+void Dialog::BooleanQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/BoxQuery.cpp
===================================================================
--- src/UIElements/Query/BoxQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/BoxQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+/*
+ * BoxQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Box Queries
+Dialog::BoxQuery::BoxQuery(std::string title, std::string _description) :
+  Query(title, _description)
+{}
+
+Dialog::BoxQuery::~BoxQuery()
+{}
+
+void Dialog::BoxQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/DoubleQuery.cpp
===================================================================
--- src/UIElements/Query/DoubleQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/DoubleQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * DoubleQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Double Queries
+Dialog::DoubleQuery::DoubleQuery(string title, std::string _description) :
+    Query(title, _description)
+{}
+
+Dialog::DoubleQuery::~DoubleQuery() {};
+
+void Dialog::DoubleQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/DoublesQuery.cpp
===================================================================
--- src/UIElements/Query/DoublesQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/DoublesQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * DoublesQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Doubles Queries
+Dialog::DoublesQuery::DoublesQuery(string title, std::string _description) :
+    Query(title, _description)
+{}
+
+Dialog::DoublesQuery::~DoublesQuery() {};
+
+void Dialog::DoublesQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/ElementQuery.cpp
===================================================================
--- src/UIElements/Query/ElementQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/ElementQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Element Queries
+Dialog::ElementQuery::ElementQuery(std::string title, std::string _description) :
+  Query(title, _description)
+  {}
+
+Dialog::ElementQuery::~ElementQuery(){}
+
+void Dialog::ElementQuery::setResult(){
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/ElementsQuery.cpp
===================================================================
--- src/UIElements/Query/ElementsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/ElementsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Elements Queries
+Dialog::ElementsQuery::ElementsQuery(std::string title, std::string _description) :
+  Query(title, _description)
+  {}
+
+Dialog::ElementsQuery::~ElementsQuery(){}
+
+void Dialog::ElementsQuery::setResult(){
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/EmptyQuery.cpp
===================================================================
--- src/UIElements/Query/EmptyQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/EmptyQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+/*
+ * EmptyQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// empty Queries
+Dialog::EmptyQuery::EmptyQuery(string title, std::string description) :
+    Query(title, description)
+{}
+
+Dialog::EmptyQuery::~EmptyQuery() {}
+
+void Dialog::EmptyQuery::setResult() {
+}
+
Index: src/UIElements/Query/FileQuery.cpp
===================================================================
--- src/UIElements/Query/FileQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/FileQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * FileQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// File Queries
+Dialog::FileQuery::FileQuery(std::string title, std::string _description) :
+  Query(title, _description)
+  {}
+
+Dialog::FileQuery::~FileQuery(){}
+
+void Dialog::FileQuery::setResult(){
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/IntQuery.cpp
===================================================================
--- src/UIElements/Query/IntQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/IntQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * IntQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Int Queries
+Dialog::IntQuery::IntQuery(string title, std::string description) :
+    Query(title, description)
+{}
+
+Dialog::IntQuery::~IntQuery() {}
+
+void Dialog::IntQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/IntsQuery.cpp
===================================================================
--- src/UIElements/Query/IntsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/IntsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * IntsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Ints Queries
+Dialog::IntsQuery::IntsQuery(string title, std::string description) :
+    Query(title, description)
+{}
+
+Dialog::IntsQuery::~IntsQuery() {}
+
+void Dialog::IntsQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/MoleculeQuery.cpp
===================================================================
--- src/UIElements/Query/MoleculeQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/MoleculeQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculeQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Molecule Queries
+Dialog::MoleculeQuery::MoleculeQuery(string title, std::string _description) :
+    Query(title, _description),
+    tmp(0)
+{}
+
+Dialog::MoleculeQuery::~MoleculeQuery() {}
+
+void Dialog::MoleculeQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/MoleculesQuery.cpp
===================================================================
--- src/UIElements/Query/MoleculesQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/MoleculesQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculesQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Molecules Queries
+Dialog::MoleculesQuery::MoleculesQuery(string title, std::string _description) :
+    Query(title, _description),
+    tmp(0)
+{}
+
+Dialog::MoleculesQuery::~MoleculesQuery() {}
+
+void Dialog::MoleculesQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/Query.cpp
===================================================================
--- src/UIElements/Query/Query.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/Query.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+/*
+ * Query.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+
+
+// Base class
+Dialog::Query::Query(string _title, string _description) :
+    title(_title),
+    description(_description)
+{}
+
+Dialog::Query::~Query() {}
+
+const std::string Dialog::Query::getTitle() const{
+  return title;
+}
+
+const std::string Dialog::Query::getDescription() const{
+  return description;
+}
Index: src/UIElements/Query/StringQuery.cpp
===================================================================
--- src/UIElements/Query/StringQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/StringQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * StringQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// String Queries
+Dialog::StringQuery::StringQuery(string title,std::string _description) :
+    Query(title, _description)
+{}
+
+Dialog::StringQuery::~StringQuery() {};
+
+void Dialog::StringQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/StringsQuery.cpp
===================================================================
--- src/UIElements/Query/StringsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/StringsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+/*
+ * StringsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Strings Queries
+Dialog::StringsQuery::StringsQuery(string title,std::string _description) :
+    Query(title, _description)
+{}
+
+Dialog::StringsQuery::~StringsQuery() {};
+
+void Dialog::StringsQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/VectorQuery.cpp
===================================================================
--- src/UIElements/Query/VectorQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/VectorQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Vector Queries
+Dialog::VectorQuery::VectorQuery(std::string title,bool _check, std::string _description) :
+  Query(title, _description),
+  check(_check)
+{}
+
+Dialog::VectorQuery::~VectorQuery()
+{}
+
+void Dialog::VectorQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/Query/VectorsQuery.cpp
===================================================================
--- src/UIElements/Query/VectorsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/Query/VectorsQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,37 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorsQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include "Dialog.hpp"
+#include "Actions/ValueStorage.hpp"
+
+
+// Vectors Queries
+Dialog::VectorsQuery::VectorsQuery(std::string title,bool _check, std::string _description) :
+  Query(title, _description),
+  check(_check)
+{}
+
+Dialog::VectorsQuery::~VectorsQuery()
+{}
+
+void Dialog::VectorsQuery::setResult() {
+  ValueStorage::getInstance().setCurrentValue(title.c_str(), tmp);
+}
+
Index: src/UIElements/TextUI/Query/AtomTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/AtomTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/AtomTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+
+TextDialog::AtomTextQuery::AtomTextQuery(string title, std::string _description) :
+    Dialog::AtomQuery(title,_description)
+{}
+
+TextDialog::AtomTextQuery::~AtomTextQuery() {}
+
+bool TextDialog::AtomTextQuery::handle() {
+  int idxOfAtom=-1;
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> idxOfAtom;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+      continue;
+    }
+
+    tmp = World::getInstance().getAtom(AtomById(idxOfAtom));
+    if(!tmp && idxOfAtom!=-1){
+      Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
+      badInput = true;
+    }
+
+  } while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return (idxOfAtom!=-1);
+}
+
+
Index: src/UIElements/TextUI/Query/AtomsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/AtomsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/AtomsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+/*
+ * AtomsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <Descriptors/AtomDescriptor.hpp>
+#include <Descriptors/AtomIdDescriptor.hpp>
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+#include "atom.hpp"
+#include "World.hpp"
+
+
+TextDialog::AtomsTextQuery::AtomsTextQuery(string title, std::string _description) :
+    Dialog::AtomsQuery(title,_description)
+{}
+
+TextDialog::AtomsTextQuery::~AtomsTextQuery() {}
+
+bool TextDialog::AtomsTextQuery::handle() {
+  int idxOfAtom=-1;
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> idxOfAtom;
+      temp = World::getInstance().getAtom(AtomById(idxOfAtom));
+      if(!temp && idxOfAtom!=-1){
+        Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
+        break;
+      }
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> idxOfAtom;
+    temp = World::getInstance().getAtom(AtomById(idxOfAtom));
+    if(!temp && idxOfAtom!=-1) {
+      Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
+      tmp.push_back(temp);
+    }
+  }
+
+  return (idxOfAtom!=-1);
+}
+
Index: src/UIElements/TextUI/Query/BooleanTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/BooleanTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/BooleanTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+/*
+ * BooleanTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::BooleanTextQuery::BooleanTextQuery(string title, std::string _description) :
+    Dialog::BooleanQuery(title,_description)
+{}
+
+TextDialog::BooleanTextQuery::~BooleanTextQuery() {}
+
+bool TextDialog::BooleanTextQuery::handle() {
+  bool badInput = false;
+  char input = ' ';
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> input;
+    if ((input == 'y' ) || (input == 'Y')) {
+      tmp = true;
+    } else if ((input == 'n' ) || (input == 'N')) {
+      tmp = false;
+    } else {
+      badInput=true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
+    }
+  } while(badInput);
+  // clear the input buffer of anything still in the line
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/BoxTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/BoxTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/BoxTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+/*
+ * BoxTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+
+
+TextDialog::BoxTextQuery::BoxTextQuery(std::string title, std::string _description) :
+    Dialog::BoxQuery(title,_description)
+{}
+
+TextDialog::BoxTextQuery::~BoxTextQuery()
+{}
+
+bool TextDialog::BoxTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+
+  double temp[6];
+  std::string coords[6] = {"xx","yx","yy", "zx", "zy", "zz"};
+  for (int i=0;i<6;i++) {
+    Log() << Verbose(0) << coords[i] << ": ";
+    cin >> temp[i];
+  }
+  Matrix M;
+  M.set(0,0, temp[0]);
+  M.set(0,1, temp[1]);
+  M.set(0,2, temp[2]);
+  M.set(1,0, temp[1]);
+  M.set(1,1, temp[3]);
+  M.set(1,2, temp[4]);
+  M.set(2,0, temp[2]);
+  M.set(2,1, temp[4]);
+  M.set(2,2, temp[5]);
+  tmp.setM(M);
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/DoubleTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/DoubleTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/DoubleTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+/*
+ * DoubleTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::DoubleTextQuery::DoubleTextQuery(string title, std::string _description) :
+    Dialog::DoubleQuery(title,_description)
+{}
+
+TextDialog::DoubleTextQuery::~DoubleTextQuery() {}
+
+bool TextDialog::DoubleTextQuery::handle() {
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> tmp;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+    }
+  }while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
+
Index: src/UIElements/TextUI/Query/DoublesTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/DoublesTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/DoublesTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+/*
+ * DoublesTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::DoublesTextQuery::DoublesTextQuery(string title, std::string _description) :
+    Dialog::DoublesQuery(title,_description)
+{}
+
+TextDialog::DoublesTextQuery::~DoublesTextQuery() {}
+
+bool TextDialog::DoublesTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> temp;
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> temp;
+    tmp.push_back(temp);
+  }
+
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/ElementTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/ElementTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/ElementTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+
+TextDialog::ElementTextQuery::ElementTextQuery(std::string title, std::string _description) :
+    Dialog::ElementQuery(title,_description)
+{}
+
+TextDialog::ElementTextQuery::~ElementTextQuery()
+{}
+
+bool TextDialog::ElementTextQuery::handle() {
+  bool badInput=false;
+  bool aborted = false;
+  const element * temp = NULL;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+
+    // try to read as Atomic number
+    int Z;
+    cin >> Z;
+    if(!cin.fail()){
+      if(Z==-1){
+        aborted = true;
+      }
+      else{
+        temp = World::getInstance().getPeriode()->FindElement(Z);
+        if(!temp){
+          Log() << Verbose(0) << "No element with this atomic number!" << endl;
+          badInput = true;
+        }
+      }
+      continue;
+    }
+    else{
+      cin.clear();
+    }
+
+    // Try to read as shorthand
+    // the last buffer content was not removed, so we read the
+    // same thing again, this time as a std::string
+    std::string shorthand;
+    cin >> shorthand;
+    if(!cin.fail()){
+      if(shorthand.empty()){
+        aborted = true;
+      }
+      else{
+        temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
+        if(!temp){
+          Log() << Verbose(0) << "No element with this shorthand!" << endl;
+          badInput = true;
+        }
+      }
+    }
+    else{
+      Log() << Verbose(0) << "Could not read input. Try Again." << endl;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      badInput = true;
+    }
+
+  }while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return !aborted;
+}
+
Index: src/UIElements/TextUI/Query/ElementsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/ElementsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/ElementsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,87 @@
+/*
+ * 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.
+ */
+
+/*
+ * ElementsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+#include <boost/lexical_cast.hpp>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "element.hpp"
+#include "periodentafel.hpp"
+#include "World.hpp"
+
+using boost::lexical_cast;
+using boost::bad_lexical_cast;
+
+
+TextDialog::ElementsTextQuery::ElementsTextQuery(std::string title, std::string _description) :
+    Dialog::ElementsQuery(title,_description)
+{}
+
+TextDialog::ElementsTextQuery::~ElementsTextQuery()
+{}
+
+bool TextDialog::ElementsTextQuery::handle() {
+  std::string shorthand;
+  int Z=-1;
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> shorthand;
+      try {
+        Z = lexical_cast<int>(shorthand);
+        temp = World::getInstance().getPeriode()->FindElement(Z);
+      } catch (bad_lexical_cast) {
+        temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
+      };
+      if(!temp && Z!=-1){
+        Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
+        break;
+      }
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> shorthand;
+    try {
+      Z = lexical_cast<int>(shorthand);
+      temp = World::getInstance().getPeriode()->FindElement(Z);
+    } catch (bad_lexical_cast) {
+      temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
+    };
+    if(!temp && Z!=-1) {
+      Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
+      tmp.push_back(temp);
+    }
+  }
+
+  return (Z!=-1);
+}
+
Index: src/UIElements/TextUI/Query/EmptyTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/EmptyTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/EmptyTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+/*
+ * EmptyTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::EmptyTextQuery::EmptyTextQuery(string title, std::string _description) :
+    Dialog::EmptyQuery(title,_description)
+{}
+
+TextDialog::EmptyTextQuery::~EmptyTextQuery() {}
+
+bool TextDialog::EmptyTextQuery::handle() {
+  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/FileTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/FileTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/FileTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+/*
+ * FileTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <boost/filesystem.hpp>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::FileTextQuery::FileTextQuery(string title, std::string _description) :
+    Dialog::FileQuery(title,_description)
+{}
+
+TextDialog::FileTextQuery::~FileTextQuery() {}
+
+bool TextDialog::FileTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  std::string tempstring;
+  getline(cin,tempstring);
+  tmp = tempstring;
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/IntTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/IntTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/IntTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+/*
+ * IntTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::IntTextQuery::IntTextQuery(string title, std::string _description) :
+    Dialog::IntQuery(title,_description)
+{}
+
+TextDialog::IntTextQuery::~IntTextQuery() {}
+
+bool TextDialog::IntTextQuery::handle() {
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> tmp;
+    if(cin.fail()){
+      badInput=true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+    }
+  } while(badInput);
+  // clear the input buffer of anything still in the line
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/IntsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/IntsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/IntsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+
+/*
+ * IntsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::IntsTextQuery::IntsTextQuery(string title, std::string _description) :
+    Dialog::IntsQuery(title,_description)
+{}
+
+TextDialog::IntsTextQuery::~IntsTextQuery() {}
+
+bool TextDialog::IntsTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> temp;
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> temp;
+    tmp.push_back(temp);
+  }
+
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/MoleculeTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/MoleculeTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/MoleculeTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculeTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+
+
+TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, std::string _description) :
+    Dialog::MoleculeQuery(title,_description)
+{}
+
+TextDialog::MoleculeTextQuery::~MoleculeTextQuery() {}
+
+bool TextDialog::MoleculeTextQuery::handle() {
+  int idxOfMol=0;
+  bool badInput = false;
+  do{
+    badInput = false;
+    Log() << Verbose(0) << getTitle();
+    cin >> idxOfMol;
+    if(cin.fail()){
+      badInput = true;
+      cin.clear();
+      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+      Log() << Verbose(0) << "Input was not a number!" << endl;
+      continue;
+    }
+
+    tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
+    if(!tmp && idxOfMol!=-1){
+      Log() << Verbose(0) << "Invalid Molecule Index" << endl;
+      badInput = true;
+    }
+
+  } while(badInput);
+  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
+  return (idxOfMol!=-1);
+}
+
+
Index: src/UIElements/TextUI/Query/MoleculesTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/MoleculesTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/MoleculesTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+/*
+ * MoleculesTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include <Descriptors/MoleculeDescriptor.hpp>
+#include <Descriptors/MoleculeIdDescriptor.hpp>
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "World.hpp"
+
+
+TextDialog::MoleculesTextQuery::MoleculesTextQuery(string title, std::string _description) :
+    Dialog::MoleculesQuery(title,_description)
+{}
+
+TextDialog::MoleculesTextQuery::~MoleculesTextQuery() {}
+
+bool TextDialog::MoleculesTextQuery::handle() {
+  int idxOfMol=-1;
+  Log() << Verbose(0) << getTitle();
+  std::string line;
+  getline(cin,line);
+  // dissect by " "
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
+    if (*iter == ' ') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> idxOfMol;
+      temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
+      if(!temp && idxOfMol!=-1){
+        Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
+        break;
+      }
+      tmp.push_back(temp);
+      olditer = iter;
+    }
+  }
+  if (olditer != line.begin()) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> idxOfMol;
+    temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
+    if(!temp && idxOfMol!=-1){
+      Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
+      tmp.push_back(temp);
+    }
+  }
+
+  return (idxOfMol!=-1);
+}
+
Index: src/UIElements/TextUI/Query/StringTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/StringTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/StringTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+/*
+ * StringTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::StringTextQuery::StringTextQuery(string title, std::string _description) :
+    Dialog::StringQuery(title,_description)
+{}
+
+TextDialog::StringTextQuery::~StringTextQuery() {}
+
+bool TextDialog::StringTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  getline(cin,tmp);
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/StringsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/StringsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/StringsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,52 @@
+/*
+ * 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.
+ */
+
+/*
+ * StringsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+
+
+TextDialog::StringsTextQuery::StringsTextQuery(string title, std::string _description) :
+    Dialog::StringsQuery(title,_description)
+{}
+
+TextDialog::StringsTextQuery::~StringsTextQuery() {}
+
+bool TextDialog::StringsTextQuery::handle() {
+  Log() << Verbose(0) << getTitle();
+  getline(cin,temp);
+  // dissect by " "
+  std::string::iterator olditer = temp.begin();
+  for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
+    if (*iter == ' ') {
+      tmp.push_back(string(iter, olditer));
+      olditer = iter;
+    }
+  }
+  if (olditer != temp.begin())  // insert last part also
+    tmp.push_back(string(olditer, temp.end()));
+
+  return true;
+}
+
Index: src/UIElements/TextUI/Query/VectorTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/VectorTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/VectorTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+#include "World.hpp"
+
+
+TextDialog::VectorTextQuery::VectorTextQuery(std::string title, bool _check, std::string _description) :
+    Dialog::VectorQuery(title,_check,_description)
+{}
+
+TextDialog::VectorTextQuery::~VectorTextQuery()
+{}
+
+bool TextDialog::VectorTextQuery::handle() {
+  std::cout << getTitle();
+  const Matrix &M = World::getInstance().getDomain().getM();
+  char coords[3] = {'x', 'y', 'z'};
+  for (int i=0;i<3;i++)
+    std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: ");
+
+  std::string line;
+  getline(cin,line);
+
+  // dissect by ","
+  double coord = 0.;
+  int counter = 0;
+  std::string::iterator olditer = line.begin();
+  for(string::iterator iter = line.begin(); (iter != line.end()) && (counter != 3); ++iter) {
+    if (*iter == ',') {
+      std::istringstream stream(string(iter, olditer));
+      stream >> coord;
+      tmp[counter++] = coord;
+      olditer = iter;
+    }
+  }
+  if ((olditer != line.begin()) && (counter != 3)) { // insert last part also
+    std::istringstream stream(string(olditer, line.end()));
+    stream >> coord;
+    tmp[counter++] = coord;
+  }
+
+  // check vector
+  return World::getInstance().getDomain().isInside(tmp);
+}
+
Index: src/UIElements/TextUI/Query/VectorsTextQuery.cpp
===================================================================
--- src/UIElements/TextUI/Query/VectorsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
+++ src/UIElements/TextUI/Query/VectorsTextQuery.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+/*
+ * VectorsTextQuery.cpp
+ *
+ *  Created on: Oct 25, 2010
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "Helpers/MemDebug.hpp"
+
+#include <iostream>
+
+#include "TextUI/TextDialog.hpp"
+
+#include "Helpers/Log.hpp"
+#include "Helpers/Verbose.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "LinearAlgebra/Matrix.hpp"
+#include "World.hpp"
+
+
+TextDialog::VectorsTextQuery::VectorsTextQuery(std::string title, bool _check, std::string _description) :
+    Dialog::VectorsQuery(title,_check,_description)
+{}
+
+TextDialog::VectorsTextQuery::~VectorsTextQuery()
+{}
+
+bool TextDialog::VectorsTextQuery::handle() {
+  std::cout << getTitle();
+  char coords[3] = {'x', 'y', 'z'};
+  const Matrix &M = World::getInstance().getDomain().getM();
+  for (int i=0;i<3;i++)
+    std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: ");
+
+  std::string line;
+  getline(cin,line);
+
+  // dissect by ","
+  double coord = 0.;
+  std::string::iterator olditerspace = line.begin();
+  std::string::iterator olditercomma = line.begin();
+  int counter = 0;
+  for(string::iterator vectoriter = line.begin(); vectoriter != line.end(); ++vectoriter) {
+    if (*vectoriter == ',')
+      counter++;
+    if ((*vectoriter == ' ') && (counter == 2)) {
+      counter = 0;
+      for(string::iterator componentiter = olditerspace; (componentiter != vectoriter) && (counter !=3); ++componentiter) {
+        if (*componentiter == ',') {
+          std::istringstream stream(string(componentiter, olditercomma));
+          stream >> coord;
+          temp[counter++] = coord;
+          olditercomma = componentiter;
+        }
+      }
+      if ((olditercomma != line.begin()) && (counter != 3)) { // insert last part also
+        std::istringstream stream(string(olditercomma, vectoriter));
+        stream >> coord;
+        temp[counter++] = coord;
+      }
+      if (World::getInstance().getDomain().isInside(temp))
+        tmp.push_back(temp);
+      olditerspace = vectoriter;
+    }
+  }
+
+  return true;
+}
+
Index: src/UIElements/TextUI/TextDialog.cpp
===================================================================
--- src/UIElements/TextUI/TextDialog.cpp	(revision 57a6ea1a91e89f394ecb0bdcf58b45e3ca1587e9)
+++ src/UIElements/TextUI/TextDialog.cpp	(revision 8df74dbef13fb1628a8f98eeaac6b7c477e95818)
@@ -20,27 +20,5 @@
 #include "Helpers/MemDebug.hpp"
 
-#include <iostream>
-
-#include <Descriptors/AtomDescriptor.hpp>
-#include <Descriptors/AtomIdDescriptor.hpp>
-#include <Descriptors/MoleculeDescriptor.hpp>
-#include <Descriptors/MoleculeIdDescriptor.hpp>
-#include <boost/lexical_cast.hpp>
 #include "TextUI/TextDialog.hpp"
-
-#include "World.hpp"
-#include "periodentafel.hpp"
-#include "Helpers/Log.hpp"
-#include "Helpers/Verbose.hpp"
-
-#include "atom.hpp"
-#include "element.hpp"
-#include "molecule.hpp"
-#include "LinearAlgebra/Vector.hpp"
-#include "LinearAlgebra/Matrix.hpp"
-#include "Box.hpp"
-
-#include <boost/lexical_cast.hpp>
-#include <boost/filesystem.hpp>
 
 using namespace std;
@@ -131,575 +109,5 @@
 
 /************************** Query Infrastructure ************************/
+/*       ---> shifted to folder Query                                   */
+/************************************************************************/
 
-TextDialog::EmptyTextQuery::EmptyTextQuery(string title, std::string _description) :
-    Dialog::EmptyQuery(title,_description)
-{}
-
-TextDialog::EmptyTextQuery::~EmptyTextQuery() {}
-
-bool TextDialog::EmptyTextQuery::handle() {
-  cout << "Message of " << getTitle() << ":\n" << getDescription() << "\n";
-  return true;
-}
-
-TextDialog::IntTextQuery::IntTextQuery(string title, std::string _description) :
-    Dialog::IntQuery(title,_description)
-{}
-
-TextDialog::IntTextQuery::~IntTextQuery() {}
-
-bool TextDialog::IntTextQuery::handle() {
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> tmp;
-    if(cin.fail()){
-      badInput=true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-    }
-  } while(badInput);
-  // clear the input buffer of anything still in the line
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-TextDialog::IntsTextQuery::IntsTextQuery(string title, std::string _description) :
-    Dialog::IntsQuery(title,_description)
-{}
-
-TextDialog::IntsTextQuery::~IntsTextQuery() {}
-
-bool TextDialog::IntsTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> temp;
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> temp;
-    tmp.push_back(temp);
-  }
-
-  return true;
-}
-
-TextDialog::BooleanTextQuery::BooleanTextQuery(string title, std::string _description) :
-    Dialog::BooleanQuery(title,_description)
-{}
-
-TextDialog::BooleanTextQuery::~BooleanTextQuery() {}
-
-bool TextDialog::BooleanTextQuery::handle() {
-  bool badInput = false;
-  char input = ' ';
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> input;
-    if ((input == 'y' ) || (input == 'Y')) {
-      tmp = true;
-    } else if ((input == 'n' ) || (input == 'N')) {
-      tmp = false;
-    } else {
-      badInput=true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not of [yYnN]!" << endl;
-    }
-  } while(badInput);
-  // clear the input buffer of anything still in the line
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-TextDialog::StringTextQuery::StringTextQuery(string title, std::string _description) :
-    Dialog::StringQuery(title,_description)
-{}
-
-TextDialog::StringTextQuery::~StringTextQuery() {}
-
-bool TextDialog::StringTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  getline(cin,tmp);
-  return true;
-}
-
-TextDialog::StringsTextQuery::StringsTextQuery(string title, std::string _description) :
-    Dialog::StringsQuery(title,_description)
-{}
-
-TextDialog::StringsTextQuery::~StringsTextQuery() {}
-
-bool TextDialog::StringsTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  getline(cin,temp);
-  // dissect by " "
-  std::string::iterator olditer = temp.begin();
-  for(string::iterator iter = temp.begin(); iter != temp.end(); ++iter) {
-    if (*iter == ' ') {
-      tmp.push_back(string(iter, olditer));
-      olditer = iter;
-    }
-  }
-  if (olditer != temp.begin())  // insert last part also
-    tmp.push_back(string(olditer, temp.end()));
-
-  return true;
-}
-
-TextDialog::DoubleTextQuery::DoubleTextQuery(string title, std::string _description) :
-    Dialog::DoubleQuery(title,_description)
-{}
-
-TextDialog::DoubleTextQuery::~DoubleTextQuery() {}
-
-bool TextDialog::DoubleTextQuery::handle() {
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> tmp;
-    if(cin.fail()){
-      badInput = true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-    }
-  }while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return true;
-}
-
-
-TextDialog::DoublesTextQuery::DoublesTextQuery(string title, std::string _description) :
-    Dialog::DoublesQuery(title,_description)
-{}
-
-TextDialog::DoublesTextQuery::~DoublesTextQuery() {}
-
-bool TextDialog::DoublesTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> temp;
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> temp;
-    tmp.push_back(temp);
-  }
-
-  return true;
-}
-
-TextDialog::AtomTextQuery::AtomTextQuery(string title, std::string _description) :
-    Dialog::AtomQuery(title,_description)
-{}
-
-TextDialog::AtomTextQuery::~AtomTextQuery() {}
-
-bool TextDialog::AtomTextQuery::handle() {
-  int idxOfAtom=-1;
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> idxOfAtom;
-    if(cin.fail()){
-      badInput = true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-      continue;
-    }
-
-    tmp = World::getInstance().getAtom(AtomById(idxOfAtom));
-    if(!tmp && idxOfAtom!=-1){
-      Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
-      badInput = true;
-    }
-
-  } while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return (idxOfAtom!=-1);
-}
-
-
-TextDialog::AtomsTextQuery::AtomsTextQuery(string title, std::string _description) :
-    Dialog::AtomsQuery(title,_description)
-{}
-
-TextDialog::AtomsTextQuery::~AtomsTextQuery() {}
-
-bool TextDialog::AtomsTextQuery::handle() {
-  int idxOfAtom=-1;
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> idxOfAtom;
-      temp = World::getInstance().getAtom(AtomById(idxOfAtom));
-      if(!temp && idxOfAtom!=-1){
-        Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
-        break;
-      }
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> idxOfAtom;
-    temp = World::getInstance().getAtom(AtomById(idxOfAtom));
-    if(!temp && idxOfAtom!=-1) {
-      Log() << Verbose(0) << "Invalid Atom Index" << idxOfAtom << endl;
-      tmp.push_back(temp);
-    }
-  }
-
-  return (idxOfAtom!=-1);
-}
-
-TextDialog::MoleculeTextQuery::MoleculeTextQuery(string title, std::string _description) :
-    Dialog::MoleculeQuery(title,_description)
-{}
-
-TextDialog::MoleculeTextQuery::~MoleculeTextQuery() {}
-
-bool TextDialog::MoleculeTextQuery::handle() {
-  int idxOfMol=0;
-  bool badInput = false;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-    cin >> idxOfMol;
-    if(cin.fail()){
-      badInput = true;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      Log() << Verbose(0) << "Input was not a number!" << endl;
-      continue;
-    }
-
-    tmp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
-    if(!tmp && idxOfMol!=-1){
-      Log() << Verbose(0) << "Invalid Molecule Index" << endl;
-      badInput = true;
-    }
-
-  } while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return (idxOfMol!=-1);
-}
-
-
-TextDialog::MoleculesTextQuery::MoleculesTextQuery(string title, std::string _description) :
-    Dialog::MoleculesQuery(title,_description)
-{}
-
-TextDialog::MoleculesTextQuery::~MoleculesTextQuery() {}
-
-bool TextDialog::MoleculesTextQuery::handle() {
-  int idxOfMol=-1;
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> idxOfMol;
-      temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
-      if(!temp && idxOfMol!=-1){
-        Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
-        break;
-      }
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> idxOfMol;
-    temp = World::getInstance().getMolecule(MoleculeById(idxOfMol));
-    if(!temp && idxOfMol!=-1){
-      Log() << Verbose(0) << "Invalid Molecule Index" << idxOfMol << endl;
-      tmp.push_back(temp);
-    }
-  }
-
-  return (idxOfMol!=-1);
-}
-
-TextDialog::VectorTextQuery::VectorTextQuery(std::string title, bool _check, std::string _description) :
-    Dialog::VectorQuery(title,_check,_description)
-{}
-
-TextDialog::VectorTextQuery::~VectorTextQuery()
-{}
-
-bool TextDialog::VectorTextQuery::handle() {
-  std::cout << getTitle();
-  const Matrix &M = World::getInstance().getDomain().getM();
-  char coords[3] = {'x', 'y', 'z'};
-  for (int i=0;i<3;i++)
-    std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: ");
-
-  std::string line;
-  getline(cin,line);
-
-  // dissect by ","
-  double coord = 0.;
-  int counter = 0;
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); (iter != line.end()) && (counter != 3); ++iter) {
-    if (*iter == ',') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> coord;
-      tmp[counter++] = coord;
-      olditer = iter;
-    }
-  }
-  if ((olditer != line.begin()) && (counter != 3)) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> coord;
-    tmp[counter++] = coord;
-  }
-
-  // check vector
-  return World::getInstance().getDomain().isInside(tmp);
-}
-
-TextDialog::VectorsTextQuery::VectorsTextQuery(std::string title, bool _check, std::string _description) :
-    Dialog::VectorsQuery(title,_check,_description)
-{}
-
-TextDialog::VectorsTextQuery::~VectorsTextQuery()
-{}
-
-bool TextDialog::VectorsTextQuery::handle() {
-  std::cout << getTitle();
-  char coords[3] = {'x', 'y', 'z'};
-  const Matrix &M = World::getInstance().getDomain().getM();
-  for (int i=0;i<3;i++)
-    std::cout << coords[i] << "[0.." << M.at(i,i) << ( (i!=2) ? "], " : "]: ");
-
-  std::string line;
-  getline(cin,line);
-
-  // dissect by ","
-  double coord = 0.;
-  std::string::iterator olditerspace = line.begin();
-  std::string::iterator olditercomma = line.begin();
-  int counter = 0;
-  for(string::iterator vectoriter = line.begin(); vectoriter != line.end(); ++vectoriter) {
-    if (*vectoriter == ',')
-      counter++;
-    if ((*vectoriter == ' ') && (counter == 2)) {
-      counter = 0;
-      for(string::iterator componentiter = olditerspace; (componentiter != vectoriter) && (counter !=3); ++componentiter) {
-        if (*componentiter == ',') {
-          std::istringstream stream(string(componentiter, olditercomma));
-          stream >> coord;
-          temp[counter++] = coord;
-          olditercomma = componentiter;
-        }
-      }
-      if ((olditercomma != line.begin()) && (counter != 3)) { // insert last part also
-        std::istringstream stream(string(olditercomma, vectoriter));
-        stream >> coord;
-        temp[counter++] = coord;
-      }
-      if (World::getInstance().getDomain().isInside(temp))
-        tmp.push_back(temp);
-      olditerspace = vectoriter;
-    }
-  }
-
-  return true;
-}
-
-TextDialog::BoxTextQuery::BoxTextQuery(std::string title, std::string _description) :
-    Dialog::BoxQuery(title,_description)
-{}
-
-TextDialog::BoxTextQuery::~BoxTextQuery()
-{}
-
-bool TextDialog::BoxTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-
-  double temp[6];
-  std::string coords[6] = {"xx","yx","yy", "zx", "zy", "zz"};
-  for (int i=0;i<6;i++) {
-    Log() << Verbose(0) << coords[i] << ": ";
-    cin >> temp[i];
-  }
-  Matrix M;
-  M.set(0,0, temp[0]);
-  M.set(0,1, temp[1]);
-  M.set(0,2, temp[2]);
-  M.set(1,0, temp[1]);
-  M.set(1,1, temp[3]);
-  M.set(1,2, temp[4]);
-  M.set(2,0, temp[2]);
-  M.set(2,1, temp[4]);
-  M.set(2,2, temp[5]);
-  tmp.setM(M);
-  return true;
-}
-
-TextDialog::ElementTextQuery::ElementTextQuery(std::string title, std::string _description) :
-    Dialog::ElementQuery(title,_description)
-{}
-
-TextDialog::ElementTextQuery::~ElementTextQuery()
-{}
-
-bool TextDialog::ElementTextQuery::handle() {
-  bool badInput=false;
-  bool aborted = false;
-  const element * temp = NULL;
-  do{
-    badInput = false;
-    Log() << Verbose(0) << getTitle();
-
-    // try to read as Atomic number
-    int Z;
-    cin >> Z;
-    if(!cin.fail()){
-      if(Z==-1){
-        aborted = true;
-      }
-      else{
-        temp = World::getInstance().getPeriode()->FindElement(Z);
-        if(!temp){
-          Log() << Verbose(0) << "No element with this atomic number!" << endl;
-          badInput = true;
-        }
-      }
-      continue;
-    }
-    else{
-      cin.clear();
-    }
-
-    // Try to read as shorthand
-    // the last buffer content was not removed, so we read the
-    // same thing again, this time as a std::string
-    std::string shorthand;
-    cin >> shorthand;
-    if(!cin.fail()){
-      if(shorthand.empty()){
-        aborted = true;
-      }
-      else{
-        temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
-        if(!temp){
-          Log() << Verbose(0) << "No element with this shorthand!" << endl;
-          badInput = true;
-        }
-      }
-    }
-    else{
-      Log() << Verbose(0) << "Could not read input. Try Again." << endl;
-      cin.clear();
-      cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-      badInput = true;
-    }
-
-  }while(badInput);
-  cin.ignore(std::numeric_limits<streamsize>::max(),'\n');
-  return !aborted;
-}
-
-TextDialog::ElementsTextQuery::ElementsTextQuery(std::string title, std::string _description) :
-    Dialog::ElementsQuery(title,_description)
-{}
-
-TextDialog::ElementsTextQuery::~ElementsTextQuery()
-{}
-
-bool TextDialog::ElementsTextQuery::handle() {
-  std::string shorthand;
-  int Z=-1;
-  Log() << Verbose(0) << getTitle();
-  std::string line;
-  getline(cin,line);
-  // dissect by " "
-  std::string::iterator olditer = line.begin();
-  for(string::iterator iter = line.begin(); iter != line.end(); ++iter) {
-    if (*iter == ' ') {
-      std::istringstream stream(string(iter, olditer));
-      stream >> shorthand;
-      try {
-        Z = lexical_cast<int>(shorthand);
-        temp = World::getInstance().getPeriode()->FindElement(Z);
-      } catch (bad_lexical_cast) {
-        temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
-      };
-      if(!temp && Z!=-1){
-        Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
-        break;
-      }
-      tmp.push_back(temp);
-      olditer = iter;
-    }
-  }
-  if (olditer != line.begin()) { // insert last part also
-    std::istringstream stream(string(olditer, line.end()));
-    stream >> shorthand;
-    try {
-      Z = lexical_cast<int>(shorthand);
-      temp = World::getInstance().getPeriode()->FindElement(Z);
-    } catch (bad_lexical_cast) {
-      temp = World::getInstance().getPeriode()->FindElement(shorthand.c_str());
-    };
-    if(!temp && Z!=-1) {
-      Log() << Verbose(0) << "Invalid Element" << shorthand << endl;
-      tmp.push_back(temp);
-    }
-  }
-
-  return (Z!=-1);
-}
-
-TextDialog::FileTextQuery::FileTextQuery(string title, std::string _description) :
-    Dialog::FileQuery(title,_description)
-{}
-
-TextDialog::FileTextQuery::~FileTextQuery() {}
-
-bool TextDialog::FileTextQuery::handle() {
-  Log() << Verbose(0) << getTitle();
-  std::string tempstring;
-  getline(cin,tempstring);
-  tmp = tempstring;
-  return true;
-}
-
