source: src/UIElements/CommandLineUI/CommandLineWindow.cpp@ 112b09

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 112b09 was 112b09, checked in by Tillmann Crueger <crueger@…>, 15 years ago

Added #include "Helpers/MemDebug.hpp" to all .cpp files

  • Property mode set to 100644
File size: 5.4 KB
Line 
1/*
2 * CommandLineWindow.cpp
3 *
4 * Created on: May 8, 2010
5 * Author: heber
6 */
7
8#include "Helpers/MemDebug.hpp"
9
10#include <boost/bind.hpp>
11
12#include "CommandLineUI/CommandLineWindow.hpp"
13#include "CommandLineUI/CommandLineStatusIndicator.hpp"
14
15#include "Actions/ActionRegistry.hpp"
16#include "Actions/AnalysisAction/PairCorrelationAction.hpp"
17#include "Actions/AnalysisAction/PairCorrelationToPointAction.hpp"
18#include "Actions/AnalysisAction/PairCorrelationToSurfaceAction.hpp"
19#include "Actions/AtomAction/AddAction.hpp"
20#include "Actions/AtomAction/ChangeElementAction.hpp"
21#include "Actions/AtomAction/RemoveAction.hpp"
22#include "Actions/CmdAction/BondLengthTableAction.hpp"
23#include "Actions/CmdAction/ElementDbAction.hpp"
24#include "Actions/CmdAction/FastParsingAction.hpp"
25#include "Actions/CmdAction/HelpAction.hpp"
26#include "Actions/CmdAction/VerboseAction.hpp"
27#include "Actions/CmdAction/VersionAction.hpp"
28#include "Actions/FragmentationAction/DepthFirstSearchAction.hpp"
29#include "Actions/FragmentationAction/SubgraphDissectionAction.hpp"
30#include "Actions/MoleculeAction/BondFileAction.hpp"
31#include "Actions/MoleculeAction/ChangeNameAction.hpp"
32#include "Actions/MoleculeAction/FillWithMoleculeAction.hpp"
33#include "Actions/MoleculeAction/LinearInterpolationofTrajectoriesAction.hpp"
34#include "Actions/MoleculeAction/SaveAdjacencyAction.hpp"
35#include "Actions/MoleculeAction/SaveBondsAction.hpp"
36#include "Actions/MoleculeAction/SaveTemperatureAction.hpp"
37#include "Actions/MoleculeAction/VerletIntegrationAction.hpp"
38#include "Actions/ParserAction/LoadXyzAction.hpp"
39#include "Actions/ParserAction/SaveXyzAction.hpp"
40#include "Actions/TesselationAction/ConvexEnvelopeAction.hpp"
41#include "Actions/TesselationAction/NonConvexEnvelopeAction.hpp"
42#include "Actions/WorldAction/AddEmptyBoundaryAction.hpp"
43#include "Actions/WorldAction/BoundInBoxAction.hpp"
44#include "Actions/WorldAction/CenterInBoxAction.hpp"
45#include "Actions/WorldAction/CenterOnEdgeAction.hpp"
46#include "Actions/WorldAction/ChangeBoxAction.hpp"
47#include "Actions/WorldAction/RemoveSphereOfAtomsAction.hpp"
48#include "Actions/WorldAction/RepeatBoxAction.hpp"
49#include "Actions/WorldAction/ScaleBoxAction.hpp"
50#include "Actions/WorldAction/SetDefaultNameAction.hpp"
51#include "Actions/WorldAction/SetGaussianBasisAction.hpp"
52#include "CommandLineParser.hpp"
53
54#include <iostream>
55
56using namespace std;
57
58// TODO: see what code can be moved to a base class for Graphic and CommandLine Windows
59CommandLineWindow::CommandLineWindow()
60{
61 // create and register all command line callable actions
62 populateAnalysisActions();
63 populateAtomActions();
64 populateCmdActions();
65 populateFragmentationActions();
66 populateMoleculeActions();
67 populateParserActions();
68 populateTesselationActions();
69 populateWorldActions();
70
71 // Add status indicators etc...
72 statusIndicator = new CommandLineStatusIndicator();
73}
74
75CommandLineWindow::~CommandLineWindow()
76{
77// // go through all possible actions
78// for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRegistry::getInstance().getBeginIter() != ActionRegistry::getInstance().getEndIter(); ActionRunner = ActionRegistry::getInstance().getBeginIter()) {
79// ActionRegistry::getInstance().unregisterAction(ActionRunner->second);
80// delete(ActionRunner->second);
81// }
82
83 delete statusIndicator;
84}
85
86void CommandLineWindow::display() {
87 // go through all possible actions
88 for(std::map<const std::string,Action*>::iterator ActionRunner = ActionRegistry::getInstance().getBeginIter(); ActionRunner != ActionRegistry::getInstance().getEndIter(); ActionRunner++) {
89 // check whether action is present in command line
90 if (CommandLineParser::getInstance().vm.count(ActionRunner->first)) {
91 ActionRunner->second->call();
92 }
93 }
94}
95
96void CommandLineWindow::populateAnalysisActions()
97{
98 new AnalysisPairCorrelationAction();
99 new AnalysisPairCorrelationToPointAction();
100 new AnalysisPairCorrelationToSurfaceAction();
101}
102
103void CommandLineWindow::populateAtomActions()
104{
105 new AtomAddAction();
106 new AtomChangeElementAction();
107 new AtomRemoveAction();
108}
109
110void CommandLineWindow::populateCmdActions()
111{
112 new CommandLineBondLengthTableAction();
113 new CommandLineElementDbAction();
114 new CommandLineFastParsingAction();
115 new CommandLineHelpAction();
116 new CommandLineVerboseAction();
117 new CommandLineVersionAction();
118}
119
120void CommandLineWindow::populateFragmentationActions()
121{
122 new FragmentationDepthFirstSearchAction();
123}
124
125void CommandLineWindow::populateMoleculeActions()
126{
127 new MoleculeBondFileAction();
128 new MoleculeChangeNameAction();
129 new MoleculeFillWithMoleculeAction();
130 new MoleculeLinearInterpolationofTrajectoriesAction();
131 new MoleculeSaveAdjacencyAction();
132 new MoleculeSaveBondsAction();
133 new MoleculeSaveTemperatureAction();
134 new MoleculeVerletIntegrationAction();
135}
136
137void CommandLineWindow::populateParserActions()
138{
139 new ParserLoadXyzAction();
140 new ParserSaveXyzAction();
141}
142
143void CommandLineWindow::populateTesselationActions()
144{
145 new TesselationConvexEnvelopeAction();
146 new TesselationNonConvexEnvelopeAction();
147}
148
149void CommandLineWindow::populateWorldActions()
150{
151 new WorldAddEmptyBoundaryAction();
152 new WorldBoundInBoxAction();
153 new WorldCenterInBoxAction();
154 new WorldCenterOnEdgeAction();
155 new WorldChangeBoxAction();
156 new WorldRemoveSphereOfAtomsAction();
157 new WorldRepeatBoxAction();
158 new WorldScaleBoxAction();
159 new WorldSetDefaultNameAction();
160 new WorldSetGaussianBasisAction();
161}
Note: See TracBrowser for help on using the repository browser.