Changeset e6a9c1 for src/World.hpp
- Timestamp:
- Mar 4, 2010, 10:40:52 AM (16 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, Candidate_v1.7.0, Candidate_v1.7.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:
- 63b56a7
- Parents:
- 6a661c (diff), 66e95e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
src/World.hpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/World.hpp
r6a661c re6a9c1 27 27 class AtomDescriptor; 28 28 class AtomDescriptor_impl; 29 class MoleculeDescriptor; 30 class MoleculeDescriptor_impl; 29 31 class ManipulateAtomsProcess; 30 32 template<typename T> … … 36 38 friend class AtomDescriptor_impl; 37 39 friend class AtomDescriptor; 40 friend class MoleculeDescriptor_impl; 41 friend class MoleculeDescriptor; 38 42 39 43 // Actions, calculations etc associated with the World … … 77 81 78 82 /** 83 * returns the first molecule that matches a given descriptor. 84 * Do not rely on ordering for descriptors that match more than one molecule. 85 */ 86 molecule *getMolecule(MoleculeDescriptor descriptor); 87 88 /** 89 * returns a vector containing all molecules that match a given descriptor 90 */ 91 std::vector<molecule*> getAllMolecules(MoleculeDescriptor descriptor); 92 93 /** 79 94 * get the number of molecules in the World 80 95 */ … … 117 132 118 133 /** 134 * used when changing an atom Id. 135 * Unless you are calling this method from inside an atom don't fiddle with the third parameter. 136 * 137 * Return value indicates wether the change could be done or not. 138 */ 139 bool changeAtomId(atomId_t oldId, atomId_t newId, atom* target=0); 140 141 /** 119 142 * Produces a process that calls a function on all Atoms matching a given descriptor. The process is not 120 143 * called at this time, so it can be passed around, stored inside menuItems etc. … … 125 148 protected: 126 149 /**** Iterators to use internal data structures */ 150 151 // Atoms 152 127 153 class AtomIterator { 128 154 public: … … 163 189 AtomSet::iterator atomEnd(); 164 190 191 // Molecules 192 193 class MoleculeIterator { 194 public: 195 MoleculeIterator(); 196 MoleculeIterator(MoleculeDescriptor, World*); 197 MoleculeIterator(const MoleculeIterator&); 198 MoleculeIterator& operator=(const MoleculeIterator&); 199 MoleculeIterator& operator++(); // prefix 200 MoleculeIterator operator++(int); // postfix with dummy parameter 201 bool operator==(const MoleculeIterator&); 202 bool operator==(const MoleculeSet::iterator&); 203 bool operator!=(const MoleculeIterator&); 204 bool operator!=(const MoleculeSet::iterator&); 205 molecule* operator*(); 206 207 int getCount(); 208 protected: 209 void advanceState(); 210 MoleculeSet::iterator state; 211 boost::shared_ptr<MoleculeDescriptor_impl> descr; 212 int index; 213 214 World* world; 215 }; 216 217 /** 218 * returns an iterator over all Molecules matching a given descriptor. 219 * used for internal purposes, like MoleculeProcesses and MoleculeCalculations. 220 */ 221 MoleculeIterator getMoleculeIter(MoleculeDescriptor descr); 222 223 /** 224 * returns an iterator to the end of the MoleculeSet. Due to overloading this iterator 225 * can be compared to iterators produced by getMoleculeIter (see the mis-matching types). 226 * Thus it can be used to detect when such an iterator is at the end of the list. 227 * used for internal purposes, like MoleculeProcesses and MoleculeCalculations. 228 */ 229 MoleculeSet::iterator moleculeEnd(); 230 231 165 232 /******* Internal manipulation routines for double callback and Observer mechanism ******/ 166 233 void doManipulate(ManipulateAtomsProcess *); 167 234 168 235 private: 236 237 atomId_t getNextAtomId(); 238 void releaseAtomId(atomId_t); 239 bool reserveAtomId(atomId_t); 240 169 241 periodentafel *periode; 170 242 AtomSet atoms; 243 std::set<atomId_t> atomIdPool; //<!stores the pool for all available AtomIds below currAtomId 171 244 atomId_t currAtomId; //!< stores the next available Id for atoms 172 245 MoleculeSet molecules;
Note:
See TracChangeset
for help on using the changeset viewer.
