/* * Project: MoleCuilder * Description: creates and alters molecular systems * Copyright (C) 2010-2012 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 #endif #include "CodePatterns/MemDebug.hpp" #include #include "Actions/Values.hpp" #include "CommandLineUI/Query/CommandLineQuery.hpp" #include "CommandLineUI/CommandLineParser.hpp" #include "CodePatterns/Log.hpp" #include "CodePatterns/Verbose.hpp" #include "World.hpp" CommandLineDialog::VectorsCommandLineQuery::VectorsCommandLineQuery(std::string title, bool _check, std::string _description) : Dialog::VectorsQuery(title,_check, _description) {} CommandLineDialog::VectorsCommandLineQuery::~VectorsCommandLineQuery() {} bool CommandLineDialog::VectorsCommandLineQuery::handle() { std::vector temporary; if (CommandLineParser::getInstance().vm.count(getTitle())) { temporary = CommandLineParser::getInstance().vm[getTitle()].as< std::vector >(); for(std::vector::iterator iter = temporary.begin(); iter != temporary.end(); ++iter) { temp = (*iter).toVector(); if ((!check) || (World::getInstance().getDomain().isValid(temp))) tmp.push_back(temp); else ELOG(1, "Vector " << temp << " would be outside of box domain."); } return true; } else { ELOG(1, "CommandLineUI parsing error: Missing vectors for " << getTitle() << "."); return false; } }