Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselationhelpers.cpp

    r299554 rf67b6e  
    8181
    8282  if (fabs(m11) < MYEPSILON)
    83     DoeLog(1) && (eLog()<< Verbose(1) << "three points are colinear." << endl);
     83    eLog() << Verbose(1) << "three points are colinear." << endl;
    8484
    8585  center->x[0] =  0.5 * m12/ m11;
     
    8888
    8989  if (fabs(a.Distance(center) - RADIUS) > MYEPSILON)
    90     DoeLog(1) && (eLog()<< Verbose(1) << "The given center is further way by " << fabs(a.Distance(center) - RADIUS) << " from a than RADIUS." << endl);
     90    eLog() << Verbose(1) << "The given center is further way by " << fabs(a.Distance(center) - RADIUS) << " from a than RADIUS." << endl;
    9191
    9292  gsl_matrix_free(A);
     
    132132  Center->Scale(1./(sin(2.*alpha) + sin(2.*beta) + sin(2.*gamma)));
    133133  NewUmkreismittelpunkt->CopyVector(Center);
    134   DoLog(1) && (Log() << Verbose(1) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n");
     134  Log() << Verbose(1) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n";
    135135  // Here we calculated center of circumscribing circle, using barycentric coordinates
    136   DoLog(1) && (Log() << Verbose(1) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n");
     136  Log() << Verbose(1) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n";
    137137
    138138  TempNormal.CopyVector(&a);
     
    143143  if (fabs(HalfplaneIndicator) < MYEPSILON)
    144144    {
    145       if ((TempNormal.ScalarProduct(AlternativeDirection) <0 && AlternativeIndicator >0) || (TempNormal.ScalarProduct(AlternativeDirection) >0 && AlternativeIndicator <0))
     145      if ((TempNormal.ScalarProduct(AlternativeDirection) <0 and AlternativeIndicator >0) or (TempNormal.ScalarProduct(AlternativeDirection) >0 and AlternativeIndicator <0))
    146146        {
    147147          TempNormal.Scale(-1);
     
    150150  else
    151151    {
    152       if (((TempNormal.ScalarProduct(Direction)<0) && (HalfplaneIndicator >0)) || ((TempNormal.ScalarProduct(Direction)>0) && (HalfplaneIndicator<0)))
     152      if (TempNormal.ScalarProduct(Direction)<0 && HalfplaneIndicator >0 || TempNormal.ScalarProduct(Direction)>0 && HalfplaneIndicator<0)
    153153        {
    154154          TempNormal.Scale(-1);
     
    158158  TempNormal.Normalize();
    159159  Restradius = sqrt(RADIUS*RADIUS - Umkreisradius*Umkreisradius);
    160   DoLog(1) && (Log() << Verbose(1) << "Height of center of circumference to center of sphere is " << Restradius << ".\n");
     160  Log() << Verbose(1) << "Height of center of circumference to center of sphere is " << Restradius << ".\n";
    161161  TempNormal.Scale(Restradius);
    162   DoLog(1) && (Log() << Verbose(1) << "Shift vector to sphere of circumference is " << TempNormal << ".\n");
     162  Log() << Verbose(1) << "Shift vector to sphere of circumference is " << TempNormal << ".\n";
    163163
    164164  Center->AddVector(&TempNormal);
    165   DoLog(1) && (Log() << Verbose(1) << "Center of sphere of circumference is " << *Center << ".\n");
     165  Log() << Verbose(1) << "Center of sphere of circumference is " << *Center << ".\n";
    166166  GetSphere(&OtherCenter, a, b, c, RADIUS);
    167   DoLog(1) && (Log() << Verbose(1) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n");
     167  Log() << Verbose(1) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n";
    168168};
    169169
     
    192192  //Log() << Verbose(1) << "INFO: alpha = " << alpha/M_PI*180. << ", beta = " << beta/M_PI*180. << ", gamma = " << gamma/M_PI*180. << "." << endl;
    193193  if (fabs(M_PI - alpha - beta - gamma) > HULLEPSILON) {
    194     DoeLog(2) && (eLog()<< Verbose(2) << "GetCenterofCircumcircle: Sum of angles " << (alpha+beta+gamma)/M_PI*180. << " > 180 degrees by " << fabs(M_PI - alpha - beta - gamma)/M_PI*180. << "!" << endl);
     194    eLog() << Verbose(1) << "GetCenterofCircumcircle: Sum of angles " << (alpha+beta+gamma)/M_PI*180. << " > 180 degrees by " << fabs(M_PI - alpha - beta - gamma)/M_PI*180. << "!" << endl;
    195195  }
    196196
     
    226226  Vector helper;
    227227  double radius, alpha;
    228   Vector RelativeOldSphereCenter;
    229   Vector RelativeNewSphereCenter;
    230 
    231   RelativeOldSphereCenter.CopyVector(&OldSphereCenter);
    232   RelativeOldSphereCenter.SubtractVector(&CircleCenter);
    233   RelativeNewSphereCenter.CopyVector(&NewSphereCenter);
    234   RelativeNewSphereCenter.SubtractVector(&CircleCenter);
    235   helper.CopyVector(&RelativeNewSphereCenter);
     228
     229  helper.CopyVector(&NewSphereCenter);
    236230  // test whether new center is on the parameter circle's plane
    237231  if (fabs(helper.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) {
    238     DoeLog(1) && (eLog()<< Verbose(1) << "Something's very wrong here: NewSphereCenter is not on the band's plane as desired by " <<fabs(helper.ScalarProduct(&CirclePlaneNormal))  << "!" << endl);
     232    eLog() << Verbose(1) << "Something's very wrong here: NewSphereCenter is not on the band's plane as desired by " <<fabs(helper.ScalarProduct(&CirclePlaneNormal))  << "!" << endl;
    239233    helper.ProjectOntoPlane(&CirclePlaneNormal);
    240234  }
    241   radius = helper.NormSquared();
     235  radius = helper.ScalarProduct(&helper);
    242236  // test whether the new center vector has length of CircleRadius
    243237  if (fabs(radius - CircleRadius) > HULLEPSILON)
    244     DoeLog(1) && (eLog()<< Verbose(1) << "The projected center of the new sphere has radius " << radius << " instead of " << CircleRadius << "." << endl);
    245   alpha = helper.Angle(&RelativeOldSphereCenter);
     238    eLog() << Verbose(1) << "The projected center of the new sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;
     239  alpha = helper.Angle(&OldSphereCenter);
    246240  // make the angle unique by checking the halfplanes/search direction
    247241  if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON)  // acos is not unique on [0, 2.*M_PI), hence extra check to decide between two half intervals
    248242    alpha = 2.*M_PI - alpha;
    249   DoLog(1) && (Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << RelativeOldSphereCenter << " and resulting angle is " << alpha << "." << endl);
    250   radius = helper.Distance(&RelativeOldSphereCenter);
     243  //Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << OldSphereCenter << " and resulting angle is " << alpha << "." << endl;
     244  radius = helper.Distance(&OldSphereCenter);
    251245  helper.ProjectOntoPlane(&NormalVector);
    252246  // check whether new center is somewhat away or at least right over the current baseline to prevent intersecting triangles
    253247  if ((radius > HULLEPSILON) || (helper.Norm() < HULLEPSILON)) {
    254     DoLog(1) && (Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl);
     248    //Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl;
    255249    return alpha;
    256250  } else {
    257     DoLog(1) && (Log() << Verbose(1) << "INFO: NewSphereCenter " << RelativeNewSphereCenter << " is too close to RelativeOldSphereCenter" << RelativeOldSphereCenter << "." << endl);
     251    //Log() << Verbose(1) << "INFO: NewSphereCenter " << helper << " is too close to OldSphereCenter" << OldSphereCenter << "." << endl;
    258252    return 2.*M_PI;
    259253  }
     
    364358
    365359        if (status == GSL_SUCCESS) {
    366           DoLog(1) && (Log() << Verbose(1) << "converged to minimum" <<  endl);
     360          Log() << Verbose(1) << "converged to minimum" <<  endl;
    367361        }
    368362    } while (status == GSL_CONTINUE && iter < 100);
     
    394388
    395389  if (((t1 >= 0) && (t1 <= 1)) && ((t2 >= 0) && (t2 <= 1))) {
    396     DoLog(1) && (Log() << Verbose(1) << "true intersection." << endl);
     390    Log() << Verbose(1) << "true intersection." << endl;
    397391    result = true;
    398392  } else {
    399     DoLog(1) && (Log() << Verbose(1) << "intersection out of region of interest." << endl);
     393    Log() << Verbose(1) << "intersection out of region of interest." << endl;
    400394    result = false;
    401395  }
     
    432426  }
    433427
    434   DoLog(1) && (Log() << Verbose(1) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl);
     428  Log() << Verbose(1) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl;
    435429
    436430  return phi;
     
    479473    for (int j=i+1; j<3; j++) {
    480474      if (nodes[i] == NULL) {
    481         DoLog(1) && (Log() << Verbose(1) << "Node nr. " << i << " is not yet present." << endl);
     475        Log() << Verbose(1) << "Node nr. " << i << " is not yet present." << endl;
    482476        result = true;
    483477      } else if (nodes[i]->lines.find(nodes[j]->node->nr) != nodes[i]->lines.end()) {  // there already is a line
     
    493487        }
    494488      } else { // no line
    495         DoLog(1) && (Log() << Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl);
     489        Log() << Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl;
    496490        result = true;
    497491      }
    498492    }
    499493  if ((!result) && (counter > 1)) {
    500     DoLog(1) && (Log() << Verbose(1) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl);
     494    Log() << Verbose(1) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl;
    501495    result = true;
    502496  }
     
    512506//  Vector BaseLineVector, OrthogonalVector, helper;
    513507//  if (candidate1->BaseLine != candidate2->BaseLine) {  // sanity check
    514 //    DoeLog(1) && (eLog()<< Verbose(1) << "sortCandidates was called for two different baselines: " << candidate1->BaseLine << " and " << candidate2->BaseLine << "." << endl);
     508//    eLog() << Verbose(1) << "sortCandidates was called for two different baselines: " << candidate1->BaseLine << " and " << candidate2->BaseLine << "." << endl;
    515509//    //return false;
    516510//    exit(1);
     
    558552 * @return point which is second closest to the provided one
    559553 */
    560 TesselPoint* FindSecondClosestTesselPoint(const Vector* Point, const LinkedCell* const LC)
     554TesselPoint* FindSecondClosestPoint(const Vector* Point, const LinkedCell* const LC)
    561555{
    562556        Info FunctionInfo(__func__);
     
    571565  for(int i=0;i<NDIM;i++) // store indices of this cell
    572566    N[i] = LC->n[i];
    573   DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl);
     567  Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
    574568
    575569  LC->GetNeighbourBounds(Nlower, Nupper);
     
    578572    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    579573      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    580         const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     574        const LinkedNodes *List = LC->GetCurrentCell();
    581575        //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
    582576        if (List != NULL) {
    583           for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     577          for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    584578            helper.CopyVector(Point);
    585579            helper.SubtractVector((*Runner)->node);
     
    613607 * @return point which is closest to the provided one, NULL if none found
    614608 */
    615 TesselPoint* FindClosestTesselPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC)
     609TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, const LinkedCell* const LC)
    616610{
    617611        Info FunctionInfo(__func__);
     
    626620  for(int i=0;i<NDIM;i++) // store indices of this cell
    627621    N[i] = LC->n[i];
    628   DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl);
     622  Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
    629623
    630624  LC->GetNeighbourBounds(Nlower, Nupper);
     
    633627    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    634628      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    635         const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     629        const LinkedNodes *List = LC->GetCurrentCell();
    636630        //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
    637631        if (List != NULL) {
    638           for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     632          for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    639633            helper.CopyVector(Point);
    640634            helper.SubtractVector((*Runner)->node);
    641             double currentNorm = helper.NormSquared();
     635            double currentNorm = helper. Norm();
    642636            if (currentNorm < distance) {
    643637              secondDistance = distance;
     
    659653  // output
    660654  if (closestPoint != NULL) {
    661     DoLog(1) && (Log() << Verbose(1) << "Closest point is " << *closestPoint);
     655    Log() << Verbose(1) << "Closest point is " << *closestPoint;
    662656    if (SecondPoint != NULL)
    663       DoLog(0) && (Log() << Verbose(0) << " and second closest is " << *SecondPoint);
    664     DoLog(0) && (Log() << Verbose(0) << "." << endl);
     657      Log() << Verbose(0) << " and second closest is " << *SecondPoint;
     658    Log() << Verbose(0) << "." << endl;
    665659  }
    666660  return closestPoint;
     
    686680  Normal.VectorProduct(&OtherBaseline);
    687681  Normal.Normalize();
    688   DoLog(1) && (Log() << Verbose(1) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl);
     682  Log() << Verbose(1) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl;
    689683
    690684  // project one offset point of OtherBase onto this plane (and add plane offset vector)
     
    703697  Normal.CopyVector(Intersection);
    704698  Normal.SubtractVector(Base->endpoints[0]->node->node);
    705   DoLog(1) && (Log() << Verbose(1) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl);
     699  Log() << Verbose(1) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl;
    706700
    707701  return Intersection;
     
    764758    }
    765759  } else {
    766     DoeLog(1) && (eLog()<< Verbose(1) << "Given vrmlfile is " << vrmlfile << "." << endl);
     760    eLog() << Verbose(1) << "Given vrmlfile is " << vrmlfile << "." << endl;
    767761  }
    768762  delete(center);
     
    839833    *rasterfile << "9\n#  terminating special property\n";
    840834  } else {
    841     DoeLog(1) && (eLog()<< Verbose(1) << "Given rasterfile is " << rasterfile << "." << endl);
     835    eLog() << Verbose(1) << "Given rasterfile is " << rasterfile << "." << endl;
    842836  }
    843837  IncludeSphereinRaster3D(rasterfile, Tess, cloud);
     
    862856    } else {
    863857      *tecplot << N << "-";
    864       if (TesselStruct->LastTriangle != NULL) {
    865         for (int i=0;i<3;i++)
    866           *tecplot << (i==0 ? "" : "_") << TesselStruct->LastTriangle->endpoints[i]->node->Name;
    867       } else {
    868         *tecplot << "none";
    869       }
     858      for (int i=0;i<3;i++)
     859        *tecplot << (i==0 ? "" : "_") << TesselStruct->LastTriangle->endpoints[i]->node->Name;
    870860    }
    871861    *tecplot << "\", N=" << TesselStruct->PointsOnBoundary.size() << ", E=" << TesselStruct->TrianglesOnBoundary.size() << ", DATAPACKING=POINT, ZONETYPE=FETRIANGLE" << endl;
    872     int i=cloud->GetMaxId();
     862    int i=0;
     863    for (cloud->GoToFirst(); !cloud->IsEnd(); cloud->GoToNext(), i++);
    873864    int *LookupList = new int[i];
    874865    for (cloud->GoToFirst(), i=0; !cloud->IsEnd(); cloud->GoToNext(), i++)
     
    885876    *tecplot << endl;
    886877    // print connectivity
    887     DoLog(1) && (Log() << Verbose(1) << "The following triangles were created:" << endl);
     878    Log() << Verbose(1) << "The following triangles were created:" << endl;
    888879    for (TriangleMap::const_iterator runner = TesselStruct->TrianglesOnBoundary.begin(); runner != TesselStruct->TrianglesOnBoundary.end(); runner++) {
    889       DoLog(1) && (Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl);
     880      Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl;
    890881      *tecplot << LookupList[runner->second->endpoints[0]->node->nr] << " " << LookupList[runner->second->endpoints[1]->node->nr] << " " << LookupList[runner->second->endpoints[2]->node->nr] << endl;
    891882    }
     
    908899  for (PointMap::const_iterator PointRunner = TesselStruct->PointsOnBoundary.begin(); PointRunner != TesselStruct->PointsOnBoundary.end(); PointRunner++) {
    909900    point = PointRunner->second;
    910     DoLog(1) && (Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl);
     901    Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl;
    911902    point->value = 0;
    912903    for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) {
     
    932923  int counter = 0;
    933924
    934   DoLog(1) && (Log() << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl);
     925  Log() << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl;
    935926  for (testline = TesselStruct->LinesOnBoundary.begin(); testline != TesselStruct->LinesOnBoundary.end(); testline++) {
    936927    if (testline->second->triangles.size() != 2) {
    937       DoLog(2) && (Log() << Verbose(2) << *testline->second << "\t" << testline->second->triangles.size() << endl);
     928      Log() << Verbose(2) << *testline->second << "\t" << testline->second->triangles.size() << endl;
    938929      counter++;
    939930    }
    940931  }
    941932  if (counter == 0) {
    942     DoLog(1) && (Log() << Verbose(1) << "None." << endl);
     933    Log() << Verbose(1) << "None." << endl;
    943934    result = true;
    944935  }
     
    946937}
    947938
    948 /** Counts the number of triangle pairs that contain the given polygon.
    949  * \param *P polygon with endpoints to look for
    950  * \param *T set of triangles to create pairs from containing \a *P
    951  */
    952 int CountTrianglePairContainingPolygon(const BoundaryPolygonSet * const P, const TriangleSet * const T)
    953 {
    954   Info FunctionInfo(__func__);
    955   // check number of endpoints in *P
    956   if (P->endpoints.size() != 4) {
    957     DoeLog(1) && (eLog()<< Verbose(1) << "CountTrianglePairContainingPolygon works only on polygons with 4 nodes!" << endl);
    958     return 0;
    959   }
    960 
    961   // check number of triangles in *T
    962   if (T->size() < 2) {
    963     DoeLog(1) && (eLog()<< Verbose(1) << "Not enough triangles to have pairs!" << endl);
    964     return 0;
    965   }
    966 
    967   DoLog(0) && (Log() << Verbose(0) << "Polygon is " << *P << endl);
    968   // create each pair, get the endpoints and check whether *P is contained.
    969   int counter = 0;
    970   PointSet Trianglenodes;
    971   class BoundaryPolygonSet PairTrianglenodes;
    972   for(TriangleSet::iterator Walker = T->begin(); Walker != T->end(); Walker++) {
    973     for (int i=0;i<3;i++)
    974       Trianglenodes.insert((*Walker)->endpoints[i]);
    975 
    976     for(TriangleSet::iterator PairWalker = Walker; PairWalker != T->end(); PairWalker++) {
    977       if (Walker != PairWalker) { // skip first
    978         PairTrianglenodes.endpoints = Trianglenodes;
    979         for (int i=0;i<3;i++)
    980           PairTrianglenodes.endpoints.insert((*PairWalker)->endpoints[i]);
    981         const int size = PairTrianglenodes.endpoints.size();
    982         if (size == 4) {
    983           DoLog(0) && (Log() << Verbose(0) << " Current pair of triangles: " << **Walker << "," << **PairWalker << " with " << size << " distinct endpoints:" << PairTrianglenodes << endl);
    984           // now check
    985           if (PairTrianglenodes.ContainsPresentTupel(P)) {
    986             counter++;
    987             DoLog(0) && (Log() << Verbose(0) << "  ACCEPT: Matches with " << *P << endl);
    988           } else {
    989             DoLog(0) && (Log() << Verbose(0) << "  REJECT: No match with " << *P << endl);
    990           }
    991         } else {
    992           DoLog(0) && (Log() << Verbose(0) << "  REJECT: Less than four endpoints." << endl);
    993         }
    994       }
    995     }
    996     Trianglenodes.clear();
    997   }
    998   return counter;
    999 };
    1000 
    1001 /** Checks whether two give polygons have two or more points in common.
    1002  * \param *P1 first polygon
    1003  * \param *P2 second polygon
    1004  * \return true - are connected, false = are note
    1005  */
    1006 bool ArePolygonsEdgeConnected(const BoundaryPolygonSet * const P1, const BoundaryPolygonSet * const P2)
    1007 {
    1008   Info FunctionInfo(__func__);
    1009   int counter = 0;
    1010   for(PointSet::const_iterator Runner = P1->endpoints.begin(); Runner != P1->endpoints.end(); Runner++) {
    1011     if (P2->ContainsBoundaryPoint((*Runner))) {
    1012       counter++;
    1013       DoLog(1) && (Log() << Verbose(1) << *(*Runner) << " of second polygon is found in the first one." << endl);
    1014       return true;
    1015     }
    1016   }
    1017   return false;
    1018 };
    1019 
    1020 /** Combines second into the first and deletes the second.
    1021  * \param *P1 first polygon, contains all nodes on return
    1022  * \param *&P2 second polygon, is deleted.
    1023  */
    1024 void CombinePolygons(BoundaryPolygonSet * const P1, BoundaryPolygonSet * &P2)
    1025 {
    1026   Info FunctionInfo(__func__);
    1027   pair <PointSet::iterator, bool> Tester;
    1028   for(PointSet::iterator Runner = P2->endpoints.begin(); Runner != P2->endpoints.end(); Runner++) {
    1029     Tester = P1->endpoints.insert((*Runner));
    1030     if (Tester.second)
    1031       DoLog(0) && (Log() << Verbose(0) << "Inserting endpoint " << *(*Runner) << " into first polygon." << endl);
    1032   }
    1033   P2->endpoints.clear();
    1034   delete(P2);
    1035 };
    1036 
Note: See TracChangeset for help on using the changeset viewer.