/* * 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 #endif #include "Helpers/MemDebug.hpp" #include "CommandLineUI/CommandLineDialog.hpp" #include "CommandLineUI/CommandLineParser.hpp" #include "Helpers/Log.hpp" #include "Helpers/Verbose.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; } }