Changeset 4283d0 for molecuilder/src


Ignore:
Timestamp:
Apr 12, 2010, 4:45:07 PM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
35bab2
Parents:
a732ff
Message:

FIX: changed the order in which triangles are picked next during tesselation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/boundary.cpp

    ra732ff r4283d0  
    983983  // 1. get starting triangle
    984984  TesselStruct->FindStartingTriangle(RADIUS, LCList);
     985  if (filename != NULL) {
     986    if ((DoSingleStepOutput && ((TesselStruct->TrianglesOnBoundary.size() % SingleStepWidth == 0)))) { // if we have a new triangle and want to output each new triangle configuration
     987      TesselStruct->Output(filename, mol);
     988    }
     989  }
    985990
    986991  // 2. expand from there
     
    10091014    double ShortestAngle = 4.*M_PI;
    10101015    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
    1011       if (Runner->second->ShortestAngle < ShortestAngle) {
    1012         baseline = Runner->second;
    1013         ShortestAngle = baseline->ShortestAngle;
    1014         //Log() << Verbose(1) << "New best candidate is " << *baseline->BaseLine << " with point " << *baseline->point << " and angle " << baseline->ShortestAngle << endl;
     1016      if (Runner->second->T->AngleFromTop < Runner->second->ShortestAngle) {
     1017        Log() << Verbose(1) << "INFO: Checking candidate is " << *Runner->second->BaseLine << " with point " << *(*Runner->second->pointlist.begin()) << " and angle " << Runner->second->ShortestAngle << endl;
     1018        if (Runner->second->ShortestAngle < ShortestAngle) {
     1019          baseline = Runner->second;
     1020          ShortestAngle = baseline->ShortestAngle;
     1021          Log() << Verbose(1) << "New best candidate is " << *baseline->BaseLine << " with point " << *(*baseline->pointlist.begin()) << " and angle " << baseline->ShortestAngle << endl;
     1022        }
     1023      } else {
     1024        Log() << Verbose(1) << "Rejecting openline " << *Runner->second->BaseLine << " with point " << *(*Runner->second->pointlist.begin()) << " and angle " << Runner->second->ShortestAngle << " against angle from top " << Runner->second->T->AngleFromTop << "." << endl;
    10151025      }
    10161026    }
     1027    if ((ShortestAngle == 4.*M_PI) || (baseline->pointlist.empty()))
     1028      for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
     1029        if (Runner->second->ShortestAngle < ShortestAngle) {
     1030          baseline = Runner->second;
     1031          ShortestAngle = baseline->ShortestAngle;
     1032          Log() << Verbose(1) << "New best candidate is " << *baseline->BaseLine << " with point " << *(*baseline->pointlist.begin()) << " and angle " << baseline->ShortestAngle << endl;
     1033        }
     1034      }
    10171035    // 2e. if we found one, add candidate
    10181036    if ((ShortestAngle == 4.*M_PI) || (baseline->pointlist.empty()))
Note: See TracChangeset for help on using the changeset viewer.