Ignore:
Timestamp:
Nov 3, 2011, 7:44:01 PM (13 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:
41a467
Parents:
50e4e5
git-author:
Frederik Heber <heber@…> (10/27/11 11:53:58)
git-committer:
Frederik Heber <heber@…> (11/03/11 19:44:01)
Message:

HUGE: Removed all calls to Log(), eLog(), replaced by LOG() and ELOG().

  • Replaced DoLog(.) && (Log() << Verbose(.) << ... << std::endl) by Log(., ...).
  • Replaced Log() << Verbose(.) << .. << by Log(., ...)
  • on multiline used stringstream to generate and message which was finally used in LOG(., output.str())
  • there should be no more occurence of Log(). LOG() and ELOG() must be used instead.
  • Eventually, this will allow for storing all errors and re-printing them on program exit which would be very helpful to ascertain error-free runs for the user.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tesselation/tesselation.cpp

    r50e4e5 r47d041  
    2222#include <fstream>
    2323#include <iomanip>
     24#include <sstream>
    2425
    2526#include "BoundaryPointSet.hpp"
     
    7677{
    7778  Info FunctionInfo(__func__);
    78   DoLog(0) && (Log() << Verbose(0) << "Free'ing TesselStruct ... " << endl);
     79  LOG(0, "Free'ing TesselStruct ... ");
    7980  for (TriangleMap::iterator runner = TrianglesOnBoundary.begin(); runner != TrianglesOnBoundary.end(); runner++) {
    8081    if (runner->second != NULL) {
     
    8283      runner->second = NULL;
    8384    } else
    84       DoeLog(1) && (eLog() << Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl);
    85   }
    86   DoLog(0) && (Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl);
     85      ELOG(1, "The triangle " << runner->first << " has already been free'd.");
     86  }
     87  LOG(0, "This envelope was written to file " << TriangleFilesWritten << " times(s).");
    8788}
    8889
     
    121122    }
    122123  }
    123   //    // listing distances
    124   //    Log() << Verbose(1) << "Listing DistanceMMap:";
    125   //    for(DistanceMultiMap::iterator runner = DistanceMMap.begin(); runner != DistanceMMap.end(); runner++) {
    126   //      Log() << Verbose(0) << " " << runner->first << "(" << *runner->second.first->second << ", " << *runner->second.second->second << ")";
    127   //    }
    128   //    Log() << Verbose(0) << endl;
     124//  // listing distances
     125//  if (DoLog(1)) {
     126//    std::stringstream output;
     127//    output << "Listing DistanceMMap:";
     128//    for(DistanceMultiMap::iterator runner = DistanceMMap.begin(); runner != DistanceMMap.end(); runner++) {
     129//      output << " " << runner->first << "(" << *runner->second.first->second << ", " << *runner->second.second->second << ")";
     130//    }
     131//    LOG(1, output.str());
     132//  }
    129133  // 4b2. pick three baselines forming a triangle
    130134  // 1. we take from the smallest sum of squared distance as the base line BC (with peak A) onward as the triangle candidate
     
    137141                        baseline->second.first->second->node->getPosition(),
    138142                        baseline->second.second->second->node->getPosition()).getNormal();
    139     DoLog(2) && (Log() << Verbose(2) << "Plane vector of candidate triangle is " << PlaneVector << endl);
     143    LOG(2, "Plane vector of candidate triangle is " << PlaneVector);
    140144    // 4. loop over all points
    141145    double sign = 0.;
     
    150154      if (fabs(distance) < 1e-4) // we need to have a small epsilon around 0 which is still ok
    151155        continue;
    152       DoLog(2) && (Log() << Verbose(2) << "Projection of " << checker->second->node->getName() << " yields distance of " << distance << "." << endl);
     156      LOG(2, "Projection of " << checker->second->node->getName() << " yields distance of " << distance << ".");
    153157      tmp = distance / fabs(distance);
    154158      // 4b. Any have different sign to than before? (i.e. would lie outside convex hull with this starting triangle)
    155159      if ((sign != 0) && (tmp != sign)) {
    156160        // 4c. If so, break 4. loop and continue with next candidate in 1. loop
    157         DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->getName() << "," << baseline->second.first->second->node->getName() << "," << baseline->second.second->second->node->getName() << " leaves " << checker->second->node->getName() << " outside the convex hull." << endl);
     161        LOG(2, "Current candidates: " << A->second->node->getName() << "," << baseline->second.first->second->node->getName() << "," << baseline->second.second->second->node->getName() << " leaves " << checker->second->node->getName() << " outside the convex hull.");
    158162        break;
    159163      } else { // note the sign for later
    160         DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->getName() << "," << baseline->second.first->second->node->getName() << "," << baseline->second.second->second->node->getName() << " leave " << checker->second->node->getName() << " inside the convex hull." << endl);
     164        LOG(2, "Current candidates: " << A->second->node->getName() << "," << baseline->second.first->second->node->getName() << "," << baseline->second.second->second->node->getName() << " leave " << checker->second->node->getName() << " inside the convex hull.");
    161165        sign = tmp;
    162166      }
     
    178182    // 5. come this far, all on same side? Then break 1. loop and construct triangle
    179183    if (checker == PointsOnBoundary.end()) {
    180       DoLog(2) && (Log() << Verbose(2) << "Looks like we have a candidate!" << endl);
     184      LOG(2, "Looks like we have a candidate!");
    181185      break;
    182186    }
     
    202206    }
    203207
    204     DoLog(1) && (Log() << Verbose(1) << "Starting triangle is " << *BTS << "." << endl);
     208    LOG(1, "Starting triangle is " << *BTS << ".");
    205209  } else {
    206     DoeLog(0) && (eLog() << Verbose(0) << "No starting triangle found." << endl);
     210    ELOG(0, "No starting triangle found.");
    207211  }
    208212}
     
    243247        // get peak point with respect to this base line's only triangle
    244248        BTS = baseline->second->triangles.begin()->second; // there is only one triangle so far
    245         DoLog(0) && (Log() << Verbose(0) << "Current baseline is between " << *(baseline->second) << "." << endl);
     249        LOG(0, "Current baseline is between " << *(baseline->second) << ".");
    246250        for (int i = 0; i < 3; i++)
    247251          if ((BTS->endpoints[i] != baseline->second->endpoints[0]) && (BTS->endpoints[i] != baseline->second->endpoints[1]))
    248252            peak = BTS->endpoints[i];
    249         DoLog(1) && (Log() << Verbose(1) << " and has peak " << *peak << "." << endl);
     253        LOG(1, " and has peak " << *peak << ".");
    250254
    251255        // prepare some auxiliary vectors
     
    260264          CenterVector += BTS->getEndpoint(i);
    261265        CenterVector.Scale(1. / 3.);
    262         DoLog(2) && (Log() << Verbose(2) << "CenterVector of base triangle is " << CenterVector << endl);
     266        LOG(2, "CenterVector of base triangle is " << CenterVector);
    263267
    264268        // normal vector of triangle
     
    266270        BTS->GetNormalVector(NormalVector);
    267271        NormalVector = BTS->NormalVector;
    268         DoLog(2) && (Log() << Verbose(2) << "NormalVector of base triangle is " << NormalVector << endl);
     272        LOG(2, "NormalVector of base triangle is " << NormalVector);
    269273
    270274        // vector in propagation direction (out of triangle)
     
    272276        PropagationVector = Plane(BaseLine, NormalVector,0).getNormal();
    273277        TempVector = CenterVector - (baseline->second->endpoints[0]->node->getPosition()); // TempVector is vector on triangle plane pointing from one baseline egde towards center!
    274         //Log() << Verbose(0) << "Projection of propagation onto temp: " << PropagationVector.Projection(&TempVector) << "." << endl;
     278        //LOG(0, "Projection of propagation onto temp: " << PropagationVector.Projection(&TempVector) << ".");
    275279        if (PropagationVector.ScalarProduct(TempVector) > 0) // make sure normal propagation vector points outward from baseline
    276280          PropagationVector.Scale(-1.);
    277         DoLog(2) && (Log() << Verbose(2) << "PropagationVector of base triangle is " << PropagationVector << endl);
     281        LOG(2, "PropagationVector of base triangle is " << PropagationVector);
    278282        winner = PointsOnBoundary.end();
    279283
     
    281285        for (PointMap::iterator target = PointsOnBoundary.begin(); target != PointsOnBoundary.end(); target++) {
    282286          if ((target->second != baseline->second->endpoints[0]) && (target->second != baseline->second->endpoints[1])) { // don't take the same endpoints
    283             DoLog(1) && (Log() << Verbose(1) << "Target point is " << *(target->second) << ":" << endl);
     287            LOG(1, "Target point is " << *(target->second) << ":");
    284288
    285289            // first check direction, so that triangles don't intersect
     
    287291            VirtualNormalVector.ProjectOntoPlane(NormalVector);
    288292            TempAngle = VirtualNormalVector.Angle(PropagationVector);
    289             DoLog(2) && (Log() << Verbose(2) << "VirtualNormalVector is " << VirtualNormalVector << " and PropagationVector is " << PropagationVector << "." << endl);
     293            LOG(2, "VirtualNormalVector is " << VirtualNormalVector << " and PropagationVector is " << PropagationVector << ".");
    290294            if (TempAngle > (M_PI / 2.)) { // no bends bigger than Pi/2 (90 degrees)
    291               DoLog(2) && (Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", bad direction!" << endl);
     295              LOG(2, "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", bad direction!");
    292296              continue;
    293297            } else
    294               DoLog(2) && (Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", good direction!" << endl);
     298              LOG(2, "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", good direction!");
    295299
    296300            // check first and second endpoint (if any connecting line goes to target has at least not more than 1 triangle)
     
    298302            LineChecker[1] = baseline->second->endpoints[1]->lines.find(target->first);
    299303            if (((LineChecker[0] != baseline->second->endpoints[0]->lines.end()) && (LineChecker[0]->second->triangles.size() == 2))) {
    300               DoLog(2) && (Log() << Verbose(2) << *(baseline->second->endpoints[0]) << " has line " << *(LineChecker[0]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[0]->second->triangles.size() << " triangles." << endl);
     304              LOG(2, *(baseline->second->endpoints[0]) << " has line " << *(LineChecker[0]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[0]->second->triangles.size() << " triangles.");
    301305              continue;
    302306            }
    303307            if (((LineChecker[1] != baseline->second->endpoints[1]->lines.end()) && (LineChecker[1]->second->triangles.size() == 2))) {
    304               DoLog(2) && (Log() << Verbose(2) << *(baseline->second->endpoints[1]) << " has line " << *(LineChecker[1]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[1]->second->triangles.size() << " triangles." << endl);
     308              LOG(2, *(baseline->second->endpoints[1]) << " has line " << *(LineChecker[1]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[1]->second->triangles.size() << " triangles.");
    305309              continue;
    306310            }
     
    308312            // check whether the envisaged triangle does not already exist (if both lines exist and have same endpoint)
    309313            if ((((LineChecker[0] != baseline->second->endpoints[0]->lines.end()) && (LineChecker[1] != baseline->second->endpoints[1]->lines.end()) && (GetCommonEndpoint(LineChecker[0]->second, LineChecker[1]->second) == peak)))) {
    310               DoLog(4) && (Log() << Verbose(4) << "Current target is peak!" << endl);
     314              LOG(4, "Current target is peak!");
    311315              continue;
    312316            }
     
    317321            helper.ProjectOntoPlane(TempVector);
    318322            if (fabs(helper.NormSquared()) < MYEPSILON) {
    319               DoLog(2) && (Log() << Verbose(2) << "Chosen set of vectors is linear dependent." << endl);
     323              LOG(2, "Chosen set of vectors is linear dependent.");
    320324              continue;
    321325            }
     
    335339            // calculate angle
    336340            TempAngle = NormalVector.Angle(VirtualNormalVector);
    337             DoLog(2) && (Log() << Verbose(2) << "NormalVector is " << VirtualNormalVector << " and the angle is " << TempAngle << "." << endl);
     341            LOG(2, "NormalVector is " << VirtualNormalVector << " and the angle is " << TempAngle << ".");
    338342            if ((SmallestAngle - TempAngle) > MYEPSILON) { // set to new possible winner
    339343              SmallestAngle = TempAngle;
    340344              winner = target;
    341               DoLog(2) && (Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl);
     345              LOG(2, "New winner " << *winner->second->node << " due to smaller angle between normal vectors.");
    342346            } else if (fabs(SmallestAngle - TempAngle) < MYEPSILON) { // check the angle to propagation, both possible targets are in one plane! (their normals have same angle)
    343347              // hence, check the angles to some normal direction from our base line but in this common plane of both targets...
     
    354358                SmallestAngle = TempAngle;
    355359                winner = target;
    356                 DoLog(2) && (Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle " << TempAngle << " to propagation direction." << endl);
     360                LOG(2, "New winner " << *winner->second->node << " due to smaller angle " << TempAngle << " to propagation direction.");
    357361              } else
    358                 DoLog(2) && (Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle to propagation direction." << endl);
     362                LOG(2, "Keeping old winner " << *winner->second->node << " due to smaller angle to propagation direction.");
    359363            } else
    360               DoLog(2) && (Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl);
     364              LOG(2, "Keeping old winner " << *winner->second->node << " due to smaller angle between normal vectors.");
    361365          }
    362366        } // end of loop over all boundary points
     
    364368        // 5b. The point of the above whose triangle has the greatest angle with the triangle the current line belongs to (it only belongs to one, remember!): New triangle
    365369        if (winner != PointsOnBoundary.end()) {
    366           DoLog(0) && (Log() << Verbose(0) << "Winning target point is " << *(winner->second) << " with angle " << SmallestAngle << "." << endl);
     370          LOG(0, "Winning target point is " << *(winner->second) << " with angle " << SmallestAngle << ".");
    367371          // create the lins of not yet present
    368372          BLS[0] = baseline->second;
     
    394398          TrianglesOnBoundaryCount++;
    395399        } else {
    396           DoeLog(2) && (eLog() << Verbose(2) << "I could not determine a winner for this baseline " << *(baseline->second) << "." << endl);
     400          ELOG(2, "I could not determine a winner for this baseline " << *(baseline->second) << ".");
    397401        }
    398402
    399403        // 5d. If the set of lines is not yet empty, go to 5. and continue
    400404      } else
    401         DoLog(0) && (Log() << Verbose(0) << "Baseline candidate " << *(baseline->second) << " has a triangle count of " << baseline->second->triangles.size() << "." << endl);
     405        LOG(0, "Baseline candidate " << *(baseline->second) << " has a triangle count of " << baseline->second->triangles.size() << ".");
    402406  } while (flag);
    403407
     
    434438    }
    435439    Walker = cloud.GetPoint();
    436     DoLog(0) && (Log() << Verbose(0) << "Current point is " << *Walker << "." << endl);
     440    LOG(0, "Current point is " << *Walker << ".");
    437441    // get the next triangle
    438442    triangles = FindClosestTrianglesToVector(Walker->getPosition(), BoundaryPoints);
     
    443447    delete triangles;
    444448    if ((BTS == NULL) || (BTS->ContainsBoundaryPoint(Walker))) {
    445       DoLog(0) && (Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl);
     449      LOG(0, "No triangles found, probably a tesselation point itself.");
    446450      cloud.GoToNext();
    447451      continue;
    448452    } else {
    449453    }
    450     DoLog(0) && (Log() << Verbose(0) << "Closest triangle is " << *BTS << "." << endl);
     454    LOG(0, "Closest triangle is " << *BTS << ".");
    451455    // get the intersection point
    452456    if (BTS->GetIntersectionInsideTriangle(*Center, Walker->getPosition(), Intersection)) {
    453       DoLog(0) && (Log() << Verbose(0) << "We have an intersection at " << Intersection << "." << endl);
     457      LOG(0, "We have an intersection at " << Intersection << ".");
    454458      // we have the intersection, check whether in- or outside of boundary
    455459      if ((Center->DistanceSquared(Walker->getPosition()) - Center->DistanceSquared(Intersection)) < -MYEPSILON) {
    456460        // inside, next!
    457         DoLog(0) && (Log() << Verbose(0) << *Walker << " is inside wrt triangle " << *BTS << "." << endl);
     461        LOG(0, *Walker << " is inside wrt triangle " << *BTS << ".");
    458462      } else {
    459463        // outside!
    460         DoLog(0) && (Log() << Verbose(0) << *Walker << " is outside wrt triangle " << *BTS << "." << endl);
     464        LOG(0, *Walker << " is outside wrt triangle " << *BTS << ".");
    461465        class BoundaryLineSet *OldLines[3], *NewLines[3];
    462466        class BoundaryPointSet *OldPoints[3], *NewPoint;
     
    468472        Normal = BTS->NormalVector;
    469473        // add Walker to boundary points
    470         DoLog(0) && (Log() << Verbose(0) << "Adding " << *Walker << " to BoundaryPoints." << endl);
     474        LOG(0, "Adding " << *Walker << " to BoundaryPoints.");
    471475        AddFlag = true;
    472476        if (AddBoundaryPoint(Walker, 0))
     
    475479          continue;
    476480        // remove triangle
    477         DoLog(0) && (Log() << Verbose(0) << "Erasing triangle " << *BTS << "." << endl);
     481        LOG(0, "Erasing triangle " << *BTS << ".");
    478482        TrianglesOnBoundary.erase(BTS->Nr);
    479483        delete (BTS);
     
    483487          BPS[1] = OldPoints[i];
    484488          NewLines[i] = new class BoundaryLineSet(BPS, LinesOnBoundaryCount);
    485           DoLog(1) && (Log() << Verbose(1) << "Creating new line " << *NewLines[i] << "." << endl);
     489          LOG(1, "Creating new line " << *NewLines[i] << ".");
    486490          LinesOnBoundary.insert(LinePair(LinesOnBoundaryCount, NewLines[i])); // no need for check for unique insertion as BPS[0] is definitely a new one
    487491          LinesOnBoundaryCount++;
     
    494498            if (NewLines[j]->IsConnectedTo(BLS[0])) {
    495499              if (n > 2) {
    496                 DoeLog(2) && (eLog() << Verbose(2) << BLS[0] << " connects to all of the new lines?!" << endl);
     500                ELOG(2, BLS[0] << " connects to all of the new lines?!");
    497501                return false;
    498502              } else
     
    505509          BTS->GetNormalVector(Normal);
    506510          Normal.Scale(-1.);
    507           DoLog(0) && (Log() << Verbose(0) << "Created new triangle " << *BTS << "." << endl);
     511          LOG(0, "Created new triangle " << *BTS << ".");
    508512          TrianglesOnBoundary.insert(TrianglePair(TrianglesOnBoundaryCount, BTS));
    509513          TrianglesOnBoundaryCount++;
     
    511515      }
    512516    } else { // something is wrong with FindClosestTriangleToPoint!
    513       DoeLog(1) && (eLog() << Verbose(1) << "The closest triangle did not produce an intersection!" << endl);
     517      ELOG(1, "The closest triangle did not produce an intersection!");
    514518      SuccessFlag = false;
    515519      break;
     
    562566  } else {
    563567    delete TPS[n];
    564     DoLog(0) && (Log() << Verbose(0) << "Node " << *((InsertUnique.first)->second->node) << " is already present in PointsOnBoundary." << endl);
     568    LOG(0, "Node " << *((InsertUnique.first)->second->node) << " is already present in PointsOnBoundary.");
    565569    TPS[n] = (InsertUnique.first)->second;
    566570  }
     
    599603  BoundaryLineSet *WinningLine = NULL;
    600604  if (FindLine != a->lines.end()) {
    601     DoLog(1) && (Log() << Verbose(1) << "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << "." << endl);
     605    LOG(1, "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << ".");
    602606
    603607    pair<LineMap::iterator, LineMap::iterator> FindPair;
     
    605609
    606610    for (FindLine = FindPair.first; (FindLine != FindPair.second) && (insertNewLine); FindLine++) {
    607       DoLog(1) && (Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl);
     611      LOG(1, "INFO: Checking line " << *(FindLine->second) << " ...");
    608612      // If there is a line with less than two attached triangles, we don't need a new line.
    609613      if (FindLine->second->triangles.size() == 1) {
    610614        CandidateMap::iterator Finder = OpenLines.find(FindLine->second);
    611615        if (!Finder->second->pointlist.empty())
    612           DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl);
     616          LOG(1, "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << ".");
    613617        else
    614           DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate." << endl);
     618          LOG(1, "INFO: line " << *(FindLine->second) << " is open with no candidate.");
    615619        // get open line
    616620        for (TesselPointList::const_iterator CandidateChecker = Finder->second->pointlist.begin(); CandidateChecker != Finder->second->pointlist.end(); ++CandidateChecker) {
    617621          if ((*(CandidateChecker) == candidate->node) && (OptCenter == NULL || OptCenter->DistanceSquared(Finder->second->OptCenter) < MYEPSILON )) { // stop searching if candidate matches
    618             DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Candidate " << *(*CandidateChecker) << " has the right center " << Finder->second->OptCenter << "." << endl);
     622            LOG(1, "ACCEPT: Candidate " << *(*CandidateChecker) << " has the right center " << Finder->second->OptCenter << ".");
    619623            insertNewLine = false;
    620624            WinningLine = FindLine->second;
    621625            break;
    622626          } else {
    623             DoLog(1) && (Log() << Verbose(1) << "REJECT: Candidate " << *(*CandidateChecker) << "'s center " << Finder->second->OptCenter << " does not match desired on " << *OptCenter << "." << endl);
     627            LOG(1, "REJECT: Candidate " << *(*CandidateChecker) << "'s center " << Finder->second->OptCenter << " does not match desired on " << *OptCenter << ".");
    624628          }
    625629        }
     
    647651{
    648652  Info FunctionInfo(__func__);
    649   DoLog(0) && (Log() << Verbose(0) << "Adding open line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << "." << endl);
     653  LOG(0, "Adding open line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << ".");
    650654  BPS[0] = a;
    651655  BPS[1] = b;
     
    669673{
    670674  Info FunctionInfo(__func__);
    671   DoLog(0) && (Log() << Verbose(0) << "Using existing line " << *Line << endl);
     675  LOG(0, "Using existing line " << *Line);
    672676
    673677  // set endpoints and line
     
    678682  CandidateMap::iterator CandidateLine = OpenLines.find(BLS[n]);
    679683  if (CandidateLine != OpenLines.end()) {
    680     DoLog(1) && (Log() << Verbose(1) << " Removing line from OpenLines." << endl);
     684    LOG(1, " Removing line from OpenLines.");
    681685    delete (CandidateLine->second);
    682686    OpenLines.erase(CandidateLine);
    683687  } else {
    684     DoeLog(1) && (eLog() << Verbose(1) << "Line exists and is attached to less than two triangles, but not in OpenLines!" << endl);
     688    ELOG(1, "Line exists and is attached to less than two triangles, but not in OpenLines!");
    685689  }
    686690}
     
    693697{
    694698  Info FunctionInfo(__func__);
    695   DoLog(1) && (Log() << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl);
     699  LOG(1, "Adding triangle to global TrianglesOnBoundary map.");
    696700
    697701  // add triangle to global map
     
    713717{
    714718  Info FunctionInfo(__func__);
    715   DoLog(0) && (Log() << Verbose(0) << "Adding triangle to global TrianglesOnBoundary map." << endl);
     719  LOG(0, "Adding triangle to global TrianglesOnBoundary map.");
    716720
    717721  // add triangle to global map
     
    737741  for (int i = 0; i < 3; i++) {
    738742    if (triangle->lines[i] != NULL) {
    739       DoLog(0) && (Log() << Verbose(0) << "Removing triangle Nr." << triangle->Nr << " in line " << *triangle->lines[i] << "." << endl);
     743      LOG(0, "Removing triangle Nr." << triangle->Nr << " in line " << *triangle->lines[i] << ".");
    740744      triangle->lines[i]->triangles.erase(triangle->Nr);
     745      std::stringstream output;
     746      output << "INFO: " << *triangle->lines[i] << " is ";
    741747      if (triangle->lines[i]->triangles.empty()) {
    742         DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is no more attached to any triangle, erasing." << endl);
     748        output << "no more attached to any triangle, erasing.";
    743749        RemoveTesselationLine(triangle->lines[i]);
    744750      } else {
    745         DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is still attached to another triangle: " << endl);
     751        output << "still attached to another triangle: ";
    746752        OpenLines.insert(pair<BoundaryLineSet *, CandidateForTesselation *> (triangle->lines[i], NULL));
    747753        for (TriangleMap::iterator TriangleRunner = triangle->lines[i]->triangles.begin(); TriangleRunner != triangle->lines[i]->triangles.end(); TriangleRunner++)
    748           DoLog(0) && (Log() << Verbose(0) << "\t[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t");
    749         DoLog(0) && (Log() << Verbose(0) << endl);
    750         //        for (int j=0;j<2;j++) {
    751         //          Log() << Verbose(0) << "Lines of endpoint " << *(triangle->lines[i]->endpoints[j]) << ": ";
    752         //          for(LineMap::iterator LineRunner = triangle->lines[i]->endpoints[j]->lines.begin(); LineRunner != triangle->lines[i]->endpoints[j]->lines.end(); LineRunner++)
    753         //            Log() << Verbose(0) << "[" << *(LineRunner->second) << "] \t";
    754         //          Log() << Verbose(0) << endl;
    755         //        }
     754          output << "\t[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t";
    756755      }
     756      LOG(1, output.str());
    757757      triangle->lines[i] = NULL; // free'd or not: disconnect
    758758    } else
    759       DoeLog(1) && (eLog() << Verbose(1) << "This line " << i << " has already been free'd." << endl);
     759      ELOG(1, "This line " << i << " has already been free'd.");
    760760  }
    761761
    762762  if (TrianglesOnBoundary.erase(triangle->Nr))
    763     DoLog(0) && (Log() << Verbose(0) << "Removing triangle Nr. " << triangle->Nr << "." << endl);
     763    LOG(0, "Removing triangle Nr. " << triangle->Nr << ".");
    764764  delete (triangle);
    765765}
     
    793793        for (LineMap::iterator Runner = erasor.first; Runner != erasor.second; Runner++)
    794794          if ((*Runner).second == line) {
    795             DoLog(0) && (Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl);
     795            LOG(0, "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << ".");
    796796            line->endpoints[i]->lines.erase(Runner);
    797797            break;
     
    799799      } else { // there's just a single line left
    800800        if (line->endpoints[i]->lines.erase(line->Nr))
    801           DoLog(0) && (Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl);
     801          LOG(0, "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << ".");
    802802      }
    803803      if (line->endpoints[i]->lines.empty()) {
    804         DoLog(0) && (Log() << Verbose(0) << *line->endpoints[i] << " has no more lines it's attached to, erasing." << endl);
     804        LOG(0, *line->endpoints[i] << " has no more lines it's attached to, erasing.");
    805805        RemoveTesselationPoint(line->endpoints[i]);
    806       } else {
    807         DoLog(0) && (Log() << Verbose(0) << *line->endpoints[i] << " has still lines it's attached to: ");
     806      } else if (DoLog(0)) {
     807        std::stringstream output;
     808        output << *line->endpoints[i] << " has still lines it's attached to: ";
    808809        for (LineMap::iterator LineRunner = line->endpoints[i]->lines.begin(); LineRunner != line->endpoints[i]->lines.end(); LineRunner++)
    809           DoLog(0) && (Log() << Verbose(0) << "[" << *(LineRunner->second) << "] \t");
    810         DoLog(0) && (Log() << Verbose(0) << endl);
     810          output << "[" << *(LineRunner->second) << "] \t";
     811        LOG(0, output.str());
    811812      }
    812813      line->endpoints[i] = NULL; // free'd or not: disconnect
    813814    } else
    814       DoeLog(1) && (eLog() << Verbose(1) << "Endpoint " << i << " has already been free'd." << endl);
     815      ELOG(1, "Endpoint " << i << " has already been free'd.");
    815816  }
    816817  if (!line->triangles.empty())
    817     DoeLog(2) && (eLog() << Verbose(2) << "Memory Leak! I " << *line << " am still connected to some triangles." << endl);
     818    ELOG(2, "Memory Leak! I " << *line << " am still connected to some triangles.");
    818819
    819820  if (LinesOnBoundary.erase(line->Nr))
    820     DoLog(0) && (Log() << Verbose(0) << "Removing line Nr. " << line->Nr << "." << endl);
     821    LOG(0, "Removing line Nr. " << line->Nr << ".");
    821822  delete (line);
    822823}
     
    834835    return;
    835836  if (PointsOnBoundary.erase(point->Nr))
    836     DoLog(0) && (Log() << Verbose(0) << "Removing point Nr. " << point->Nr << "." << endl);
     837    LOG(0, "Removing point Nr. " << point->Nr << ".");
    837838  delete (point);
    838839}
     
    851852  Info FunctionInfo(__func__);
    852853
    853   DoLog(1) && (Log() << Verbose(1) << "INFO: Checking whether sphere contains no others points ..." << endl);
     854  LOG(1, "INFO: Checking whether sphere contains no others points ...");
    854855  bool flag = true;
    855856
    856   DoLog(1) && (Log() << Verbose(1) << "Check by: draw sphere {" << CandidateLine.OtherOptCenter[0] << " " << CandidateLine.OtherOptCenter[1] << " " << CandidateLine.OtherOptCenter[2] << "} radius " << RADIUS << " resolution 30" << endl);
     857  LOG(1, "Check by: draw sphere {" << CandidateLine.OtherOptCenter[0] << " " << CandidateLine.OtherOptCenter[1] << " " << CandidateLine.OtherOptCenter[2] << "} radius " << RADIUS << " resolution 30");
    857858  // get all points inside the sphere
    858859  TesselPointList *ListofPoints = LC->GetPointsInsideSphere(RADIUS, &CandidateLine.OtherOptCenter);
    859860
    860   DoLog(1) && (Log() << Verbose(1) << "The following atoms are inside sphere at " << CandidateLine.OtherOptCenter << ":" << endl);
     861  LOG(1, "The following atoms are inside sphere at " << CandidateLine.OtherOptCenter << ":");
    861862  for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner)
    862     DoLog(1) && (Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->distance(CandidateLine.OtherOptCenter) << "." << endl);
     863    LOG(1, "  " << *(*Runner) << " with distance " << (*Runner)->distance(CandidateLine.OtherOptCenter) << ".");
    863864
    864865  // remove triangles's endpoints
     
    872873  // check for other points
    873874  if (!ListofPoints->empty()) {
    874     DoLog(1) && (Log() << Verbose(1) << "CheckDegeneracy: There are still " << ListofPoints->size() << " points inside the sphere." << endl);
     875    LOG(1, "CheckDegeneracy: There are still " << ListofPoints->size() << " points inside the sphere.");
    875876    flag = false;
    876     DoLog(1) && (Log() << Verbose(1) << "External atoms inside of sphere at " << CandidateLine.OtherOptCenter << ":" << endl);
     877    LOG(1, "External atoms inside of sphere at " << CandidateLine.OtherOptCenter << ":");
    877878    for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner)
    878       DoLog(1) && (Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->distance(CandidateLine.OtherOptCenter) << "." << endl);
     879      LOG(1, "  " << *(*Runner) << " with distance " << (*Runner)->distance(CandidateLine.OtherOptCenter) << ".");
    879880  }
    880881  delete (ListofPoints);
     
    917918          for (; (FindLine != Points[i]->lines.end()) && (FindLine->first == Points[j]->node->getNr()); FindLine++) {
    918919            TriangleMap *triangles = &FindLine->second->triangles;
    919             DoLog(1) && (Log() << Verbose(1) << "Current line is " << FindLine->first << ": " << *(FindLine->second) << " with triangles " << triangles << "." << endl);
     920            LOG(1, "Current line is " << FindLine->first << ": " << *(FindLine->second) << " with triangles " << triangles << ".");
    920921            for (TriangleMap::const_iterator FindTriangle = triangles->begin(); FindTriangle != triangles->end(); FindTriangle++) {
    921922              if (FindTriangle->second->IsPresentTupel(Points)) {
     
    923924              }
    924925            }
    925             DoLog(1) && (Log() << Verbose(1) << "end." << endl);
     926            LOG(1, "end.");
    926927          }
    927928          // Only one of the triangle lines must be considered for the triangle count.
    928           //Log() << Verbose(0) << "Found " << adjacentTriangleCount << " adjacent triangles for the point set." << endl;
     929          //LOG(0, "Found " << adjacentTriangleCount << " adjacent triangles for the point set.");
    929930          //return adjacentTriangleCount;
    930931        }
     
    933934  }
    934935
    935   DoLog(0) && (Log() << Verbose(0) << "Found " << adjacentTriangleCount << " adjacent triangles for the point set." << endl);
     936  LOG(0, "Found " << adjacentTriangleCount << " adjacent triangles for the point set.");
    936937  return adjacentTriangleCount;
    937938}
     
    978979          }
    979980          // Only one of the triangle lines must be considered for the triangle count.
    980           //Log() << Verbose(0) << "Found " << adjacentTriangleCount << " adjacent triangles for the point set." << endl;
     981          //LOG(0, "Found " << adjacentTriangleCount << " adjacent triangles for the point set.");
    981982          //return adjacentTriangleCount;
    982983        }
     
    10281029      for (LC->n[map[2]] = 0; LC->n[map[2]] < LC->N[map[2]]; LC->n[map[2]]++) {
    10291030        const TesselPointSTLList *List = LC->GetCurrentCell();
    1030         //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
     1031        //LOG(1, "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << ".");
    10311032        if (List != NULL) {
    10321033          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    10331034            if ((*Runner)->at(map[0]) > maxCoordinate[map[0]]) {
    1034               DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << map[0] << " node is " << *(*Runner) << " at " << (*Runner)->getPosition() << "." << endl);
     1035              LOG(1, "New maximal for axis " << map[0] << " node is " << *(*Runner) << " at " << (*Runner)->getPosition() << ".");
    10351036              maxCoordinate[map[0]] = (*Runner)->at(map[0]);
    10361037              MaxPoint[map[0]] = (*Runner);
     
    10381039          }
    10391040        } else {
    1040           DoeLog(1) && (eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl);
     1041          ELOG(1, "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!");
    10411042        }
    10421043      }
    10431044  }
    10441045
    1045   DoLog(1) && (Log() << Verbose(1) << "Found maximum coordinates: ");
    1046   for (int i = 0; i < NDIM; i++)
    1047     DoLog(0) && (Log() << Verbose(0) << i << ": " << *MaxPoint[i] << "\t");
    1048   DoLog(0) && (Log() << Verbose(0) << endl);
     1046  if (DoLog(1)) {
     1047    std::stringstream output;
     1048    output << "Found maximum coordinates: ";
     1049    for (int i = 0; i < NDIM; i++)
     1050      output << i << ": " << *MaxPoint[i] << "\t";
     1051    LOG(1, output.str());
     1052  }
    10491053
    10501054  BTS = NULL;
     
    10541058    BaseLine = new BoundaryLineSet();
    10551059    BaseLine->endpoints[0] = new BoundaryPointSet(MaxPoint[k]);
    1056     DoLog(0) && (Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl);
     1060    LOG(0, "Coordinates of start node at " << *BaseLine->endpoints[0]->node << ".");
    10571061
    10581062    double ShortestAngle;
     
    10881092
    10891093    // adding point 1 and point 2 and add the line between them
    1090     DoLog(0) && (Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl);
    1091     DoLog(0) && (Log() << Verbose(0) << "Found second point is at " << *BaseLine->endpoints[1]->node << ".\n");
    1092 
    1093     //Log() << Verbose(1) << "INFO: OldSphereCenter is at " << helper << ".\n";
     1094    LOG(0, "Coordinates of start node at " << *BaseLine->endpoints[0]->node << ".");
     1095    LOG(0, "Found second point is at " << *BaseLine->endpoints[1]->node << ".");
     1096
     1097    //LOG(1, "INFO: OldSphereCenter is at " << helper << ".");
    10941098    CandidateForTesselation OptCandidates(BaseLine);
    10951099    FindThirdPointForTesselation(NormalVector, SearchDirection, SphereCenter, OptCandidates, NULL, RADIUS, LC);
    1096     DoLog(0) && (Log() << Verbose(0) << "List of third Points is:" << endl);
     1100    LOG(0, "List of third Points is:");
    10971101    for (TesselPointList::iterator it = OptCandidates.pointlist.begin(); it != OptCandidates.pointlist.end(); it++) {
    1098       DoLog(0) && (Log() << Verbose(0) << " " << *(*it) << endl);
     1102      LOG(0, " " << *(*it));
    10991103    }
    11001104    if (!OptCandidates.pointlist.empty()) {
     
    11501154//      if (FindLine != (FindPoint->second)->lines.end()) {
    11511155//        Line = FindLine->second;
    1152 //        Log() << Verbose(0) << "Found line " << *Line << "." << endl;
     1156//        LOG(0, "Found line " << *Line << ".");
    11531157//        if (Line->triangles.size() == 1) {
    11541158//          T = Line->triangles.begin()->second;
     
    11671171//            CircleRadius = RADIUS*RADIUS - radius/4.;
    11681172//            CirclePlaneNormal.Normalize();
    1169 //            //Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
     1173//            //LOG(1, "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << ".");
    11701174//
    11711175//            // construct old center
     
    11761180//            OldSphereCenter.AddVector(&helper);
    11771181//            OldSphereCenter.SubtractVector(&CircleCenter);
    1178 //            //Log() << Verbose(1) << "INFO: OldSphereCenter is at " << OldSphereCenter << "." << endl;
     1182//            //LOG(1, "INFO: OldSphereCenter is at " << OldSphereCenter << ".");
    11791183//
    11801184//            // construct SearchDirection
     
    11861190//            SearchDirection.ProjectOntoPlane(&OldSphereCenter);
    11871191//            SearchDirection.Normalize();
    1188 //            Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
     1192//            LOG(1, "INFO: SearchDirection is " << SearchDirection << ".");
    11891193//            if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {
    11901194//              // rotated the wrong way!
    1191 //              DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl);
     1195//              ELOG(1, "SearchDirection and RelativeOldSphereCenter are still not orthogonal!");
    11921196//            }
    11931197//
     
    11971201//              if (((*it) == BaseRay->endpoints[0]->node) || ((*it) == BaseRay->endpoints[1]->node)) // skip if it's the same triangle than suggested
    11981202//                continue;
    1199 //              Log() << Verbose(0) << " Third point candidate is " << (*it)
    1200 //              << " with circumsphere's center at " << (*it)->OptCenter << "." << endl;
    1201 //              Log() << Verbose(0) << " Baseline is " << *BaseRay << endl;
     1203//              LOG(1, "INFO: Third point candidate is " << (*it)
     1204//              << " with circumsphere's center at " << (*it)->OptCenter << ".");
     1205//              LOG(1, "INFO: Baseline is " << *BaseRay);
    12021206//
    12031207//              // check whether all edges of the new triangle still have space for one more triangle (i.e. TriangleCount <2)
     
    12331237//              if (check) {
    12341238//                if (ShortestAngle > OtherShortestAngle) {
    1235 //                  Log() << Verbose(0) << "There is a better candidate than " << *ThirdNode << " with " << ShortestAngle << " from baseline " << *Line << ": " << *OtherOptCandidate << " with " << OtherShortestAngle << "." << endl;
     1239//                  LOG(0, "There is a better candidate than " << *ThirdNode << " with " << ShortestAngle << " from baseline " << *Line << ": " << *OtherOptCandidate << " with " << OtherShortestAngle << ".");
    12361240//                  result = true;
    12371241//                  break;
     
    12431247//              break;
    12441248//          } else {
    1245 //            Log() << Verbose(0) << "Circumcircle for base line " << *Line << " and base triangle " << T << " is too big!" << endl;
     1249//            LOG(0, "Circumcircle for base line " << *Line << " and base triangle " << T << " is too big!");
    12461250//          }
    12471251//        } else {
    1248 //          DoeLog(2) && (eLog()<< Verbose(2) << "Baseline is connected to two triangles already?" << endl);
     1252//          ELOG(2, "Baseline is connected to two triangles already?");
    12491253//        }
    12501254//      } else {
    1251 //        Log() << Verbose(1) << "No present baseline between " << BaseRay->endpoints[0] << " and candidate " << *ThirdNode << "." << endl;
     1255//        LOG(1, "No present baseline between " << BaseRay->endpoints[0] << " and candidate " << *ThirdNode << ".");
    12521256//      }
    12531257//    }
    12541258//  } else {
    1255 //    DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the TesselPoint " << *ThirdNode << "." << endl);
     1259//    ELOG(1, "Could not find the TesselPoint " << *ThirdNode << ".");
    12561260//  }
    12571261//
     
    12841288      break;
    12851289    }
    1286   DoLog(0) && (Log() << Verbose(0) << "Current baseline is " << *CandidateLine.BaseLine << " with ThirdPoint " << *ThirdPoint << " of triangle " << T << "." << endl);
     1290  LOG(0, "Current baseline is " << *CandidateLine.BaseLine << " with ThirdPoint " << *ThirdPoint << " of triangle " << T << ".");
    12871291
    12881292  CandidateLine.T = &T;
     
    13041308    CircleRadius = RADIUS * RADIUS - radius / 4.;
    13051309    CirclePlaneNormal.Normalize();
    1306     DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl);
    1307 
    1308     DoLog(1) && (Log() << Verbose(1) << "INFO: OldSphereCenter is at " << T.SphereCenter << "." << endl);
     1310    LOG(1, "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << ".");
     1311
     1312    LOG(1, "INFO: OldSphereCenter is at " << T.SphereCenter << ".");
    13091313
    13101314    // construct SearchDirection and an "outward pointer"
     
    13131317    if (helper.ScalarProduct(SearchDirection) < -HULLEPSILON)// ohoh, SearchDirection points inwards!
    13141318      SearchDirection.Scale(-1.);
    1315     DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl);
     1319    LOG(1, "INFO: SearchDirection is " << SearchDirection << ".");
    13161320    if (fabs(RelativeSphereCenter.ScalarProduct(SearchDirection)) > HULLEPSILON) {
    13171321      // rotated the wrong way!
    1318       DoeLog(1) && (eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl);
     1322      ELOG(1, "SearchDirection and RelativeOldSphereCenter are still not orthogonal!");
    13191323    }
    13201324
     
    13231327
    13241328  } else {
    1325     DoLog(0) && (Log() << Verbose(0) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and base triangle " << T << " is too big!" << endl);
     1329    LOG(0, "Circumcircle for base line " << *CandidateLine.BaseLine << " and base triangle " << T << " is too big!");
    13261330  }
    13271331
    13281332  if (CandidateLine.pointlist.empty()) {
    1329     DoeLog(2) && (eLog() << Verbose(2) << "Could not find a suitable candidate." << endl);
     1333    ELOG(2, "Could not find a suitable candidate.");
    13301334    return false;
    13311335  }
    1332   DoLog(0) && (Log() << Verbose(0) << "Third Points are: " << endl);
     1336  LOG(0, "Third Points are: ");
    13331337  for (TesselPointList::iterator it = CandidateLine.pointlist.begin(); it != CandidateLine.pointlist.end(); ++it) {
    1334     DoLog(0) && (Log() << Verbose(0) << " " << *(*it) << endl);
     1338    LOG(0, " " << *(*it));
    13351339  }
    13361340
     
    13561360      ASSERT((baseline->BaseLine->triangles.size() == 1),"Open line without exactly one attached triangle");
    13571361      T = (((baseline->BaseLine->triangles.begin()))->second);
    1358       DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl);
     1362      LOG(1, "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T);
    13591363      TesselationFailFlag = TesselationFailFlag && FindNextSuitableTriangle(*baseline, *T, RADIUS, LCList); //the line is there, so there is a triangle, but only one.
    13601364    }
     
    13871391  TesselPointList *connectedClosestPoints = GetCircleOfSetOfPoints(&SetOfNeighbours, TurningPoint, CandidateLine.BaseLine->endpoints[1]->node->getPosition());
    13881392
    1389   DoLog(0) && (Log() << Verbose(0) << "List of Candidates for Turning Point " << *TurningPoint << ":" << endl);
     1393  LOG(0, "List of Candidates for Turning Point " << *TurningPoint << ":");
    13901394  for (TesselPointList::iterator TesselRunner = connectedClosestPoints->begin(); TesselRunner != connectedClosestPoints->end(); ++TesselRunner)
    1391     DoLog(0) && (Log() << Verbose(0) << " " << **TesselRunner << endl);
     1395    LOG(0, " " << **TesselRunner);
    13921396
    13931397  // go through all angle-sorted candidates (in degenerate n-nodes case we may have to add multiple triangles)
     
    13961400  Sprinter++;
    13971401  while (Sprinter != connectedClosestPoints->end()) {
    1398     DoLog(0) && (Log() << Verbose(0) << "Current Runner is " << *(*Runner) << " and sprinter is " << *(*Sprinter) << "." << endl);
     1402    LOG(0, "Current Runner is " << *(*Runner) << " and sprinter is " << *(*Sprinter) << ".");
    13991403
    14001404    AddTesselationPoint(TurningPoint, 0);
     
    14091413      // fill the internal open lines with its respective candidate (otherwise lines in degenerate case are not picked)
    14101414      FindDegeneratedCandidatesforOpenLines(*Sprinter, &CandidateLine.OptCenter); // Assume BTS contains last triangle
    1411       DoLog(0) && (Log() << Verbose(0) << " There are still more triangles to add." << endl);
     1415      LOG(0, " There are still more triangles to add.");
    14121416    }
    14131417    // pick candidates for other open lines as well
     
    14171421    if (CheckDegeneracy(CandidateLine, RADIUS, LC)) {
    14181422      // add normal and degenerate triangles
    1419       DoLog(1) && (Log() << Verbose(1) << "Triangle of endpoints " << *TPS[0] << "," << *TPS[1] << " and " << *TPS[2] << " is degenerated, adding both sides." << endl);
     1423      LOG(1, "Triangle of endpoints " << *TPS[0] << "," << *TPS[1] << " and " << *TPS[2] << " is degenerated, adding both sides.");
    14201424      AddCandidateTriangle(CandidateLine, OtherOpt);
    14211425
     
    14411445  pair<LineMap::iterator, LineMap::iterator> FindPair = TPS[0]->lines.equal_range(TPS[2]->node->getNr());
    14421446  for (LineMap::const_iterator FindLine = FindPair.first; FindLine != FindPair.second; FindLine++) {
    1443     DoLog(1) && (Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl);
     1447    LOG(1, "INFO: Checking line " << *(FindLine->second) << " ...");
    14441448    // If there is a line with less than two attached triangles, we don't need a new line.
    14451449    if (FindLine->second->triangles.size() == 1) {
    14461450      CandidateMap::iterator Finder = OpenLines.find(FindLine->second);
    14471451      if (!Finder->second->pointlist.empty())
    1448         DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl);
     1452        LOG(1, "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << ".");
    14491453      else {
    1450         DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate, setting to next Sprinter" << (*Sprinter) << endl);
     1454        LOG(1, "INFO: line " << *(FindLine->second) << " is open with no candidate, setting to next Sprinter" << (*Sprinter));
    14511455        Finder->second->T = BTS;  // is last triangle
    14521456        Finder->second->pointlist.push_back(Sprinter);
     
    14731477
    14741478  /// 1. Create or pick the lines for the first triangle
    1475   DoLog(0) && (Log() << Verbose(0) << "INFO: Creating/Picking lines for first triangle ..." << endl);
     1479  LOG(0, "INFO: Creating/Picking lines for first triangle ...");
    14761480  for (int i = 0; i < 3; i++) {
    14771481    BLS[i] = NULL;
    1478     DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
     1482    LOG(0, "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":");
    14791483    AddTesselationLine(&CandidateLine.OptCenter, TPS[(i + 2) % 3], TPS[(i + 0) % 3], TPS[(i + 1) % 3], i);
    14801484  }
    14811485
    14821486  /// 2. create the first triangle and NormalVector and so on
    1483   DoLog(0) && (Log() << Verbose(0) << "INFO: Adding first triangle with center at " << CandidateLine.OptCenter << " ..." << endl);
     1487  LOG(0, "INFO: Adding first triangle with center at " << CandidateLine.OptCenter << " ...");
    14841488  BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
    14851489  AddTesselationTriangle();
     
    14921496  // give some verbose output about the whole procedure
    14931497  if (CandidateLine.T != NULL)
    1494     DoLog(0) && (Log() << Verbose(0) << "--> New triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl);
     1498    LOG(0, "--> New triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << ".");
    14951499  else
    1496     DoLog(0) && (Log() << Verbose(0) << "--> New starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl);
     1500    LOG(0, "--> New starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle.");
    14971501  triangle = BTS;
    14981502
    14991503  /// 3. Gather candidates for each new line
    1500   DoLog(0) && (Log() << Verbose(0) << "INFO: Adding candidates to new lines ..." << endl);
     1504  LOG(0, "INFO: Adding candidates to new lines ...");
    15011505  for (int i = 0; i < 3; i++) {
    1502     DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
     1506    LOG(0, "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":");
    15031507    CandidateCheck = OpenLines.find(BLS[i]);
    15041508    if ((CandidateCheck != OpenLines.end()) && (CandidateCheck->second->pointlist.empty())) {
     
    15101514
    15111515  /// 4. Create or pick the lines for the second triangle
    1512   DoLog(0) && (Log() << Verbose(0) << "INFO: Creating/Picking lines for second triangle ..." << endl);
     1516  LOG(0, "INFO: Creating/Picking lines for second triangle ...");
    15131517  for (int i = 0; i < 3; i++) {
    1514     DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
     1518    LOG(0, "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":");
    15151519    AddTesselationLine(&CandidateLine.OtherOptCenter, TPS[(i + 2) % 3], TPS[(i + 0) % 3], TPS[(i + 1) % 3], i);
    15161520  }
    15171521
    15181522  /// 5. create the second triangle and NormalVector and so on
    1519   DoLog(0) && (Log() << Verbose(0) << "INFO: Adding second triangle with center at " << CandidateLine.OtherOptCenter << " ..." << endl);
     1523  LOG(0, "INFO: Adding second triangle with center at " << CandidateLine.OtherOptCenter << " ...");
    15201524  BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
    15211525  AddTesselationTriangle();
     
    15271531  // give some verbose output about the whole procedure
    15281532  if (CandidateLine.T != NULL)
    1529     DoLog(0) && (Log() << Verbose(0) << "--> New degenerate triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl);
     1533    LOG(0, "--> New degenerate triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << ".");
    15301534  else
    1531     DoLog(0) && (Log() << Verbose(0) << "--> New degenerate starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl);
     1535    LOG(0, "--> New degenerate starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle.");
    15321536
    15331537  /// 6. Adding triangle to new lines
    1534   DoLog(0) && (Log() << Verbose(0) << "INFO: Adding second triangles to new lines ..." << endl);
     1538  LOG(0, "INFO: Adding second triangles to new lines ...");
    15351539  for (int i = 0; i < 3; i++) {
    1536     DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
     1540    LOG(0, "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":");
    15371541    CandidateCheck = OpenLines.find(BLS[i]);
    15381542    if ((CandidateCheck != OpenLines.end()) && (CandidateCheck->second->pointlist.empty())) {
     
    15721576  // give some verbose output about the whole procedure
    15731577  if (CandidateLine.T != NULL)
    1574     DoLog(0) && (Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl);
     1578    LOG(0, "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << ".");
    15751579  else
    1576     DoLog(0) && (Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl);
     1580    LOG(0, "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle.");
    15771581}
    15781582;
     
    15991603  OtherBase = new class BoundaryLineSet(BPS, -1);
    16001604
    1601   DoLog(1) && (Log() << Verbose(1) << "INFO: Current base line is " << *Base << "." << endl);
    1602   DoLog(1) && (Log() << Verbose(1) << "INFO: Other base line is " << *OtherBase << "." << endl);
     1605  LOG(1, "INFO: Current base line is " << *Base << ".");
     1606  LOG(1, "INFO: Other base line is " << *OtherBase << ".");
    16031607
    16041608  // get the closest point on each line to the other line
     
    16181622  delete (ClosestPoint);
    16191623  if ((distance[0] * distance[1]) > 0) { // have same sign?
    1620     DoLog(1) && (Log() << Verbose(1) << "REJECT: Both SKPs have same sign: " << distance[0] << " and " << distance[1] << ". " << *Base << "' rectangle is concave." << endl);
     1624    LOG(1, "REJECT: Both SKPs have same sign: " << distance[0] << " and " << distance[1] << ". " << *Base << "' rectangle is concave.");
    16211625    if (distance[0] < distance[1]) {
    16221626      Spot = Base->endpoints[0];
     
    16261630    return Spot;
    16271631  } else { // different sign, i.e. we are in between
    1628     DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Rectangle of triangles of base line " << *Base << " is convex." << endl);
     1632    LOG(0, "ACCEPT: Rectangle of triangles of base line " << *Base << " is convex.");
    16291633    return NULL;
    16301634  }
     
    16371641  Info FunctionInfo(__func__);
    16381642  // print all lines
    1639   DoLog(0) && (Log() << Verbose(0) << "Printing all boundary points for debugging:" << endl);
     1643  LOG(0, "Printing all boundary points for debugging:");
    16401644  for (PointMap::const_iterator PointRunner = PointsOnBoundary.begin(); PointRunner != PointsOnBoundary.end(); PointRunner++)
    1641     DoLog(0) && (Log() << Verbose(0) << *(PointRunner->second) << endl);
     1645    LOG(0, *(PointRunner->second));
    16421646}
    16431647;
     
    16471651  Info FunctionInfo(__func__);
    16481652  // print all lines
    1649   DoLog(0) && (Log() << Verbose(0) << "Printing all boundary lines for debugging:" << endl);
     1653  LOG(0, "Printing all boundary lines for debugging:");
    16501654  for (LineMap::const_iterator LineRunner = LinesOnBoundary.begin(); LineRunner != LinesOnBoundary.end(); LineRunner++)
    1651     DoLog(0) && (Log() << Verbose(0) << *(LineRunner->second) << endl);
     1655    LOG(0, *(LineRunner->second));
    16521656}
    16531657;
     
    16571661  Info FunctionInfo(__func__);
    16581662  // print all triangles
    1659   DoLog(0) && (Log() << Verbose(0) << "Printing all boundary triangles for debugging:" << endl);
     1663  LOG(0, "Printing all boundary triangles for debugging:");
    16601664  for (TriangleMap::const_iterator TriangleRunner = TrianglesOnBoundary.begin(); TriangleRunner != TrianglesOnBoundary.end(); TriangleRunner++)
    1661     DoLog(0) && (Log() << Verbose(0) << *(TriangleRunner->second) << endl);
     1665    LOG(0, *(TriangleRunner->second));
    16621666}
    16631667;
     
    16821686  OtherBase = new class BoundaryLineSet(BPS, -1);
    16831687
    1684   DoLog(0) && (Log() << Verbose(0) << "INFO: Current base line is " << *Base << "." << endl);
    1685   DoLog(0) && (Log() << Verbose(0) << "INFO: Other base line is " << *OtherBase << "." << endl);
     1688  LOG(0, "INFO: Current base line is " << *Base << ".");
     1689  LOG(0, "INFO: Other base line is " << *OtherBase << ".");
    16861690
    16871691  // get the closest point on each line to the other line
     
    17011705
    17021706  if (Distance.NormSquared() < MYEPSILON) { // check for intersection
    1703     DoLog(0) && (Log() << Verbose(0) << "REJECT: Both lines have an intersection: Nothing to do." << endl);
     1707    LOG(0, "REJECT: Both lines have an intersection: Nothing to do.");
    17041708    return false;
    17051709  } else { // check for sign against BaseLineNormal
     
    17071711    BaseLineNormal.Zero();
    17081712    if (Base->triangles.size() < 2) {
    1709       DoeLog(1) && (eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl);
     1713      ELOG(1, "Less than two triangles are attached to this baseline!");
    17101714      return 0.;
    17111715    }
    17121716    for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) {
    1713     DoLog(1) && (Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl);
     1717    LOG(1, "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << ".");
    17141718      BaseLineNormal += (runner->second->NormalVector);
    17151719    }
     
    17171721
    17181722    if (Distance.ScalarProduct(BaseLineNormal) > MYEPSILON) { // Distance points outwards, hence OtherBase higher than Base -> flip
    1719       DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Other base line would be higher: Flipping baseline." << endl);
     1723      LOG(0, "ACCEPT: Other base line would be higher: Flipping baseline.");
    17201724      // calculate volume summand as a general tetraeder
    17211725      return volume;
    17221726    } else { // Base higher than OtherBase -> do nothing
    1723       DoLog(0) && (Log() << Verbose(0) << "REJECT: Base line is higher: Nothing to do." << endl);
     1727      LOG(0, "REJECT: Base line is higher: Nothing to do.");
    17241728      return 0.;
    17251729    }
     
    17471751  BaseLineNormal.Zero();
    17481752  if (Base->triangles.size() < 2) {
    1749     DoeLog(1) && (eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl);
     1753    ELOG(1, "Less than two triangles are attached to this baseline!");
    17501754    return NULL;
    17511755  }
    17521756  for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) {
    1753     DoLog(1) && (Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl);
     1757    LOG(1, "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << ".");
    17541758    BaseLineNormal += (runner->second->NormalVector);
    17551759  }
     
    17641768  i = 0;
    17651769  m = 0;
    1766   DoLog(0) && (Log() << Verbose(0) << "The four old lines are: ");
     1770
     1771  // print OldLines and OldPoints for debugging
     1772  if (DoLog(0)) {
     1773    std::stringstream output;
     1774    output << "The four old lines are: ";
     1775    for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++)
     1776      for (int j = 0; j < 3; j++) // all of their endpoints and baselines
     1777        if (runner->second->lines[j] != Base) // pick not the central baseline
     1778          output << *runner->second->lines[j] << "\t";
     1779    LOG(0, output.str());
     1780  }
     1781  if (DoLog(0)) {
     1782    std::stringstream output;
     1783    output << "The two old points are: ";
     1784    for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++)
     1785      for (int j = 0; j < 3; j++) // all of their endpoints and baselines
     1786        if (!Base->ContainsBoundaryPoint(runner->second->endpoints[j])) // and neither of its endpoints
     1787          output << *runner->second->endpoints[j] << "\t";
     1788    LOG(0, output.str());
     1789  }
     1790
     1791  // index OldLines and OldPoints
    17671792  for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++)
    17681793    for (int j = 0; j < 3; j++) // all of their endpoints and baselines
    1769       if (runner->second->lines[j] != Base) { // pick not the central baseline
     1794      if (runner->second->lines[j] != Base) // pick not the central baseline
    17701795        OldLines[i++] = runner->second->lines[j];
    1771         DoLog(0) && (Log() << Verbose(0) << *runner->second->lines[j] << "\t");
    1772       }
    1773   DoLog(0) && (Log() << Verbose(0) << endl);
    1774   DoLog(0) && (Log() << Verbose(0) << "The two old points are: ");
    17751796  for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++)
    17761797    for (int j = 0; j < 3; j++) // all of their endpoints and baselines
    1777       if (!Base->ContainsBoundaryPoint(runner->second->endpoints[j])) { // and neither of its endpoints
     1798      if (!Base->ContainsBoundaryPoint(runner->second->endpoints[j])) // and neither of its endpoints
    17781799        OldPoints[m++] = runner->second->endpoints[j];
    1779         DoLog(0) && (Log() << Verbose(0) << *runner->second->endpoints[j] << "\t");
    1780       }
    1781   DoLog(0) && (Log() << Verbose(0) << endl);
    17821800
    17831801  // check whether everything is in place to create new lines and triangles
    17841802  if (i < 4) {
    1785     DoeLog(1) && (eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl);
     1803    ELOG(1, "We have not gathered enough baselines!");
    17861804    return NULL;
    17871805  }
    17881806  for (int j = 0; j < 4; j++)
    17891807    if (OldLines[j] == NULL) {
    1790       DoeLog(1) && (eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl);
     1808      ELOG(1, "We have not gathered enough baselines!");
    17911809      return NULL;
    17921810    }
    17931811  for (int j = 0; j < 2; j++)
    17941812    if (OldPoints[j] == NULL) {
    1795       DoeLog(1) && (eLog() << Verbose(1) << "We have not gathered enough endpoints!" << endl);
     1813      ELOG(1, "We have not gathered enough endpoints!");
    17961814      return NULL;
    17971815    }
    17981816
    17991817  // remove triangles and baseline removes itself
    1800   DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting baseline " << *Base << " from global list." << endl);
     1818  LOG(0, "INFO: Deleting baseline " << *Base << " from global list.");
    18011819  OldBaseLineNr = Base->Nr;
    18021820  m = 0;
     
    18071825  // .. then delete each triangle (which deletes the line as well)
    18081826  for (list <BoundaryTriangleSet *>::iterator runner = TrianglesOfBase.begin(); !TrianglesOfBase.empty(); runner = TrianglesOfBase.begin()) {
    1809     DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting triangle " << *(*runner) << "." << endl);
     1827    LOG(0, "INFO: Deleting triangle " << *(*runner) << ".");
    18101828    OldTriangleNrs[m++] = (*runner)->Nr;
    18111829    RemoveTesselationTriangle((*runner));
     
    18181836  NewLine = new class BoundaryLineSet(BPS, OldBaseLineNr);
    18191837  LinesOnBoundary.insert(LinePair(OldBaseLineNr, NewLine)); // no need for check for unique insertion as NewLine is definitely a new one
    1820   DoLog(0) && (Log() << Verbose(0) << "INFO: Created new baseline " << *NewLine << "." << endl);
     1838  LOG(0, "INFO: Created new baseline " << *NewLine << ".");
    18211839
    18221840  // construct new triangles with flipped baseline
     
    18331851    BTS->GetNormalVector(BaseLineNormal);
    18341852    AddTesselationTriangle(OldTriangleNrs[0]);
    1835     DoLog(0) && (Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl);
     1853    LOG(0, "INFO: Created new triangle " << *BTS << ".");
    18361854
    18371855    BLS[0] = (i == 2 ? OldLines[3] : OldLines[2]);
     
    18411859    BTS->GetNormalVector(BaseLineNormal);
    18421860    AddTesselationTriangle(OldTriangleNrs[1]);
    1843     DoLog(0) && (Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl);
     1861    LOG(0, "INFO: Created new triangle " << *BTS << ".");
    18441862  } else {
    1845     DoeLog(0) && (eLog() << Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl);
     1863    ELOG(0, "The four old lines do not connect, something's utterly wrong here!");
    18461864    return NULL;
    18471865  }
     
    18741892      N[i] = LC->n[i];
    18751893  } else {
    1876     DoeLog(1) && (eLog() << Verbose(1) << "Point " << *a << " is not found in cell " << LC->index << "." << endl);
     1894    ELOG(1, "Point " << *a << " is not found in cell " << LC->index << ".");
    18771895    return;
    18781896  }
     
    18821900    Nupper[i] = ((N[i] + 1) < LC->N[i]) ? N[i] + 1 : LC->N[i] - 1;
    18831901  }
    1884   DoLog(0) && (Log() << Verbose(0) << "LC Intervals from [" << N[0] << "<->" << LC->N[0] << ", " << N[1] << "<->" << LC->N[1] << ", " << N[2] << "<->" << LC->N[2] << "] :" << " [" << Nlower[0] << "," << Nupper[0] << "], " << " [" << Nlower[1] << "," << Nupper[1] << "], " << " [" << Nlower[2] << "," << Nupper[2] << "], " << endl);
     1902  LOG(0, "LC Intervals from [" << N[0] << "<->" << LC->N[0] << ", " << N[1] << "<->" << LC->N[1] << ", " << N[2] << "<->" << LC->N[2] << "] :" << " [" << Nlower[0] << "," << Nupper[0] << "], " << " [" << Nlower[1] << "," << Nupper[1] << "], " << " [" << Nlower[2] << "," << Nupper[2] << "], ");
    18851903
    18861904  for (LC->n[0] = Nlower[0]; LC->n[0] <= Nupper[0]; LC->n[0]++)
     
    18881906      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    18891907        const TesselPointSTLList *List = LC->GetCurrentCell();
    1890         //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
     1908        //LOG(1, "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << ".");
    18911909        if (List != NULL) {
    18921910          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     
    19151933                angle = AngleCheck.Angle(Oben);
    19161934                if (angle < Storage[0]) {
    1917                   //Log() << Verbose(1) << "Old values of Storage: %lf %lf \n", Storage[0], Storage[1]);
    1918                   DoLog(1) && (Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".\n");
     1935                  //LOG(1, "INFO: Old values of Storage is " << Storage[0] << ", " << Storage[1]);
     1936                  LOG(1, "INFO: Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".");
    19191937                  OptCandidate = Candidate;
    19201938                  Storage[0] = angle;
    1921                   //Log() << Verbose(1) << "Changing something in Storage: %lf %lf. \n", Storage[0], Storage[2]);
     1939                  //LOG(1, "INFO: Changing something in  Storage is " << Storage[0] << ", " << Storage[1]);
    19221940                } else {
    1923                   //Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Looses with angle " << angle << " to a better candidate " << *OptCandidate << endl;
     1941                  //LOG(1, "INFO: Current candidate is " << *Candidate << ": Looses with angle " << angle << " to a better candidate " << *OptCandidate);
    19241942                }
    19251943              } else {
    1926                 //Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Refused due to Radius " << norm << endl;
     1944                //LOG(1, "INFO: Current candidate is " << *Candidate << ": Refused due to Radius " << norm);
    19271945              }
    19281946            } else {
    1929               //Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Candidate is equal to first endpoint." << *a << "." << endl;
     1947              //LOG(1, "INFO: Current candidate is " << *Candidate << ": Candidate is equal to first endpoint." << *a << ".");
    19301948            }
    19311949          }
    19321950        } else {
    1933           DoLog(0) && (Log() << Verbose(0) << "Linked cell list is empty." << endl);
     1951          LOG(0, "Linked cell list is empty.");
    19341952        }
    19351953      }
     
    19862004  TesselPoint *Candidate = NULL;
    19872005
    1988   DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of BaseTriangle is " << NormalVector << "." << endl);
     2006  LOG(1, "INFO: NormalVector of BaseTriangle is " << NormalVector << ".");
    19892007
    19902008  // copy old center
     
    20082026    CircleRadius = RADIUS * RADIUS - radius;
    20092027    CirclePlaneNormal.Normalize();
    2010     DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl);
     2028    LOG(1, "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << ".");
    20112029
    20122030    // test whether old center is on the band's plane
    20132031    if (fabs(RelativeOldSphereCenter.ScalarProduct(CirclePlaneNormal)) > HULLEPSILON) {
    2014       DoeLog(1) && (eLog() << Verbose(1) << "Something's very wrong here: RelativeOldSphereCenter is not on the band's plane as desired by " << fabs(RelativeOldSphereCenter.ScalarProduct(CirclePlaneNormal)) << "!" << endl);
     2032      ELOG(1, "Something's very wrong here: RelativeOldSphereCenter is not on the band's plane as desired by " << fabs(RelativeOldSphereCenter.ScalarProduct(CirclePlaneNormal)) << "!");
    20152033      RelativeOldSphereCenter.ProjectOntoPlane(CirclePlaneNormal);
    20162034    }
    20172035    radius = RelativeOldSphereCenter.NormSquared();
    20182036    if (fabs(radius - CircleRadius) < HULLEPSILON) {
    2019       DoLog(1) && (Log() << Verbose(1) << "INFO: RelativeOldSphereCenter is at " << RelativeOldSphereCenter << "." << endl);
     2037      LOG(1, "INFO: RelativeOldSphereCenter is at " << RelativeOldSphereCenter << ".");
    20202038
    20212039      // check SearchDirection
    2022       DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl);
     2040      LOG(1, "INFO: SearchDirection is " << SearchDirection << ".");
    20232041      if (fabs(RelativeOldSphereCenter.ScalarProduct(SearchDirection)) > HULLEPSILON) { // rotated the wrong way!
    2024         DoeLog(1) && (eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl);
     2042        ELOG(1, "SearchDirection and RelativeOldSphereCenter are not orthogonal!");
    20252043      }
    20262044
     
    20292047        for (int i = 0; i < NDIM; i++) // store indices of this cell
    20302048          N[i] = LC->n[i];
    2031         //Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
     2049        //LOG(1, "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << ".");
    20322050      } else {
    2033         DoeLog(1) && (eLog() << Verbose(1) << "Vector " << CircleCenter << " is outside of LinkedCell's bounding box." << endl);
     2051        ELOG(1, "Vector " << CircleCenter << " is outside of LinkedCell's bounding box.");
    20342052        return;
    20352053      }
    20362054      // then go through the current and all neighbouring cells and check the contained points for possible candidates
    2037       //Log() << Verbose(1) << "LC Intervals:";
     2055//      if (DoLog(0)) {
     2056//        std::stringstream output;
     2057//        output << "LC Intervals:";
     2058//        for (int i = 0; i < NDIM; i++)
     2059//          output << " [" << Nlower[i] << "," << Nupper[i] << "] ";
     2060//        LOG(0, output.str());
     2061//      }
    20382062      for (int i = 0; i < NDIM; i++) {
    20392063        Nlower[i] = ((N[i] - 1) >= 0) ? N[i] - 1 : 0;
    20402064        Nupper[i] = ((N[i] + 1) < LC->N[i]) ? N[i] + 1 : LC->N[i] - 1;
    2041         //Log() << Verbose(0) << " [" << Nlower[i] << "," << Nupper[i] << "] ";
    20422065      }
    2043       //Log() << Verbose(0) << endl;
    20442066      for (LC->n[0] = Nlower[0]; LC->n[0] <= Nupper[0]; LC->n[0]++)
    20452067        for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    20462068          for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    20472069            const TesselPointSTLList *List = LC->GetCurrentCell();
    2048             //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
     2070            //LOG(1, "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << ".");
    20492071            if (List != NULL) {
    20502072              for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     
    20522074
    20532075                // check for three unique points
    2054                 DoLog(2) && (Log() << Verbose(2) << "INFO: Current Candidate is " << *Candidate << " for BaseLine " << *CandidateLine.BaseLine << " with OldSphereCenter " << OldSphereCenter << "." << endl);
     2076                LOG(2, "INFO: Current Candidate is " << *Candidate << " for BaseLine " << *CandidateLine.BaseLine << " with OldSphereCenter " << OldSphereCenter << ".");
    20552077                if ((Candidate != CandidateLine.BaseLine->endpoints[0]->node) && (Candidate != CandidateLine.BaseLine->endpoints[1]->node)) {
    20562078
    20572079                  // find center on the plane
    20582080                  GetCenterofCircumcircle(NewPlaneCenter, CandidateLine.BaseLine->endpoints[0]->node->getPosition(), CandidateLine.BaseLine->endpoints[1]->node->getPosition(), Candidate->getPosition());
    2059                   DoLog(1) && (Log() << Verbose(1) << "INFO: NewPlaneCenter is " << NewPlaneCenter << "." << endl);
     2081                  LOG(1, "INFO: NewPlaneCenter is " << NewPlaneCenter << ".");
    20602082
    20612083                  try {
     
    20632085                                            (CandidateLine.BaseLine->endpoints[1]->node->getPosition()),
    20642086                                            (Candidate->getPosition())).getNormal();
    2065                     DoLog(1) && (Log() << Verbose(1) << "INFO: NewNormalVector is " << NewNormalVector << "." << endl);
     2087                    LOG(1, "INFO: NewNormalVector is " << NewNormalVector << ".");
    20662088                    radius = CandidateLine.BaseLine->endpoints[0]->node->DistanceSquared(NewPlaneCenter);
    2067                     DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl);
    2068                     DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl);
    2069                     DoLog(1) && (Log() << Verbose(1) << "INFO: Radius of CircumCenterCircle is " << radius << "." << endl);
     2089                    LOG(1, "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << ".");
     2090                    LOG(1, "INFO: SearchDirection is " << SearchDirection << ".");
     2091                    LOG(1, "INFO: Radius of CircumCenterCircle is " << radius << ".");
    20702092                    if (radius < RADIUS * RADIUS) {
    20712093                      otherradius = CandidateLine.BaseLine->endpoints[1]->node->DistanceSquared(NewPlaneCenter);
     
    20762098                        helper = NewNormalVector;
    20772099                        helper.Scale(sqrt(RADIUS * RADIUS - radius));
    2078                         DoLog(2) && (Log() << Verbose(2) << "INFO: Distance of NewPlaneCenter " << NewPlaneCenter << " to either NewSphereCenter is " << helper.Norm() << " of vector " << helper << " with sphere radius " << RADIUS << "." << endl);
     2100                        LOG(2, "INFO: Distance of NewPlaneCenter " << NewPlaneCenter << " to either NewSphereCenter is " << helper.Norm() << " of vector " << helper << " with sphere radius " << RADIUS << ".");
    20792101                        NewSphereCenter += helper;
    2080                         DoLog(2) && (Log() << Verbose(2) << "INFO: NewSphereCenter is at " << NewSphereCenter << "." << endl);
     2102                        LOG(2, "INFO: NewSphereCenter is at " << NewSphereCenter << ".");
    20812103                        // OtherNewSphereCenter is created by the same vector just in the other direction
    20822104                        helper.Scale(-1.);
    20832105                        OtherNewSphereCenter += helper;
    2084                         DoLog(2) && (Log() << Verbose(2) << "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << "." << endl);
     2106                        LOG(2, "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << ".");
    20852107                        alpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, NewSphereCenter, OldSphereCenter, NormalVector, SearchDirection, HULLEPSILON);
    20862108                        Otheralpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, OtherNewSphereCenter, OldSphereCenter, NormalVector, SearchDirection, HULLEPSILON);
     
    21032125                          if ((CandidateLine.ShortestAngle - HULLEPSILON) < alpha) {
    21042126                            CandidateLine.pointlist.push_back(Candidate);
    2105                             DoLog(0) && (Log() << Verbose(0) << "ACCEPT: We have found an equally good candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl);
     2127                            LOG(0, "ACCEPT: We have found an equally good candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << ".");
    21062128                          } else {
    21072129                            // remove all candidates from the list and then the list itself
    21082130                            CandidateLine.pointlist.clear();
    21092131                            CandidateLine.pointlist.push_back(Candidate);
    2110                             DoLog(0) && (Log() << Verbose(0) << "ACCEPT: We have found a better candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl);
     2132                            LOG(0, "ACCEPT: We have found a better candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << ".");
    21112133                          }
    21122134                          CandidateLine.ShortestAngle = alpha;
    2113                           DoLog(0) && (Log() << Verbose(0) << "INFO: There are " << CandidateLine.pointlist.size() << " candidates in the list now." << endl);
     2135                          LOG(0, "INFO: There are " << CandidateLine.pointlist.size() << " candidates in the list now.");
    21142136                        } else {
    21152137                          if ((Candidate != NULL) && (CandidateLine.pointlist.begin() != CandidateLine.pointlist.end())) {
    2116                             DoLog(1) && (Log() << Verbose(1) << "REJECT: Old candidate " << *(*CandidateLine.pointlist.begin()) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " ." << endl);
     2138                            LOG(1, "REJECT: Old candidate " << *(*CandidateLine.pointlist.begin()) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " .");
    21172139                          } else {
    2118                             DoLog(1) && (Log() << Verbose(1) << "REJECT: Candidate " << *Candidate << " with " << alpha << " was rejected." << endl);
     2140                            LOG(1, "REJECT: Candidate " << *Candidate << " with " << alpha << " was rejected.");
    21192141                          }
    21202142                        }
    21212143                      } else {
    2122                         DoeLog(0) && (eLog() << Verbose(1) << "REJECT: Distance to center of circumcircle is not the same from each corner of the triangle: " << fabs(radius - otherradius) << endl);
     2144                        ELOG(0, "REJECT: Distance to center of circumcircle is not the same from each corner of the triangle: " << fabs(radius - otherradius));
    21232145                      }
    21242146                    } else {
    2125                       DoLog(1) && (Log() << Verbose(1) << "REJECT: NewSphereCenter " << NewSphereCenter << " for " << *Candidate << " is too far away: " << radius << "." << endl);
     2147                      LOG(1, "REJECT: NewSphereCenter " << NewSphereCenter << " for " << *Candidate << " is too far away: " << radius << ".");
    21262148                    }
    21272149                  }
    21282150                  catch (LinearDependenceException &excp){
    2129                     Log() << Verbose(1) << boost::diagnostic_information(excp);
    2130                     Log() << Verbose(1) << "REJECT: Three points from " << *CandidateLine.BaseLine << " and Candidate " << *Candidate << " are linear-dependent." << endl;
     2151                    LOG(1, boost::diagnostic_information(excp));
     2152                    LOG(1, "REJECT: Three points from " << *CandidateLine.BaseLine << " and Candidate " << *Candidate << " are linear-dependent.");
    21312153                  }
    21322154                } else {
    21332155                  if (ThirdPoint != NULL) {
    2134                     DoLog(1) && (Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " and " << *ThirdPoint << " contains Candidate " << *Candidate << "." << endl);
     2156                    LOG(1, "REJECT: Base triangle " << *CandidateLine.BaseLine << " and " << *ThirdPoint << " contains Candidate " << *Candidate << ".");
    21352157                  } else {
    2136                     DoLog(1) && (Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " contains Candidate " << *Candidate << "." << endl);
     2158                    LOG(1, "REJECT: Base triangle " << *CandidateLine.BaseLine << " contains Candidate " << *Candidate << ".");
    21372159                  }
    21382160                }
     
    21412163          }
    21422164    } else {
    2143       DoeLog(1) && (eLog() << Verbose(1) << "The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << "." << endl);
     2165      ELOG(1, "The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << ".");
    21442166    }
    21452167  } else {
    21462168    if (ThirdPoint != NULL)
    2147       DoLog(1) && (Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and third node " << *ThirdPoint << " is too big!" << endl);
     2169      LOG(1, "Circumcircle for base line " << *CandidateLine.BaseLine << " and third node " << *ThirdPoint << " is too big!");
    21482170    else
    2149       DoLog(1) && (Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " is too big!" << endl);
    2150   }
    2151 
    2152   DoLog(1) && (Log() << Verbose(1) << "INFO: Sorting candidate list ..." << endl);
     2171      LOG(1, "Circumcircle for base line " << *CandidateLine.BaseLine << " is too big!");
     2172  }
     2173
     2174  LOG(1, "INFO: Sorting candidate list ...");
    21532175  if (CandidateLine.pointlist.size() > 1) {
    21542176    CandidateLine.pointlist.unique();
     
    21572179
    21582180  if ((!CandidateLine.pointlist.empty()) && (!CandidateLine.CheckValidity(RADIUS, LC))) {
    2159     DoeLog(0) && (eLog() << Verbose(0) << "There were other points contained in the rolling sphere as well!" << endl);
     2181    ELOG(0, "There were other points contained in the rolling sphere as well!");
    21602182    performCriticalExit();
    21612183  }
     
    21812203      if (!OrderTest.second) { // if insertion fails, we have common endpoint
    21822204        node = OrderTest.first->second;
    2183         DoLog(1) && (Log() << Verbose(1) << "Common endpoint of lines " << *line1 << " and " << *line2 << " is: " << *node << "." << endl);
     2205        LOG(1, "Common endpoint of lines " << *line1 << " and " << *line2 << " is: " << *node << ".");
    21842206        j = 2;
    21852207        i = 2;
     
    22032225
    22042226  if (LinesOnBoundary.empty()) {
    2205     DoeLog(1) && (eLog() << Verbose(1) << "There is no tesselation structure to compare the point with, please create one first." << endl);
     2227    ELOG(1, "There is no tesselation structure to compare the point with, please create one first.");
    22062228    return NULL;
    22072229  }
     
    22112233  for (int i = 0; i < NDIM; i++) // store indices of this cell
    22122234    N[i] = LC->n[i];
    2213   DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl);
     2235  LOG(1, "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << ".");
    22142236  DistanceToPointMap * points = new DistanceToPointMap;
    22152237  LC->GetNeighbourBounds(Nlower, Nupper);
    2216   //Log() << Verbose(1) << endl;
    22172238  for (LC->n[0] = Nlower[0]; LC->n[0] <= Nupper[0]; LC->n[0]++)
    22182239    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    22192240      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    22202241        const TesselPointSTLList *List = LC->GetCurrentCell();
    2221         //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
     2242        //LOG(1, "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2]);
    22222243        if (List != NULL) {
    22232244          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     
    22252246            if (FindPoint != PointsOnBoundary.end()) {
    22262247              points->insert(DistanceToPointPair(FindPoint->second->node->DistanceSquared(x), FindPoint->second));
    2227               DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *FindPoint->second << " into the list." << endl);
     2248              LOG(1, "INFO: Putting " << *FindPoint->second << " into the list.");
    22282249            }
    22292250          }
    22302251        } else {
    2231           DoeLog(1) && (eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl);
     2252          ELOG(1, "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!");
    22322253        }
    22332254      }
     
    22352256  // check whether we found some points
    22362257  if (points->empty()) {
    2237     DoeLog(1) && (eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl);
     2258    ELOG(1, "There is no nearest point: too far away from the surface.");
    22382259    delete (points);
    22392260    return NULL;
     
    22542275  DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x, LC);
    22552276  if (points == NULL) {
    2256     DoeLog(1) && (eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl);
     2277    ELOG(1, "There is no nearest point: too far away from the surface.");
    22572278    return NULL;
    22582279  }
    22592280
    22602281  // for each point, check its lines, remember closest
    2261   DoLog(1) && (Log() << Verbose(1) << "Finding closest BoundaryLine to " << x << " ... " << endl);
     2282  LOG(1, "Finding closest BoundaryLine to " << x << " ... ");
    22622283  BoundaryLineSet *ClosestLine = NULL;
    22632284  double MinDistance = -1.;
     
    22842305          ClosestLine = LineRunner->second;
    22852306          MinDistance = distance;
    2286           DoLog(1) && (Log() << Verbose(1) << "ACCEPT: New closest line is " << *ClosestLine << " with projected distance " << MinDistance << "." << endl);
     2307          LOG(1, "ACCEPT: New closest line is " << *ClosestLine << " with projected distance " << MinDistance << ".");
    22872308        } else {
    2288           DoLog(1) && (Log() << Verbose(1) << "REJECT: Intersection is outside of the line section: " << lengthA << " and " << lengthB << "." << endl);
     2309          LOG(1, "REJECT: Intersection is outside of the line section: " << lengthA << " and " << lengthB << ".");
    22892310        }
    22902311      } else {
    2291         DoLog(1) && (Log() << Verbose(1) << "REJECT: Point is too further away than present line: " << distance << " >> " << MinDistance << "." << endl);
     2312        LOG(1, "REJECT: Point is too further away than present line: " << distance << " >> " << MinDistance << ".");
    22922313      }
    22932314    }
     
    22962317  // check whether closest line is "too close" :), then it's inside
    22972318  if (ClosestLine == NULL) {
    2298     DoLog(0) && (Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl);
     2319    LOG(0, "Is the only point, no one else is closeby.");
    22992320    return NULL;
    23002321  }
     
    23142335  DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x, LC);
    23152336  if (points == NULL) {
    2316     DoeLog(1) && (eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl);
     2337    ELOG(1, "There is no nearest point: too far away from the surface.");
    23172338    return NULL;
    23182339  }
    23192340
    23202341  // for each point, check its lines, remember closest
    2321   DoLog(1) && (Log() << Verbose(1) << "Finding closest BoundaryTriangle to " << x << " ... " << endl);
     2342  LOG(1, "Finding closest BoundaryTriangle to " << x << " ... ");
    23222343  LineSet ClosestLines;
    23232344  double MinDistance = 1e+16;
     
    23452366          ClosestLines.insert(LineRunner->second);
    23462367          MinDistance = lengthEnd;
    2347           DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[0]->node << " is closer with " << lengthEnd << "." << endl);
     2368          LOG(1, "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[0]->node << " is closer with " << lengthEnd << ".");
    23482369        } else if (fabs(lengthEnd - MinDistance) < MYEPSILON) { // additional best candidate
    23492370          ClosestLines.insert(LineRunner->second);
    2350           DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[1]->node << " is equally good with " << lengthEnd << "." << endl);
     2371          LOG(1, "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[1]->node << " is equally good with " << lengthEnd << ".");
    23512372        } else { // line is worse
    2352           DoLog(1) && (Log() << Verbose(1) << "REJECT: Line " << *LineRunner->second << " to either endpoints is further away than present closest line candidate: " << lengthEndA << ", " << lengthEndB << ", and distance is longer than baseline:" << lengthBase << "." << endl);
     2373          LOG(1, "REJECT: Line " << *LineRunner->second << " to either endpoints is further away than present closest line candidate: " << lengthEndA << ", " << lengthEndB << ", and distance is longer than baseline:" << lengthBase << ".");
    23532374        }
    23542375      } else { // intersection is closer, calculate
     
    23602381        const double distance = BaseLineIntersection.NormSquared();
    23612382        if (Center.NormSquared() > BaseLine.NormSquared()) {
    2362           DoeLog(0) && (eLog() << Verbose(0) << "Algorithmic error: In second case we have intersection outside of baseline!" << endl);
     2383          ELOG(0, "Algorithmic error: In second case we have intersection outside of baseline!");
    23632384        }
    23642385        if ((ClosestLines.empty()) || (distance < MinDistance)) {
    23652386          ClosestLines.insert(LineRunner->second);
    23662387          MinDistance = distance;
    2367           DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Intersection in between endpoints, new closest line " << *LineRunner->second << " is " << *ClosestLines.begin() << " with projected distance " << MinDistance << "." << endl);
     2388          LOG(1, "ACCEPT: Intersection in between endpoints, new closest line " << *LineRunner->second << " is " << *ClosestLines.begin() << " with projected distance " << MinDistance << ".");
    23682389        } else {
    2369           DoLog(2) && (Log() << Verbose(2) << "REJECT: Point is further away from line " << *LineRunner->second << " than present closest line: " << distance << " >> " << MinDistance << "." << endl);
     2390          LOG(2, "REJECT: Point is further away from line " << *LineRunner->second << " than present closest line: " << distance << " >> " << MinDistance << ".");
    23702391        }
    23712392      }
     
    23762397  // check whether closest line is "too close" :), then it's inside
    23772398  if (ClosestLines.empty()) {
    2378     DoLog(0) && (Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl);
     2399    LOG(0, "Is the only point, no one else is closeby.");
    23792400    return NULL;
    23802401  }
     
    24162437      result = *Runner;
    24172438      MinAlignment = Alignment;
    2418       DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Triangle " << *result << " is better aligned with " << MinAlignment << "." << endl);
     2439      LOG(1, "ACCEPT: Triangle " << *result << " is better aligned with " << MinAlignment << ".");
    24192440    } else {
    2420       DoLog(1) && (Log() << Verbose(1) << "REJECT: Triangle " << *result << " is worse aligned with " << MinAlignment << "." << endl);
     2441      LOG(1, "REJECT: Triangle " << *result << " is worse aligned with " << MinAlignment << ".");
    24212442    }
    24222443  }
     
    24712492
    24722493  if (triangle == NULL) {// is boundary point or only point in point cloud?
    2473     DoLog(1) && (Log() << Verbose(1) << "No triangle given!" << endl);
     2494    LOG(1, "No triangle given!");
    24742495    return -1.;
    24752496  } else {
    2476     DoLog(1) && (Log() << Verbose(1) << "INFO: Closest triangle found is " << *triangle << " with normal vector " << triangle->NormalVector << "." << endl);
     2497    LOG(1, "INFO: Closest triangle found is " << *triangle << " with normal vector " << triangle->NormalVector << ".");
    24772498  }
    24782499
    24792500  triangle->GetCenter(Center);
    2480   DoLog(2) && (Log() << Verbose(2) << "INFO: Central point of the triangle is " << Center << "." << endl);
     2501  LOG(2, "INFO: Central point of the triangle is " << Center << ".");
    24812502  DistanceToCenter = Center - Point;
    2482   DoLog(2) && (Log() << Verbose(2) << "INFO: Vector from point to test to center is " << DistanceToCenter << "." << endl);
     2503  LOG(2, "INFO: Vector from point to test to center is " << DistanceToCenter << ".");
    24832504
    24842505  // check whether we are on boundary
     
    24872508    DistanceToCenter = Point + triangle->NormalVector; // points outside
    24882509    Center = Point - triangle->NormalVector; // points towards MolCenter
    2489     DoLog(1) && (Log() << Verbose(1) << "INFO: Calling Intersection with " << Center << " and " << DistanceToCenter << "." << endl);
     2510    LOG(1, "INFO: Calling Intersection with " << Center << " and " << DistanceToCenter << ".");
    24902511    if (triangle->GetIntersectionInsideTriangle(Center, DistanceToCenter, Intersection)) {
    2491       DoLog(1) && (Log() << Verbose(1) << Point << " is inner point: sufficiently close to boundary, " << Intersection << "." << endl);
     2512      LOG(1, Point << " is inner point: sufficiently close to boundary, " << Intersection << ".");
    24922513      return 0.;
    24932514    } else {
    2494       DoLog(1) && (Log() << Verbose(1) << Point << " is NOT an inner point: on triangle plane but outside of triangle bounds." << endl);
     2515      LOG(1, Point << " is NOT an inner point: on triangle plane but outside of triangle bounds.");
    24952516      return false;
    24962517    }
     
    24982519    // calculate smallest distance
    24992520    distance = triangle->GetClosestPointInsideTriangle(Point, Intersection);
    2500     DoLog(1) && (Log() << Verbose(1) << "Closest point on triangle is " << Intersection << "." << endl);
     2521    LOG(1, "Closest point on triangle is " << Intersection << ".");
    25012522
    25022523    // then check direction to boundary
    25032524    if (DistanceToCenter.ScalarProduct(triangle->NormalVector) > MYEPSILON) {
    2504       DoLog(1) && (Log() << Verbose(1) << Point << " is an inner point, " << distance << " below surface." << endl);
     2525      LOG(1, Point << " is an inner point, " << distance << " below surface.");
    25052526      return -distance;
    25062527    } else {
    2507       DoLog(1) && (Log() << Verbose(1) << Point << " is NOT an inner point, " << distance << " above surface." << endl);
     2528      LOG(1, Point << " is NOT an inner point, " << distance << " above surface.");
    25082529      return +distance;
    25092530    }
     
    25602581    ReferencePoint = PointRunner->second;
    25612582  } else {
    2562     DoeLog(2) && (eLog() << Verbose(2) << "GetAllConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl);
     2583    ELOG(2, "GetAllConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << ".");
    25632584    ReferencePoint = NULL;
    25642585  }
     
    25852606
    25862607    if (takePoint) {
    2587       DoLog(1) && (Log() << Verbose(1) << "INFO: Endpoint " << *current << " of line " << *(findLines->second) << " is enlisted." << endl);
     2608      LOG(1, "INFO: Endpoint " << *current << " of line " << *(findLines->second) << " is enlisted.");
    25882609      connectedPoints->insert(current);
    25892610    }
     
    25932614
    25942615  if (connectedPoints->empty()) { // if have not found any points
    2595     DoeLog(1) && (eLog() << Verbose(1) << "We have not found any connected points to " << *Point << "." << endl);
     2616    ELOG(1, "We have not found any connected points to " << *Point << ".");
    25962617    return NULL;
    25972618  }
     
    26262647
    26272648  if (SetOfNeighbours == NULL) {
    2628     DoeLog(2) && (eLog() << Verbose(2) << "Could not find any connected points!" << endl);
     2649    ELOG(2, "Could not find any connected points!");
    26292650    delete (connectedCircle);
    26302651    return NULL;
     
    26372658      PlaneNormal += (*Runner)->NormalVector;
    26382659  } else {
    2639     DoeLog(0) && (eLog() << Verbose(0) << "Could not find any triangles for point " << *Point << "." << endl);
     2660    ELOG(0, "Could not find any triangles for point " << *Point << ".");
    26402661    performCriticalExit();
    26412662  }
    26422663  PlaneNormal.Scale(1.0 / triangles->size());
    2643   DoLog(1) && (Log() << Verbose(1) << "INFO: Calculated PlaneNormal of all circle points is " << PlaneNormal << "." << endl);
     2664  LOG(1, "INFO: Calculated PlaneNormal of all circle points is " << PlaneNormal << ".");
    26442665  PlaneNormal.Normalize();
    26452666
     
    26482669  AngleZero.ProjectOntoPlane(PlaneNormal);
    26492670  if ((AngleZero.NormSquared() < MYEPSILON)) {
    2650     DoLog(1) && (Log() << Verbose(1) << "Using alternatively " << (*SetOfNeighbours->begin())->getPosition() << " as angle 0 referencer." << endl);
     2671    LOG(1, "Using alternatively " << (*SetOfNeighbours->begin())->getPosition() << " as angle 0 referencer.");
    26512672    AngleZero = ((*SetOfNeighbours->begin())->getPosition()) - (Point->getPosition());
    26522673    AngleZero.ProjectOntoPlane(PlaneNormal);
    26532674    if (AngleZero.NormSquared() < MYEPSILON) {
    2654       DoeLog(0) && (eLog() << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl);
     2675      ELOG(0, "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!");
    26552676      performCriticalExit();
    26562677    }
    26572678  }
    2658   DoLog(1) && (Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl);
     2679  LOG(1, "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << ".");
    26592680  if (AngleZero.NormSquared() > MYEPSILON)
    26602681    OrthogonalVector = Plane(PlaneNormal, AngleZero,0).getNormal();
    26612682  else
    26622683    OrthogonalVector.MakeNormalTo(PlaneNormal);
    2663   DoLog(1) && (Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl);
     2684  LOG(1, "INFO: OrthogonalVector on plane is " << OrthogonalVector << ".");
    26642685
    26652686  // go through all connected points and calculate angle
     
    26682689    helper.ProjectOntoPlane(PlaneNormal);
    26692690    double angle = GetAngle(helper, AngleZero, OrthogonalVector);
    2670     DoLog(0) && (Log() << Verbose(0) << "INFO: Calculated angle is " << angle << " for point " << **listRunner << "." << endl);
     2691    LOG(0, "INFO: Calculated angle is " << angle << " for point " << **listRunner << ".");
    26712692    anglesOfPoints.insert(pair<double, TesselPoint*> (angle, (*listRunner)));
    26722693  }
     
    27022723
    27032724  if (SetOfNeighbours == NULL) {
    2704     DoeLog(2) && (eLog() << Verbose(2) << "Could not find any connected points!" << endl);
     2725    ELOG(2, "Could not find any connected points!");
    27052726    delete (connectedCircle);
    27062727    return NULL;
     
    27142735  }
    27152736
    2716   DoLog(1) && (Log() << Verbose(1) << "INFO: Point is " << *Point << " and Reference is " << Reference << "." << endl);
     2737  LOG(1, "INFO: Point is " << *Point << " and Reference is " << Reference << ".");
    27172738  // calculate central point
    27182739  TesselPointSet::const_iterator TesselA = SetOfNeighbours->begin();
     
    27272748                   ((*TesselB)->getPosition()),
    27282749                   ((*TesselC)->getPosition())).getNormal();
    2729     DoLog(0) && (Log() << Verbose(0) << "Making normal vector out of " << *(*TesselA) << ", " << *(*TesselB) << " and " << *(*TesselC) << ":" << helper << endl);
     2750    LOG(0, "Making normal vector out of " << *(*TesselA) << ", " << *(*TesselB) << " and " << *(*TesselC) << ":" << helper);
    27302751    counter++;
    27312752    TesselA++;
     
    27342755    PlaneNormal += helper;
    27352756  }
    2736   //Log() << Verbose(0) << "Summed vectors " << center << "; number of points " << connectedPoints.size()
    2737   //  << "; scale factor " << counter;
     2757  //LOG(0, "Summed vectors " << center << "; number of points " << connectedPoints.size() << "; scale factor " << counter);
    27382758  PlaneNormal.Scale(1.0 / (double) counter);
    2739   //  Log() << Verbose(1) << "INFO: Calculated center of all circle points is " << center << "." << endl;
     2759  //  LOG(1, "INFO: Calculated center of all circle points is " << center << ".");
    27402760  //
    27412761  //  // projection plane of the circle is at the closes Point and normal is pointing away from center of all circle points
     
    27432763  //  PlaneNormal.SubtractVector(&center);
    27442764  //  PlaneNormal.Normalize();
    2745   DoLog(1) && (Log() << Verbose(1) << "INFO: Calculated plane normal of circle is " << PlaneNormal << "." << endl);
     2765  LOG(1, "INFO: Calculated plane normal of circle is " << PlaneNormal << ".");
    27462766
    27472767  // construct one orthogonal vector
     
    27512771  }
    27522772  if ((Reference.IsZero()) || (AngleZero.NormSquared() < MYEPSILON )) {
    2753     DoLog(1) && (Log() << Verbose(1) << "Using alternatively " << (*SetOfNeighbours->begin())->getPosition() << " as angle 0 referencer." << endl);
     2773    LOG(1, "Using alternatively " << (*SetOfNeighbours->begin())->getPosition() << " as angle 0 referencer.");
    27542774    AngleZero = ((*SetOfNeighbours->begin())->getPosition()) - (Point->getPosition());
    27552775    AngleZero.ProjectOntoPlane(PlaneNormal);
    27562776    if (AngleZero.NormSquared() < MYEPSILON) {
    2757       DoeLog(0) && (eLog() << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl);
     2777      ELOG(0, "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!");
    27582778      performCriticalExit();
    27592779    }
    27602780  }
    2761   DoLog(1) && (Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl);
     2781  LOG(1, "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << ".");
    27622782  if (AngleZero.NormSquared() > MYEPSILON)
    27632783    OrthogonalVector = Plane(PlaneNormal, AngleZero,0).getNormal();
    27642784  else
    27652785    OrthogonalVector.MakeNormalTo(PlaneNormal);
    2766   DoLog(1) && (Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl);
     2786  LOG(1, "INFO: OrthogonalVector on plane is " << OrthogonalVector << ".");
    27672787
    27682788  // go through all connected points and calculate angle
     
    27742794    if (angle > M_PI) // the correction is of no use here (and not desired)
    27752795      angle = 2. * M_PI - angle;
    2776     DoLog(0) && (Log() << Verbose(0) << "INFO: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << "." << endl);
     2796    LOG(0, "INFO: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << ".");
    27772797    InserterTest = anglesOfPoints.insert(pair<double, TesselPoint*> (angle, (*listRunner)));
    27782798    if (!InserterTest.second) {
    2779       DoeLog(0) && (eLog() << Verbose(0) << "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner) << endl);
     2799      ELOG(0, "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner));
    27802800      performCriticalExit();
    27812801    }
     
    28162836    ReferencePoint = PointRunner->second;
    28172837  } else {
    2818     DoeLog(1) && (eLog() << Verbose(1) << "GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl);
     2838    ELOG(1, "GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << ".");
    28192839    return NULL;
    28202840  }
     
    28332853      LineRunner = TouchedLine.find(runner->second);
    28342854      if (LineRunner == TouchedLine.end()) {
    2835         DoeLog(1) && (eLog() << Verbose(1) << "I could not find " << *runner->second << " in the touched list." << endl);
     2855        ELOG(1, "I could not find " << *runner->second << " in the touched list.");
    28362856      } else if (!LineRunner->second) {
    28372857        LineRunner->second = true;
     
    28412861        StartLine = CurrentLine;
    28422862        CurrentPoint = CurrentLine->GetOtherEndpoint(ReferencePoint);
    2843         DoLog(1) && (Log() << Verbose(1) << "INFO: Beginning path retrieval at " << *CurrentPoint << " of line " << *CurrentLine << "." << endl);
     2863        LOG(1, "INFO: Beginning path retrieval at " << *CurrentPoint << " of line " << *CurrentLine << ".");
    28442864        do {
    28452865          // push current one
    2846           DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl);
     2866          LOG(1, "INFO: Putting " << *CurrentPoint << " at end of path.");
    28472867          connectedPath->push_back(CurrentPoint->node);
    28482868
    28492869          // find next triangle
    28502870          for (TriangleMap::iterator Runner = CurrentLine->triangles.begin(); Runner != CurrentLine->triangles.end(); Runner++) {
    2851             DoLog(1) && (Log() << Verbose(1) << "INFO: Inspecting triangle " << *Runner->second << "." << endl);
     2871            LOG(1, "INFO: Inspecting triangle " << *Runner->second << ".");
    28522872            if ((Runner->second != triangle)) { // look for first triangle not equal to old one
    28532873              triangle = Runner->second;
     
    28562876                if (!TriangleRunner->second) {
    28572877                  TriangleRunner->second = true;
    2858                   DoLog(1) && (Log() << Verbose(1) << "INFO: Connecting triangle is " << *triangle << "." << endl);
     2878                  LOG(1, "INFO: Connecting triangle is " << *triangle << ".");
    28592879                  break;
    28602880                } else {
    2861                   DoLog(1) && (Log() << Verbose(1) << "INFO: Skipping " << *triangle << ", as we have already visited it." << endl);
     2881                  LOG(1, "INFO: Skipping " << *triangle << ", as we have already visited it.");
    28622882                  triangle = NULL;
    28632883                }
    28642884              } else {
    2865                 DoeLog(1) && (eLog() << Verbose(1) << "I could not find " << *triangle << " in the touched list." << endl);
     2885                ELOG(1, "I could not find " << *triangle << " in the touched list.");
    28662886                triangle = NULL;
    28672887              }
     
    28742894            if ((triangle->lines[i] != CurrentLine) && (triangle->lines[i]->ContainsBoundaryPoint(ReferencePoint))) { // not the current line and still containing Point
    28752895              CurrentLine = triangle->lines[i];
    2876               DoLog(1) && (Log() << Verbose(1) << "INFO: Connecting line is " << *CurrentLine << "." << endl);
     2896              LOG(1, "INFO: Connecting line is " << *CurrentLine << ".");
    28772897              break;
    28782898            }
     
    28802900          LineRunner = TouchedLine.find(CurrentLine);
    28812901          if (LineRunner == TouchedLine.end())
    2882             DoeLog(1) && (eLog() << Verbose(1) << "I could not find " << *CurrentLine << " in the touched list." << endl);
     2902            ELOG(1, "I could not find " << *CurrentLine << " in the touched list.");
    28832903          else
    28842904            LineRunner->second = true;
     
    28882908        } while (CurrentLine != StartLine);
    28892909        // last point is missing, as it's on start line
    2890         DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl);
     2910        LOG(1, "INFO: Putting " << *CurrentPoint << " at end of path.");
    28912911        if (StartLine->GetOtherEndpoint(ReferencePoint)->node != connectedPath->back())
    28922912          connectedPath->push_back(StartLine->GetOtherEndpoint(ReferencePoint)->node);
     
    28942914        ListOfPaths->push_back(connectedPath);
    28952915      } else {
    2896         DoLog(1) && (Log() << Verbose(1) << "INFO: Skipping " << *runner->second << ", as we have already visited it." << endl);
     2916        LOG(1, "INFO: Skipping " << *runner->second << ", as we have already visited it.");
    28972917      }
    28982918    }
    28992919  } else {
    2900     DoeLog(1) && (eLog() << Verbose(1) << "There are no lines attached to " << *ReferencePoint << "." << endl);
     2920    ELOG(1, "There are no lines attached to " << *ReferencePoint << ".");
    29012921  }
    29022922
     
    29242944    connectedPath = *ListRunner;
    29252945
    2926     DoLog(1) && (Log() << Verbose(1) << "INFO: Current path is " << connectedPath << "." << endl);
     2946    LOG(1, "INFO: Current path is " << connectedPath << ".");
    29272947
    29282948    // go through list, look for reappearance of starting Point and count
     
    29332953      if ((*CircleRunner == *CircleStart) && (CircleRunner != CircleStart)) { // is not the very first point
    29342954        // we have a closed circle from Marker to new Marker
    2935         DoLog(1) && (Log() << Verbose(1) << count + 1 << ". closed path consists of: ");
     2955        if (DoLog(1)) {
     2956          std::stringstream output;
     2957          output << count + 1 << ". closed path consists of: ";
     2958          for (TesselPointList::iterator CircleSprinter = Marker;
     2959              CircleSprinter != CircleRunner;
     2960              CircleSprinter++)
     2961            output << (**CircleSprinter) << " <-> ";
     2962          LOG(1, output.str());
     2963        }
    29362964        newPath = new TesselPointList;
    29372965        TesselPointList::iterator CircleSprinter = Marker;
    2938         for (; CircleSprinter != CircleRunner; CircleSprinter++) {
     2966        for (; CircleSprinter != CircleRunner; CircleSprinter++)
    29392967          newPath->push_back(*CircleSprinter);
    2940           DoLog(0) && (Log() << Verbose(0) << (**CircleSprinter) << " <-> ");
    2941         }
    2942         DoLog(0) && (Log() << Verbose(0) << ".." << endl);
    29432968        count++;
    29442969        Marker = CircleRunner;
     
    29492974    }
    29502975  }
    2951   DoLog(1) && (Log() << Verbose(1) << "INFO: " << count << " closed additional path(s) have been created." << endl);
     2976  LOG(1, "INFO: " << count << " closed additional path(s) have been created.");
    29522977
    29532978  // delete list of paths
     
    29753000
    29763001  if (Point == NULL) {
    2977     DoeLog(1) && (eLog() << Verbose(1) << "Point given is NULL." << endl);
     3002    ELOG(1, "Point given is NULL.");
    29783003  } else {
    29793004    // go through its lines and insert all triangles
     
    30083033
    30093034  if (point == NULL) {
    3010     DoeLog(1) && (eLog() << Verbose(1) << "Cannot remove the point " << point << ", it's NULL!" << endl);
     3035    ELOG(1, "Cannot remove the point " << point << ", it's NULL!");
    30113036    return 0.;
    30123037  } else
    3013     DoLog(0) && (Log() << Verbose(0) << "Removing point " << *point << " from tesselated boundary ..." << endl);
     3038    LOG(0, "Removing point " << *point << " from tesselated boundary ...");
    30143039
    30153040  // copy old location for the volume
     
    30183043  // get list of connected points
    30193044  if (point->lines.empty()) {
    3020     DoeLog(1) && (eLog() << Verbose(1) << "Cannot remove the point " << *point << ", it's connected to no lines!" << endl);
     3045    ELOG(1, "Cannot remove the point " << *point << ", it's connected to no lines!");
    30213046    return 0.;
    30223047  }
     
    30413066  NormalVector.Zero();
    30423067  for (TriangleMap::iterator Runner = Candidates.begin(); Runner != Candidates.end(); Runner++) {
    3043     DoLog(1) && (Log() << Verbose(1) << "INFO: Removing triangle " << *(Runner->second) << "." << endl);
     3068    LOG(1, "INFO: Removing triangle " << *(Runner->second) << ".");
    30443069    NormalVector -= Runner->second->NormalVector; // has to point inward
    30453070    RemoveTesselationTriangle(Runner->second);
    30463071    count++;
    30473072  }
    3048   DoLog(1) && (Log() << Verbose(1) << count << " triangles were removed." << endl);
     3073  LOG(1, count << " triangles were removed.");
    30493074
    30503075  list<TesselPointList *>::iterator ListAdvance = ListOfClosedPaths->begin();
     
    30703095        smallestangle = 0.;
    30713096        for (MiddleNode = connectedPath->begin(); MiddleNode != connectedPath->end(); MiddleNode++) {
    3072           DoLog(1) && (Log() << Verbose(1) << "INFO: MiddleNode is " << **MiddleNode << "." << endl);
     3097          LOG(1, "INFO: MiddleNode is " << **MiddleNode << ".");
    30733098          // construct vectors to next and previous neighbour
    30743099          StartNode = MiddleNode;
     
    30763101            StartNode = connectedPath->end();
    30773102          StartNode--;
    3078           //Log() << Verbose(3) << "INFO: StartNode is " << **StartNode << "." << endl;
     3103          //LOG(3, "INFO: StartNode is " << **StartNode << ".");
    30793104          Point = ((*StartNode)->getPosition()) - ((*MiddleNode)->getPosition());
    30803105          StartNode = MiddleNode;
     
    30823107          if (StartNode == connectedPath->end())
    30833108            StartNode = connectedPath->begin();
    3084           //Log() << Verbose(3) << "INFO: EndNode is " << **StartNode << "." << endl;
     3109          //LOG(3, "INFO: EndNode is " << **StartNode << ".");
    30853110          Reference = ((*StartNode)->getPosition()) - ((*MiddleNode)->getPosition());
    30863111          OrthogonalVector = ((*MiddleNode)->getPosition()) - OldPoint;
     
    30953120        MiddleNode = EndNode;
    30963121        if (MiddleNode == connectedPath->end()) {
    3097           DoeLog(0) && (eLog() << Verbose(0) << "CRITICAL: Could not find a smallest angle!" << endl);
     3122          ELOG(0, "CRITICAL: Could not find a smallest angle!");
    30983123          performCriticalExit();
    30993124        }
     
    31053130        if (EndNode == connectedPath->end())
    31063131          EndNode = connectedPath->begin();
    3107         DoLog(2) && (Log() << Verbose(2) << "INFO: StartNode is " << **StartNode << "." << endl);
    3108         DoLog(2) && (Log() << Verbose(2) << "INFO: MiddleNode is " << **MiddleNode << "." << endl);
    3109         DoLog(2) && (Log() << Verbose(2) << "INFO: EndNode is " << **EndNode << "." << endl);
    3110         DoLog(1) && (Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->getName() << ", " << (*MiddleNode)->getName() << " and " << (*EndNode)->getName() << "." << endl);
     3132        LOG(2, "INFO: StartNode is " << **StartNode << ".");
     3133        LOG(2, "INFO: MiddleNode is " << **MiddleNode << ".");
     3134        LOG(2, "INFO: EndNode is " << **EndNode << ".");
     3135        LOG(1, "INFO: Attempting to create triangle " << (*StartNode)->getName() << ", " << (*MiddleNode)->getName() << " and " << (*EndNode)->getName() << ".");
    31113136        TriangleCandidates[0] = *StartNode;
    31123137        TriangleCandidates[1] = *MiddleNode;
     
    31143139        triangle = GetPresentTriangle(TriangleCandidates);
    31153140        if (triangle != NULL) {
    3116           DoeLog(0) && (eLog() << Verbose(0) << "New triangle already present, skipping!" << endl);
     3141          ELOG(0, "New triangle already present, skipping!");
    31173142          StartNode++;
    31183143          MiddleNode++;
     
    31263151          continue;
    31273152        }
    3128         DoLog(3) && (Log() << Verbose(3) << "Adding new triangle points." << endl);
     3153        LOG(3, "Adding new triangle points.");
    31293154        AddTesselationPoint(*StartNode, 0);
    31303155        AddTesselationPoint(*MiddleNode, 1);
    31313156        AddTesselationPoint(*EndNode, 2);
    3132         DoLog(3) && (Log() << Verbose(3) << "Adding new triangle lines." << endl);
     3157        LOG(3, "Adding new triangle lines.");
    31333158        AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0);
    31343159        AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1);
     
    31453170        // prepare nodes for next triangle
    31463171        StartNode = EndNode;
    3147         DoLog(2) && (Log() << Verbose(2) << "Removing " << **MiddleNode << " from closed path, remaining points: " << connectedPath->size() << "." << endl);
     3172        LOG(2, "Removing " << **MiddleNode << " from closed path, remaining points: " << connectedPath->size() << ".");
    31483173        connectedPath->remove(*MiddleNode); // remove the middle node (it is surrounded by triangles)
    31493174        if (connectedPath->size() == 2) { // we are done
     
    31523177          break;
    31533178        } else if (connectedPath->size() < 2) { // something's gone wrong!
    3154           DoeLog(0) && (eLog() << Verbose(0) << "CRITICAL: There are only two endpoints left!" << endl);
     3179          ELOG(0, "CRITICAL: There are only two endpoints left!");
    31553180          performCriticalExit();
    31563181        } else {
     
    31813206          if (maxgain != 0) {
    31823207            volume += maxgain;
    3183             DoLog(1) && (Log() << Verbose(1) << "Flipping baseline with highest volume" << **Candidate << "." << endl);
     3208            LOG(1, "Flipping baseline with highest volume" << **Candidate << ".");
    31843209            OtherBase = FlipBaseline(*Candidate);
    31853210            NewLines.erase(Candidate);
     
    31923217      delete (connectedPath);
    31933218    }
    3194     DoLog(0) && (Log() << Verbose(0) << count << " triangles were created." << endl);
     3219    LOG(0, count << " triangles were created.");
    31953220  } else {
    31963221    while (!ListOfClosedPaths->empty()) {
     
    32003225      delete (connectedPath);
    32013226    }
    3202     DoLog(0) && (Log() << Verbose(0) << "No need to create any triangles." << endl);
     3227    LOG(0, "No need to create any triangles.");
    32033228  }
    32043229  delete (ListOfClosedPaths);
    32053230
    3206   DoLog(0) && (Log() << Verbose(0) << "Removed volume is " << volume << "." << endl);
     3231  LOG(0, "Removed volume is " << volume << ".");
    32073232
    32083233  return volume;
     
    32983323    }
    32993324    default:
    3300       DoeLog(0) && (eLog() << Verbose(0) << "Number of wildcards is greater than 3, cannot happen!" << endl);
     3325      ELOG(0, "Number of wildcards is greater than 3, cannot happen!");
    33013326      performCriticalExit();
    33023327      break;
     
    33543379  // sanity check
    33553380  if (LinesOnBoundary.empty()) {
    3356     DoeLog(2) && (eLog() << Verbose(2) << "FindAllDegeneratedTriangles() was called without any tesselation structure.");
     3381    ELOG(2, "FindAllDegeneratedTriangles() was called without any tesselation structure.");
    33573382    return DegeneratedLines;
    33583383  }
     
    33693394  AllLines.clear();
    33703395
    3371   DoLog(0) && (Log() << Verbose(0) << "FindAllDegeneratedLines() found " << DegeneratedLines->size() << " lines." << endl);
     3396  LOG(0, "FindAllDegeneratedLines() found " << DegeneratedLines->size() << " lines.");
    33723397  IndexToIndex::iterator it;
    33733398  for (it = DegeneratedLines->begin(); it != DegeneratedLines->end(); it++) {
     
    33753400    const LineMap::const_iterator Line2 = LinesOnBoundary.find((*it).second);
    33763401    if (Line1 != LinesOnBoundary.end() && Line2 != LinesOnBoundary.end())
    3377       DoLog(0) && (Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl);
     3402      LOG(0, *Line1->second << " => " << *Line2->second);
    33783403    else
    3379       DoeLog(1) && (eLog() << Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl);
     3404      ELOG(1, "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!");
    33803405  }
    33813406
     
    34173442  delete (DegeneratedLines);
    34183443
    3419   DoLog(0) && (Log() << Verbose(0) << "FindAllDegeneratedTriangles() found " << DegeneratedTriangles->size() << " triangles:" << endl);
     3444  LOG(0, "FindAllDegeneratedTriangles() found " << DegeneratedTriangles->size() << " triangles:");
    34203445  for (IndexToIndex::iterator it = DegeneratedTriangles->begin(); it != DegeneratedTriangles->end(); it++)
    3421     DoLog(0) && (Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl);
     3446    LOG(0, (*it).first << " => " << (*it).second);
    34223447
    34233448  return DegeneratedTriangles;
     
    34383463  // iterate over all degenerated triangles
    34393464  for (IndexToIndex::iterator TriangleKeyRunner = DegeneratedTriangles->begin(); !DegeneratedTriangles->empty(); TriangleKeyRunner = DegeneratedTriangles->begin()) {
    3440     DoLog(0) && (Log() << Verbose(0) << "Checking presence of triangles " << TriangleKeyRunner->first << " and " << TriangleKeyRunner->second << "." << endl);
     3465    LOG(0, "Checking presence of triangles " << TriangleKeyRunner->first << " and " << TriangleKeyRunner->second << ".");
    34413466    // both ways are stored in the map, only use one
    34423467    if (TriangleKeyRunner->first > TriangleKeyRunner->second)
     
    34953520      // erase the pair
    34963521      count += (int) DegeneratedTriangles->erase(triangle->Nr);
    3497       DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *triangle << "." << endl);
     3522      LOG(0, "RemoveDegeneratedTriangles() removes triangle " << *triangle << ".");
    34983523      RemoveTesselationTriangle(triangle);
    34993524      count += (int) DegeneratedTriangles->erase(partnerTriangle->Nr);
    3500       DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *partnerTriangle << "." << endl);
     3525      LOG(0, "RemoveDegeneratedTriangles() removes triangle " << *partnerTriangle << ".");
    35013526      RemoveTesselationTriangle(partnerTriangle);
    35023527    } else {
    3503       DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() does not remove triangle " << *triangle << " and its partner " << *partnerTriangle << " because it is essential for at" << " least one of the endpoints to be kept in the tesselation structure." << endl);
     3528      LOG(0, "RemoveDegeneratedTriangles() does not remove triangle " << *triangle << " and its partner " << *partnerTriangle << " because it is essential for at" << " least one of the endpoints to be kept in the tesselation structure.");
    35043529    }
    35053530  }
     
    35083533    LastTriangle = NULL;
    35093534
    3510   DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removed " << count << " triangles:" << endl);
     3535  LOG(0, "RemoveDegeneratedTriangles() removed " << count << " triangles:");
    35113536}
    35123537
     
    35343559    NearestBoundaryPoint = PointRunner->second;
    35353560  } else {
    3536     DoeLog(1) && (eLog() << Verbose(1) << "I cannot find the boundary point." << endl);
     3561    ELOG(1, "I cannot find the boundary point.");
    35373562    return;
    35383563  }
    3539   DoLog(0) && (Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->getName() << "." << endl);
     3564  LOG(0, "Nearest point on boundary is " << NearestPoint->getName() << ".");
    35403565
    35413566  // go through its lines and find the best one to split
     
    35693594
    35703595  // create new triangle to connect point (connects automatically with the missing spot of the chosen line)
    3571   DoLog(2) && (Log() << Verbose(2) << "Adding new triangle points." << endl);
     3596  LOG(2, "Adding new triangle points.");
    35723597  AddTesselationPoint((BestLine->endpoints[0]->node), 0);
    35733598  AddTesselationPoint((BestLine->endpoints[1]->node), 1);
    35743599  AddTesselationPoint(point, 2);
    3575   DoLog(2) && (Log() << Verbose(2) << "Adding new triangle lines." << endl);
     3600  LOG(2, "Adding new triangle lines.");
    35763601  AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0);
    35773602  AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1);
     
    35803605  BTS->GetNormalVector(TempTriangle->NormalVector);
    35813606  BTS->NormalVector.Scale(-1.);
    3582   DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of new triangle is " << BTS->NormalVector << "." << endl);
     3607  LOG(1, "INFO: NormalVector of new triangle is " << BTS->NormalVector << ".");
    35833608  AddTesselationTriangle();
    35843609
    35853610  // create other side of this triangle and close both new sides of the first created triangle
    3586   DoLog(2) && (Log() << Verbose(2) << "Adding new triangle points." << endl);
     3611  LOG(2, "Adding new triangle points.");
    35873612  AddTesselationPoint((BestLine->endpoints[0]->node), 0);
    35883613  AddTesselationPoint((BestLine->endpoints[1]->node), 1);
    35893614  AddTesselationPoint(point, 2);
    3590   DoLog(2) && (Log() << Verbose(2) << "Adding new triangle lines." << endl);
     3615  LOG(2, "Adding new triangle lines.");
    35913616  AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0);
    35923617  AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1);
     
    35943619  BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
    35953620  BTS->GetNormalVector(TempTriangle->NormalVector);
    3596   DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of other new triangle is " << BTS->NormalVector << "." << endl);
     3621  LOG(1, "INFO: NormalVector of other new triangle is " << BTS->NormalVector << ".");
    35973622  AddTesselationTriangle();
    35983623
     
    36013626    if ((BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[0])) && (BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[1]))) {
    36023627      if (BestLine == BTS->lines[i]) {
    3603         DoeLog(0) && (eLog() << Verbose(0) << "BestLine is same as found line, something's wrong here!" << endl);
     3628        ELOG(0, "BestLine is same as found line, something's wrong here!");
    36043629        performCriticalExit();
    36053630      }
     
    36343659        NameofTempFile.erase(npos, 1);
    36353660      NameofTempFile.append(TecplotSuffix);
    3636       DoLog(0) && (Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n");
     3661      LOG(1, "INFO: Writing temporary non convex hull to file " << NameofTempFile << ".");
    36373662      tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    36383663      WriteTecplotFile(tempstream, this, cloud, TriangleFilesWritten);
     
    36483673        NameofTempFile.erase(npos, 1);
    36493674      NameofTempFile.append(Raster3DSuffix);
    3650       DoLog(0) && (Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n");
     3675      LOG(1, "INFO: Writing temporary non convex hull to file " << NameofTempFile << ".");
    36513676      tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    36523677      WriteRaster3dFile(tempstream, this, cloud);
     
    37003725  pair<map<int, Vector *>::iterator, bool> TriangleInsertionTester;
    37013726  for (PointMap::const_iterator Runner = PointsOnBoundary.begin(); Runner != PointsOnBoundary.end(); Runner++) {
    3702     DoLog(0) && (Log() << Verbose(0) << "Current point is " << *Runner->second << "." << endl);
     3727    LOG(0, "Current point is " << *Runner->second << ".");
    37033728    map<int, Vector *> TriangleVectors;
    37043729    // gather all NormalVectors
    3705     DoLog(1) && (Log() << Verbose(1) << "Gathering triangles ..." << endl);
     3730    LOG(1, "Gathering triangles ...");
    37063731    for (LineMap::const_iterator LineRunner = (Runner->second)->lines.begin(); LineRunner != (Runner->second)->lines.end(); LineRunner++)
    37073732      for (TriangleMap::const_iterator TriangleRunner = (LineRunner->second)->triangles.begin(); TriangleRunner != (LineRunner->second)->triangles.end(); TriangleRunner++) {
     
    37093734          TriangleInsertionTester = TriangleVectors.insert(pair<int, Vector *> ((TriangleRunner->second)->Nr, &((TriangleRunner->second)->NormalVector)));
    37103735          if (TriangleInsertionTester.second)
    3711             DoLog(1) && (Log() << Verbose(1) << " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list." << endl);
     3736            LOG(1, " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list.");
    37123737        } else {
    3713           DoLog(1) && (Log() << Verbose(1) << " NOT adding triangle " << *(TriangleRunner->second) << " as it's a simply degenerated one." << endl);
     3738          LOG(1, " NOT adding triangle " << *(TriangleRunner->second) << " as it's a simply degenerated one.");
    37143739        }
    37153740      }
    37163741    // check whether there are two that are parallel
    3717     DoLog(1) && (Log() << Verbose(1) << "Finding two parallel triangles ..." << endl);
     3742    LOG(1, "Finding two parallel triangles ...");
    37183743    for (map<int, Vector *>::iterator VectorWalker = TriangleVectors.begin(); VectorWalker != TriangleVectors.end(); VectorWalker++)
    37193744      for (map<int, Vector *>::iterator VectorRunner = VectorWalker; VectorRunner != TriangleVectors.end(); VectorRunner++)
    37203745        if (VectorWalker != VectorRunner) { // skip equals
    37213746          const double SCP = VectorWalker->second->ScalarProduct(*VectorRunner->second); // ScalarProduct should result in -1. for degenerated triangles
    3722           DoLog(1) && (Log() << Verbose(1) << "Checking " << *VectorWalker->second << " against " << *VectorRunner->second << ": " << SCP << endl);
     3747          LOG(1, "Checking " << *VectorWalker->second << " against " << *VectorRunner->second << ": " << SCP);
    37233748          if (fabs(SCP + 1.) < ParallelEpsilon) {
    37243749            InsertionTester = EndpointCandidateList.insert((Runner->second));
    37253750            if (InsertionTester.second)
    3726               DoLog(0) && (Log() << Verbose(0) << " Adding " << *Runner->second << " to endpoint candidate list." << endl);
     3751              LOG(0, " Adding " << *Runner->second << " to endpoint candidate list.");
    37273752            // and break out of both loops
    37283753            VectorWalker = TriangleVectors.end();
     
    37433768    Walker = *(EndpointCandidateList.begin());
    37443769    if (Current == NULL) { // create a new polygon with current candidate
    3745       DoLog(0) && (Log() << Verbose(0) << "Starting new polygon set at point " << *Walker << endl);
     3770      LOG(0, "Starting new polygon set at point " << *Walker);
    37463771      Current = new BoundaryPolygonSet;
    37473772      Current->endpoints.insert(Walker);
     
    37563781      for (LineMap::const_iterator LineWalker = Walker->lines.begin(); LineWalker != Walker->lines.end(); LineWalker++) {
    37573782        OtherWalker = (LineWalker->second)->GetOtherEndpoint(Walker);
    3758         DoLog(1) && (Log() << Verbose(1) << "Checking " << *OtherWalker << endl);
     3783        LOG(1, "Checking " << *OtherWalker);
    37593784        set<BoundaryPointSet *>::iterator Finder = EndpointCandidateList.find(OtherWalker);
    37603785        if (Finder != EndpointCandidateList.end()) { // found a connected partner
    3761           DoLog(1) && (Log() << Verbose(1) << " Adding to polygon." << endl);
     3786          LOG(1, " Adding to polygon.");
    37623787          Current->endpoints.insert(OtherWalker);
    37633788          EndpointCandidateList.erase(Finder); // remove from candidates
    37643789          ToCheckConnecteds.push(OtherWalker); // but check its partners too
    37653790        } else {
    3766           DoLog(1) && (Log() << Verbose(1) << " is not connected to " << *Walker << endl);
     3791          LOG(1, " is not connected to " << *Walker);
    37673792        }
    37683793      }
    37693794    }
    37703795
    3771     DoLog(0) && (Log() << Verbose(0) << "Final polygon is " << *Current << endl);
     3796    LOG(0, "Final polygon is " << *Current);
    37723797    ListofDegeneratedPolygons.insert(Current);
    37733798    Current = NULL;
     
    37763801  const int counter = ListofDegeneratedPolygons.size();
    37773802
    3778   DoLog(0) && (Log() << Verbose(0) << "The following " << counter << " degenerated polygons have been found: " << endl);
    3779   for (UniquePolygonSet::iterator PolygonRunner = ListofDegeneratedPolygons.begin(); PolygonRunner != ListofDegeneratedPolygons.end(); PolygonRunner++)
    3780     DoLog(0) && (Log() << Verbose(0) << " " << **PolygonRunner << endl);
     3803  if (DoLog(0)) {
     3804    std::stringstream output;
     3805    output << "The following " << counter << " degenerated polygons have been found: ";
     3806    for (UniquePolygonSet::iterator PolygonRunner = ListofDegeneratedPolygons.begin(); PolygonRunner != ListofDegeneratedPolygons.end(); PolygonRunner++)
     3807      output << " " << **PolygonRunner;
     3808    LOG(0, output.str());
     3809  }
    37813810
    37823811  /// 4. Go through all these degenerated polygons
     
    37893818    // check whether number is bigger than 2, otherwise it's just a simply degenerated one and nothing to do.
    37903819    if (T->size() == 2) {
    3791       DoLog(1) && (Log() << Verbose(1) << " Skipping degenerated polygon, is just a (already simply degenerated) triangle." << endl);
     3820      LOG(1, " Skipping degenerated polygon, is just a (already simply degenerated) triangle.");
    37923821      delete (T);
    37933822      continue;
     
    37993828    // connections to either polygon ...
    38003829    if (T->size() % 2 != 0) {
    3801       DoeLog(0) && (eLog() << Verbose(0) << " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!" << endl);
     3830      ELOG(0, " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!");
    38023831      performCriticalExit();
    38033832    }
     
    38053834    /// 4a. Get NormalVector for one side (this is "front")
    38063835    NormalVector = (*TriangleWalker)->NormalVector;
    3807     DoLog(1) && (Log() << Verbose(1) << "\"front\" defining triangle is " << **TriangleWalker << " and Normal vector of \"front\" side is " << NormalVector << endl);
     3836    LOG(1, "\"front\" defining triangle is " << **TriangleWalker << " and Normal vector of \"front\" side is " << NormalVector);
    38083837    TriangleWalker++;
    38093838    TriangleSet::iterator TriangleSprinter = TriangleWalker; // is the inner advanced iterator
     
    38143843      triangle = *TriangleWalker;
    38153844      TriangleSprinter++;
    3816       DoLog(1) && (Log() << Verbose(1) << "Current triangle to test for removal: " << *triangle << endl);
     3845      LOG(1, "Current triangle to test for removal: " << *triangle);
    38173846      if (triangle->NormalVector.ScalarProduct(NormalVector) < 0) { // if from other side, then delete and remove from list
    3818         DoLog(1) && (Log() << Verbose(1) << " Removing ... " << endl);
     3847        LOG(1, " Removing ... ");
    38193848        TriangleNrs.push(triangle->Nr);
    38203849        T->erase(TriangleWalker);
    38213850        RemoveTesselationTriangle(triangle);
    38223851      } else
    3823         DoLog(1) && (Log() << Verbose(1) << " Keeping ... " << endl);
     3852        LOG(1, " Keeping ... ");
    38243853    }
    38253854    /// 4c. Copy all "front" triangles but with inverse NormalVector
    38263855    TriangleWalker = T->begin();
    38273856    while (TriangleWalker != T->end()) { // go through all front triangles
    3828       DoLog(1) && (Log() << Verbose(1) << " Re-creating triangle " << **TriangleWalker << " with NormalVector " << (*TriangleWalker)->NormalVector << endl);
     3857      LOG(1, " Re-creating triangle " << **TriangleWalker << " with NormalVector " << (*TriangleWalker)->NormalVector);
    38293858      for (int i = 0; i < 3; i++)
    38303859        AddTesselationPoint((*TriangleWalker)->endpoints[i]->node, i);
     
    38333862      AddTesselationLine(NULL, NULL, TPS[1], TPS[2], 2);
    38343863      if (TriangleNrs.empty())
    3835         DoeLog(0) && (eLog() << Verbose(0) << "No more free triangle numbers!" << endl);
     3864        ELOG(0, "No more free triangle numbers!");
    38363865      BTS = new BoundaryTriangleSet(BLS, TriangleNrs.top()); // copy triangle ...
    38373866      AddTesselationTriangle(); // ... and add
     
    38413870    }
    38423871    if (!TriangleNrs.empty()) {
    3843       DoeLog(0) && (eLog() << Verbose(0) << "There have been less triangles created than removed!" << endl);
     3872      ELOG(0, "There have been less triangles created than removed!");
    38443873    }
    38453874    delete (T); // remove the triangleset
    38463875  }
    38473876  IndexToIndex * SimplyDegeneratedTriangles = FindAllDegeneratedTriangles();
    3848   DoLog(0) && (Log() << Verbose(0) << "Final list of simply degenerated triangles found, containing " << SimplyDegeneratedTriangles->size() << " triangles:" << endl);
     3877  LOG(0, "Final list of simply degenerated triangles found, containing " << SimplyDegeneratedTriangles->size() << " triangles:");
    38493878  IndexToIndex::iterator it;
    38503879  for (it = SimplyDegeneratedTriangles->begin(); it != SimplyDegeneratedTriangles->end(); it++)
    3851     DoLog(0) && (Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl);
     3880    LOG(0, (*it).first << " => " << (*it).second);
    38523881  delete (SimplyDegeneratedTriangles);
    38533882  /// 5. exit
Note: See TracChangeset for help on using the changeset viewer.