Changeset 735b1c for src/tesselation.cpp


Ignore:
Timestamp:
Mar 1, 2011, 10:16:39 AM (14 years ago)
Author:
Frederik Heber <heber@…>
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:
5309ba
Parents:
a479fa
git-author:
Frederik Heber <heber@…> (02/22/11 00:15:33)
git-committer:
Frederik Heber <heber@…> (03/01/11 10:16:39)
Message:

ParticleInfo::ParticleInfo_nr is protected and accessed via getter/setter.

  • many changes (~400) in molecule- and tesselation-related functions.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselation.cpp

    ra479fa r735b1c  
    536536  PointTestPair InsertUnique;
    537537  BPS[n] = new class BoundaryPointSet(Walker);
    538   InsertUnique = PointsOnBoundary.insert(PointPair(Walker->ParticleInfo_nr, BPS[n]));
     538  InsertUnique = PointsOnBoundary.insert(PointPair(Walker->getNr(), BPS[n]));
    539539  if (InsertUnique.second) { // if new point was not present before, increase counter
    540540    PointsOnBoundaryCount++;
     
    558558  PointTestPair InsertUnique;
    559559  TPS[n] = new class BoundaryPointSet(Candidate);
    560   InsertUnique = PointsOnBoundary.insert(PointPair(Candidate->ParticleInfo_nr, TPS[n]));
     560  InsertUnique = PointsOnBoundary.insert(PointPair(Candidate->getNr(), TPS[n]));
    561561  if (InsertUnique.second) { // if new point was not present before, increase counter
    562562    PointsOnBoundaryCount++;
     
    577577{
    578578  Info FunctionInfo(__func__);
    579   PointMap::const_iterator FindPoint = PointsOnBoundary.find(Candidate->ParticleInfo_nr);
     579  PointMap::const_iterator FindPoint = PointsOnBoundary.find(Candidate->getNr());
    580580  if (FindPoint != PointsOnBoundary.end())
    581581    TPS[n] = FindPoint->second;
     
    597597{
    598598  bool insertNewLine = true;
    599   LineMap::iterator FindLine = a->lines.find(b->node->ParticleInfo_nr);
     599  LineMap::iterator FindLine = a->lines.find(b->node->getNr());
    600600  BoundaryLineSet *WinningLine = NULL;
    601601  if (FindLine != a->lines.end()) {
     
    603603
    604604    pair<LineMap::iterator, LineMap::iterator> FindPair;
    605     FindPair = a->lines.equal_range(b->node->ParticleInfo_nr);
     605    FindPair = a->lines.equal_range(b->node->getNr());
    606606
    607607    for (FindLine = FindPair.first; (FindLine != FindPair.second) && (insertNewLine); FindLine++) {
     
    709709/** Function adds triangle to global list.
    710710 * Furthermore, the triangle number is set to \a ParticleInfo_nr.
    711  * \param ParticleInfo_nr triangle number
     711 * \param getNr() triangle number
    712712 */
    713713void Tesselation::AddTesselationTriangle(const int nr)
     
    902902  // builds a triangle point set (Points) of the end points
    903903  for (int i = 0; i < 3; i++) {
    904     PointMap::const_iterator FindPoint = PointsOnBoundary.find(Candidates[i]->ParticleInfo_nr);
     904    PointMap::const_iterator FindPoint = PointsOnBoundary.find(Candidates[i]->getNr());
    905905    if (FindPoint != PointsOnBoundary.end()) {
    906906      Points[i] = FindPoint->second;
     
    915915      for (int j = i; j < 3; j++) {
    916916        if (Points[j] != NULL) {
    917           LineMap::const_iterator FindLine = Points[i]->lines.find(Points[j]->node->ParticleInfo_nr);
    918           for (; (FindLine != Points[i]->lines.end()) && (FindLine->first == Points[j]->node->ParticleInfo_nr); FindLine++) {
     917          LineMap::const_iterator FindLine = Points[i]->lines.find(Points[j]->node->getNr());
     918          for (; (FindLine != Points[i]->lines.end()) && (FindLine->first == Points[j]->node->getNr()); FindLine++) {
    919919            TriangleMap *triangles = &FindLine->second->triangles;
    920920            DoLog(1) && (Log() << Verbose(1) << "Current line is " << FindLine->first << ": " << *(FindLine->second) << " with triangles " << triangles << "." << endl);
     
    955955  // builds a triangle point set (Points) of the end points
    956956  for (int i = 0; i < 3; i++) {
    957     PointMap::iterator FindPoint = PointsOnBoundary.find(Candidates[i]->ParticleInfo_nr);
     957    PointMap::iterator FindPoint = PointsOnBoundary.find(Candidates[i]->getNr());
    958958    if (FindPoint != PointsOnBoundary.end()) {
    959959      Points[i] = FindPoint->second;
     
    968968      for (int j = i; j < 3; j++) {
    969969        if (Points[j] != NULL) {
    970           LineMap::iterator FindLine = Points[i]->lines.find(Points[j]->node->ParticleInfo_nr);
    971           for (; (FindLine != Points[i]->lines.end()) && (FindLine->first == Points[j]->node->ParticleInfo_nr); FindLine++) {
     970          LineMap::iterator FindLine = Points[i]->lines.find(Points[j]->node->getNr());
     971          for (; (FindLine != Points[i]->lines.end()) && (FindLine->first == Points[j]->node->getNr()); FindLine++) {
    972972            TriangleMap *triangles = &FindLine->second->triangles;
    973973            for (TriangleMap::iterator FindTriangle = triangles->begin(); FindTriangle != triangles->end(); FindTriangle++) {
     
    11451145//
    11461146//  // check both other lines
    1147 //  PointMap::const_iterator FindPoint = PointsOnBoundary.find(ThirdNode->ParticleInfo_nr);
     1147//  PointMap::const_iterator FindPoint = PointsOnBoundary.find(ThirdNode->getNr());
    11481148//  if (FindPoint != PointsOnBoundary.end()) {
    11491149//    for (int i=0;i<2;i++) {
    1150 //      LineMap::const_iterator FindLine = (FindPoint->second)->lines.find(BaseRay->endpoints[0]->node->ParticleInfo_nr);
     1150//      LineMap::const_iterator FindLine = (FindPoint->second)->lines.find(BaseRay->endpoints[0]->node->getNr());
    11511151//      if (FindLine != (FindPoint->second)->lines.end()) {
    11521152//        Line = FindLine->second;
     
    14401440  Info FunctionInfo(__func__);
    14411441
    1442   pair<LineMap::iterator, LineMap::iterator> FindPair = TPS[0]->lines.equal_range(TPS[2]->node->ParticleInfo_nr);
     1442  pair<LineMap::iterator, LineMap::iterator> FindPair = TPS[0]->lines.equal_range(TPS[2]->node->getNr());
    14431443  for (LineMap::const_iterator FindLine = FindPair.first; FindLine != FindPair.second; FindLine++) {
    14441444    DoLog(1) && (Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl);
     
    22232223        if (List != NULL) {
    22242224          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    2225             FindPoint = PointsOnBoundary.find((*Runner)->ParticleInfo_nr);
     2225            FindPoint = PointsOnBoundary.find((*Runner)->getNr());
    22262226            if (FindPoint != PointsOnBoundary.end()) {
    22272227              points->insert(DistanceToPointPair(FindPoint->second->node->DistanceSquared(x), FindPoint->second));
     
    25572557  bool takePoint = false;
    25582558  // find the respective boundary point
    2559   PointMap::const_iterator PointRunner = PointsOnBoundary.find(Point->ParticleInfo_nr);
     2559  PointMap::const_iterator PointRunner = PointsOnBoundary.find(Point->getNr());
    25602560  if (PointRunner != PointsOnBoundary.end()) {
    25612561    ReferencePoint = PointRunner->second;
     
    25772577    takePoint = false;
    25782578
    2579     if (findLines->second->endpoints[0]->Nr == Point->ParticleInfo_nr) {
     2579    if (findLines->second->endpoints[0]->Nr == Point->getNr()) {
    25802580      takePoint = true;
    25812581      current = findLines->second->endpoints[1]->node;
    2582     } else if (findLines->second->endpoints[1]->Nr == Point->ParticleInfo_nr) {
     2582    } else if (findLines->second->endpoints[1]->Nr == Point->getNr()) {
    25832583      takePoint = true;
    25842584      current = findLines->second->endpoints[0]->node;
     
    28132813  class BoundaryLineSet *StartLine = NULL;
    28142814  // find the respective boundary point
    2815   PointMap::const_iterator PointRunner = PointsOnBoundary.find(Point->ParticleInfo_nr);
     2815  PointMap::const_iterator PointRunner = PointsOnBoundary.find(Point->getNr());
    28162816  if (PointRunner != PointsOnBoundary.end()) {
    28172817    ReferencePoint = PointRunner->second;
     
    32333233      TrianglePoints[i] = NULL;
    32343234    } else {
    3235       PointMap::const_iterator FindPoint = PointsOnBoundary.find(Points[i]->ParticleInfo_nr);
     3235      PointMap::const_iterator FindPoint = PointsOnBoundary.find(Points[i]->getNr());
    32363236      if (FindPoint != PointsOnBoundary.end()) {
    32373237        TrianglePoints[i] = FindPoint->second;
     
    32483248          for (int j = i + 1; j < 3; j++) {
    32493249            if (TrianglePoints[j] != NULL) {
    3250               for (FindLine = TrianglePoints[i]->lines.find(TrianglePoints[j]->node->ParticleInfo_nr); // is a multimap!
    3251               (FindLine != TrianglePoints[i]->lines.end()) && (FindLine->first == TrianglePoints[j]->node->ParticleInfo_nr); FindLine++) {
     3250              for (FindLine = TrianglePoints[i]->lines.find(TrianglePoints[j]->node->getNr()); // is a multimap!
     3251              (FindLine != TrianglePoints[i]->lines.end()) && (FindLine->first == TrianglePoints[j]->node->getNr()); FindLine++) {
    32523252                for (FindTriangle = FindLine->second->triangles.begin(); FindTriangle != FindLine->second->triangles.end(); FindTriangle++) {
    32533253                  if (FindTriangle->second->IsPresentTupel(TrianglePoints)) {
     
    32693269        if (TrianglePoints[i] == NULL)
    32703270          break;
    3271       for (FindLine = TrianglePoints[(i + 1) % 3]->lines.find(TrianglePoints[(i + 2) % 3]->node->ParticleInfo_nr); // is a multimap!
    3272       (FindLine != TrianglePoints[(i + 1) % 3]->lines.end()) && (FindLine->first == TrianglePoints[(i + 2) % 3]->node->ParticleInfo_nr); FindLine++) {
     3271      for (FindLine = TrianglePoints[(i + 1) % 3]->lines.find(TrianglePoints[(i + 2) % 3]->node->getNr()); // is a multimap!
     3272      (FindLine != TrianglePoints[(i + 1) % 3]->lines.end()) && (FindLine->first == TrianglePoints[(i + 2) % 3]->node->getNr()); FindLine++) {
    32733273        for (FindTriangle = FindLine->second->triangles.begin(); FindTriangle != FindLine->second->triangles.end(); FindTriangle++) {
    32743274          if (FindTriangle->second->IsPresentTupel(TrianglePoints)) {
     
    35313531  if (NearestPoint == point)
    35323532    NearestPoint = BackupPoint;
    3533   PointRunner = PointsOnBoundary.find(NearestPoint->ParticleInfo_nr);
     3533  PointRunner = PointsOnBoundary.find(NearestPoint->getNr());
    35343534  if (PointRunner != PointsOnBoundary.end()) {
    35353535    NearestBoundaryPoint = PointRunner->second;
Note: See TracChangeset for help on using the changeset viewer.