Ignore:
Timestamp:
Jan 2, 2010, 3:49:40 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
Branches:
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
Children:
6b932c7
Parents:
096214
Message:

Moved several Methods from Menu to MoleculeListClass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/moleculelist.cpp

    r096214 r477bb2  
    838838}
    839839
     840/***********
     841 * Methods Moved here from the menus
     842 */
    840843
    841844void MoleculeListClass::flipChosen() {
     
    847850      (*ListRunner)->ActiveFlag = !(*ListRunner)->ActiveFlag;
    848851}
     852
     853void MoleculeListClass::createNewMolecule(periodentafel *periode) {
     854  molecule *mol = NULL;
     855  mol = new molecule(periode);
     856  insert(mol);
     857};
     858
     859void MoleculeListClass::loadFromXYZ(periodentafel *periode){
     860  molecule *mol = NULL;
     861  Vector center;
     862  char filename[MAXSTRINGSIZE];
     863  Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;
     864  mol = new molecule(periode);
     865  do {
     866    Log() << Verbose(0) << "Enter file name: ";
     867    cin >> filename;
     868  } while (!mol->AddXYZFile(filename));
     869  mol->SetNameFromFilename(filename);
     870  // center at set box dimensions
     871  mol->CenterEdge(&center);
     872  mol->cell_size[0] = center.x[0];
     873  mol->cell_size[1] = 0;
     874  mol->cell_size[2] = center.x[1];
     875  mol->cell_size[3] = 0;
     876  mol->cell_size[4] = 0;
     877  mol->cell_size[5] = center.x[2];
     878  insert(mol);
     879}
     880
     881void MoleculeListClass::changeName(){
     882  char filename[MAXSTRINGSIZE];
     883  molecule *mol = NULL;
     884  int nr;
     885  do {
     886    Log() << Verbose(0) << "Enter index of molecule: ";
     887    cin >> nr;
     888    mol = ReturnIndex(nr);
     889  } while (mol == NULL);
     890  Log() << Verbose(0) << "Enter name: ";
     891  cin >> filename;
     892  strcpy(mol->name, filename);
     893}
     894
     895void MoleculeListClass::setMoleculeFilename() {
     896  char filename[MAXSTRINGSIZE];
     897  int nr;
     898  molecule *mol = NULL;
     899  do {
     900    Log() << Verbose(0) << "Enter index of molecule: ";
     901    cin >> nr;
     902    mol = ReturnIndex(nr);
     903  } while (mol == NULL);
     904  Log() << Verbose(0) << "Enter name: ";
     905  cin >> filename;
     906  mol->SetNameFromFilename(filename);
     907}
     908
     909void MoleculeListClass::parseXYZIntoMolecule(){
     910  char filename[MAXSTRINGSIZE];
     911  int nr;
     912  molecule *mol = NULL;
     913  mol = NULL;
     914  do {
     915   Log() << Verbose(0) << "Enter index of molecule: ";
     916   cin >> nr;
     917   mol = ReturnIndex(nr);
     918  } while (mol == NULL);
     919  Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;
     920  do {
     921   Log() << Verbose(0) << "Enter file name: ";
     922   cin >> filename;
     923  } while (!mol->AddXYZFile(filename));
     924  mol->SetNameFromFilename(filename);
     925};
     926
     927void MoleculeListClass::eraseMolecule(){
     928  int nr;
     929  molecule *mol = NULL;
     930  Log() << Verbose(0) << "Enter index of molecule: ";
     931  cin >> nr;
     932  for(MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++)
     933    if (nr == (*ListRunner)->IndexNr) {
     934      mol = *ListRunner;
     935      ListOfMolecules.erase(ListRunner);
     936      delete(mol);
     937      break;
     938    }
     939};
    849940
    850941
Note: See TracChangeset for help on using the changeset viewer.