Changeset 7e3fc94
- Timestamp:
- Aug 6, 2010, 12:21:14 PM (14 years ago)
- 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:
- 2a76b0
- Parents:
- 2fe971
- Location:
- src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/element.cpp
r2fe971 r7e3fc94 63 63 } 64 64 65 string element::getSymbol() const{66 return s tring(symbol);65 string &element::getSymbol(){ 66 return symbol; 67 67 } 68 68 69 void element::setSymbol(const std::string &src){ 70 strncpy(symbol,src.c_str(),3); 71 symbol[2]=0; 69 const string &element::getSymbol() const{ 70 return symbol; 72 71 } 73 72 74 std::string element::getName() const{75 return string(name);73 std::string &element::getName(){ 74 return name; 76 75 } 77 76 78 void element::setName(const std::string &src){ 79 strncpy(name,src.c_str(),63); 80 name[63]=0; 77 const std::string &element::getName() const{ 78 return name; 81 79 } 82 80 -
src/element.hpp
r2fe971 r7e3fc94 46 46 // accessor functions 47 47 atomicNumber_t getNumber() const; 48 std::string getSymbol() const;49 void setSymbol(const std::string&);50 std::string getName() const;51 void setName(const std::string&);48 std::string &getSymbol(); 49 const std::string &getSymbol() const; 50 std::string &getName(); 51 const std::string &getName() const; 52 52 53 53 //> print element entries to screen … … 56 56 57 57 private: 58 char name[64]; //!< atom name, i.e. "Hydrogren"59 char symbol[3]; //!< short form of the atom, i.e. "H"58 std::string name; //!< atom name, i.e. "Hydrogren" 59 std::string symbol; //!< short form of the atom, i.e. "H" 60 60 }; 61 61 -
src/periodentafel.cpp
r2fe971 r7e3fc94 168 168 cin >> tmp->mass; 169 169 DoLog(0) && (Log() << Verbose(0) << "Name [max 64 chars]: " << endl); 170 string tmpstring; 171 cin >> tmpstring; 172 tmp->setName(tmpstring); 170 cin >> tmp->getName(); 173 171 DoLog(0) && (Log() << Verbose(0) << "Short form [max 3 chars]: " << endl); 174 cin >> tmpstring; 175 tmp->setSymbol(tmpstring); 172 cin >> tmp->getSymbol(); 176 173 AddElement(tmp); 177 174 return tmp; … … 300 297 while (!(*input).eof()) { 301 298 element *neues = new element; 302 string tmpstring; 303 (*input) >> tmpstring; 304 neues->setName(tmpstring); 305 //(*input) >> ws; 306 (*input) >> tmpstring; 307 neues->setSymbol(tmpstring); 299 (*input) >> neues->getName();; 300 //(*input) >> ws; 301 (*input) >> neues->getSymbol(); 308 302 //(*input) >> ws; 309 303 (*input) >> neues->period;
Note:
See TracChangeset
for help on using the changeset viewer.