Index: src/tesselation.cpp
===================================================================
--- src/tesselation.cpp	(revision 6613ec959229c059f4df050384fc4621ea87dcc0)
+++ src/tesselation.cpp	(revision 29955407eeb6f84cd775a755f6e7b4d9beba3aa5)
@@ -28,5 +28,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(1) << "Adding noname." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Adding noname." << endl);
 }
 ;
@@ -39,5 +39,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(1) << "Adding Node " << *Walker << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Adding Node " << *Walker << endl);
 }
 ;
@@ -63,5 +63,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(1) << "Adding " << *this << " to line " << *line << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Adding " << *this << " to line " << *line << "." << endl);
   if (line->endpoints[0] == this) {
     lines.insert(LinePair(line->endpoints[1]->Nr, line));
@@ -115,5 +115,5 @@
   skipped = false;
   // clear triangles list
-  Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl);
 }
 ;
@@ -138,5 +138,5 @@
   skipped = false;
   // clear triangles list
-  Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl);
 }
 ;
@@ -196,5 +196,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(0) << "Add " << triangle->Nr << " to line " << *this << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Add " << triangle->Nr << " to line " << *this << "." << endl);
   triangles.insert(TrianglePair(triangle->Nr, triangle));
 }
@@ -270,5 +270,5 @@
   //Log() << Verbose(0) << "INFO: BaselineNormal is " << BaseLineNormal << "." << endl;
   if (NormalCheck.NormSquared() < MYEPSILON) {
-    Log() << Verbose(0) << "ACCEPT: Normalvectors of both triangles are the same: convex." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Normalvectors of both triangles are the same: convex." << endl);
     return true;
   }
@@ -276,8 +276,8 @@
   double angle = GetAngle(helper[0], helper[1], BaseLineNormal);
   if ((angle - M_PI) > -MYEPSILON) {
-    Log() << Verbose(0) << "ACCEPT: Angle is greater than pi: convex." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Angle is greater than pi: convex." << endl);
     return true;
   } else {
-    Log() << Verbose(0) << "REJECT: Angle is less than pi: concave." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "REJECT: Angle is less than pi: concave." << endl);
     return false;
   }
@@ -364,8 +364,8 @@
   // set endpoints
   int Counter = 0;
-  Log() << Verbose(0) << "New triangle " << Nr << " with end points: " << endl;
+  DoLog(0) && (Log() << Verbose(0) << "New triangle " << Nr << " with end points: " << endl);
   for (PointMap::iterator runner = OrderMap.begin(); runner != OrderMap.end(); runner++) {
     endpoints[Counter] = runner->second;
-    Log() << Verbose(0) << " " << *endpoints[Counter] << endl;
+    DoLog(0) && (Log() << Verbose(0) << " " << *endpoints[Counter] << endl);
     Counter++;
   }
@@ -413,5 +413,5 @@
   if (NormalVector.ScalarProduct(&OtherVector) > 0.)
     NormalVector.Scale(-1.);
-  Log() << Verbose(1) << "Normal Vector is " << NormalVector << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Normal Vector is " << NormalVector << "." << endl);
 }
 ;
@@ -440,16 +440,16 @@
   }
 
-  Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl;
-  Log() << Verbose(1) << "INFO: Line is from " << *MolCenter << " to " << *x << "." << endl;
-  Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl);
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Line is from " << *MolCenter << " to " << *x << "." << endl);
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl);
 
   if (Intersection->DistanceSquared(endpoints[0]->node->node) < MYEPSILON) {
-    Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl);
     return true;
   } else if (Intersection->DistanceSquared(endpoints[1]->node->node) < MYEPSILON) {
-    Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl);
     return true;
   } else if (Intersection->DistanceSquared(endpoints[2]->node->node) < MYEPSILON) {
-    Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl);
     return true;
   }
@@ -462,7 +462,7 @@
       CrossPoint.SubtractVector(endpoints[i % 3]->node->node); // cross point was returned as absolute vector
       const double s = CrossPoint.ScalarProduct(&helper) / helper.NormSquared();
-      Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl);
       if ((s < -MYEPSILON) || ((s - 1.) > MYEPSILON)) {
-        Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl;
+        DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl);
         i = 4;
         break;
@@ -473,8 +473,8 @@
   } while (i < 3);
   if (i == 3) {
-    Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl);
     return true;
   } else {
-    Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " outside of triangle." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " outside of triangle." << endl);
     return false;
   }
@@ -500,5 +500,5 @@
 
   // 1. get intersection with plane
-  Log() << Verbose(1) << "INFO: Looking for closest point of triangle " << *this << " to " << *x << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Looking for closest point of triangle " << *this << " to " << *x << "." << endl);
   GetCenter(&Direction);
   if (!ClosestPoint->GetIntersectionWithPlane(&NormalVector, endpoints[0]->node->node, x, &Direction)) {
@@ -513,7 +513,7 @@
   InPlane.AddVector(ClosestPoint);
 
-  Log() << Verbose(2) << "INFO: Triangle is " << *this << "." << endl;
-  Log() << Verbose(2) << "INFO: Line is from " << Direction << " to " << *x << "." << endl;
-  Log() << Verbose(2) << "INFO: In-plane part is " << InPlane << "." << endl;
+  DoLog(2) && (Log() << Verbose(2) << "INFO: Triangle is " << *this << "." << endl);
+  DoLog(2) && (Log() << Verbose(2) << "INFO: Line is from " << Direction << " to " << *x << "." << endl);
+  DoLog(2) && (Log() << Verbose(2) << "INFO: In-plane part is " << InPlane << "." << endl);
 
   // Calculate cross point between one baseline and the desired point such that distance is shortest
@@ -533,8 +533,8 @@
     CrossPoint[i].SubtractVector(endpoints[i % 3]->node->node); // cross point was returned as absolute vector
     const double s = CrossPoint[i].ScalarProduct(&Direction) / Direction.NormSquared();
-    Log() << Verbose(2) << "INFO: Factor s is " << s << "." << endl;
+    DoLog(2) && (Log() << Verbose(2) << "INFO: Factor s is " << s << "." << endl);
     if ((s >= -MYEPSILON) && ((s - 1.) <= MYEPSILON)) {
       CrossPoint[i].AddVector(endpoints[i % 3]->node->node); // make cross point absolute again
-      Log() << Verbose(2) << "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << *endpoints[i % 3]->node->node << " and " << *endpoints[(i + 1) % 3]->node->node << "." << endl;
+      DoLog(2) && (Log() << Verbose(2) << "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << *endpoints[i % 3]->node->node << " and " << *endpoints[(i + 1) % 3]->node->node << "." << endl);
       const double distance = CrossPoint[i].DistanceSquared(x);
       if ((ShortestDistance < 0.) || (ShortestDistance > distance)) {
@@ -565,5 +565,5 @@
     }
   }
-  Log() << Verbose(1) << "INFO: Closest Point is " << *ClosestPoint << " with shortest squared distance is " << ShortestDistance << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Closest Point is " << *ClosestPoint << " with shortest squared distance is " << ShortestDistance << "." << endl);
   return ShortestDistance;
 }
@@ -619,5 +619,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(1) << "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "." << endl);
   return (((endpoints[0] == Points[0]) || (endpoints[0] == Points[1]) || (endpoints[0] == Points[2])) && ((endpoints[1] == Points[0]) || (endpoints[1] == Points[1]) || (endpoints[1] == Points[2])) && ((endpoints[2] == Points[0]) || (endpoints[2] == Points[1]) || (endpoints[2] == Points[2])
 
@@ -668,5 +668,5 @@
     center->AddVector(endpoints[i]->node->node);
   center->Scale(1. / 3.);
-  Log() << Verbose(1) << "INFO: Center is at " << *center << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Center is at " << *center << "." << endl);
 }
 
@@ -703,5 +703,5 @@
   Info FunctionInfo(__func__);
   endpoints.clear();
-  Log() << Verbose(1) << "Erasing polygon Nr." << Nr << " itself." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Erasing polygon Nr." << Nr << " itself." << endl);
 }
 ;
@@ -742,5 +742,5 @@
   if (TotalNormal->ScalarProduct(&OtherVector) > 0.)
     TotalNormal->Scale(-1.);
-  Log() << Verbose(1) << "Normal Vector is " << *TotalNormal << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Normal Vector is " << *TotalNormal << "." << endl);
 
   return TotalNormal;
@@ -762,5 +762,5 @@
   }
   center->Scale(1. / (double) counter);
-  Log() << Verbose(1) << "Center is at " << *center << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Center is at " << *center << "." << endl);
 }
 
@@ -795,11 +795,11 @@
   Info FunctionInfo(__func__);
   for (PointSet::const_iterator Runner = endpoints.begin(); Runner != endpoints.end(); Runner++) {
-    Log() << Verbose(0) << "Checking against " << **Runner << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Checking against " << **Runner << endl);
     if (point == (*Runner)) {
-      Log() << Verbose(0) << " Contained." << endl;
+      DoLog(0) && (Log() << Verbose(0) << " Contained." << endl);
       return true;
     }
   }
-  Log() << Verbose(0) << " Not contained." << endl;
+  DoLog(0) && (Log() << Verbose(0) << " Not contained." << endl);
   return false;
 }
@@ -815,8 +815,8 @@
   for (PointSet::const_iterator Runner = endpoints.begin(); Runner != endpoints.end(); Runner++)
     if (point == (*Runner)->node) {
-      Log() << Verbose(0) << " Contained." << endl;
+      DoLog(0) && (Log() << Verbose(0) << " Contained." << endl);
       return true;
     }
-  Log() << Verbose(0) << " Not contained." << endl;
+  DoLog(0) && (Log() << Verbose(0) << " Not contained." << endl);
   return false;
 }
@@ -832,7 +832,7 @@
   Info FunctionInfo(__func__);
   int counter = 0;
-  Log() << Verbose(1) << "Polygon is " << *this << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Polygon is " << *this << endl);
   for (int i = 0; i < dim; i++) {
-    Log() << Verbose(1) << " Testing endpoint " << *Points[i] << endl;
+    DoLog(1) && (Log() << Verbose(1) << " Testing endpoint " << *Points[i] << endl);
     if (ContainsBoundaryPoint(Points[i])) {
       counter++;
@@ -855,7 +855,7 @@
   Info FunctionInfo(__func__);
   size_t counter = 0;
-  Log() << Verbose(1) << "Polygon is " << *this << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Polygon is " << *this << endl);
   for (PointSet::const_iterator Runner = endpoints.begin(); Runner != endpoints.end(); Runner++) {
-    Log() << Verbose(1) << " Testing endpoint " << **Runner << endl;
+    DoLog(1) && (Log() << Verbose(1) << " Testing endpoint " << **Runner << endl);
     if (ContainsBoundaryPoint(*Runner))
       counter++;
@@ -895,9 +895,9 @@
           Tester = triangles->insert(Sprinter->second);
           if (Tester.second)
-            Log() << Verbose(0) << "Adding triangle " << *(Sprinter->second) << endl;
+            DoLog(0) && (Log() << Verbose(0) << "Adding triangle " << *(Sprinter->second) << endl);
         }
       }
 
-  Log() << Verbose(1) << "The Polygon of " << endpoints.size() << " endpoints has " << triangles->size() << " unique triangles in total." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "The Polygon of " << endpoints.size() << " endpoints has " << triangles->size() << " unique triangles in total." << endl);
   return triangles;
 }
@@ -914,10 +914,10 @@
   if (line == NULL)
     return false;
-  Log() << Verbose(1) << "Filling polygon from line " << *line << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Filling polygon from line " << *line << endl);
   for (TriangleMap::const_iterator Runner = line->triangles.begin(); Runner != line->triangles.end(); Runner++) {
     for (int i = 0; i < 3; i++) {
       Tester = endpoints.insert((Runner->second)->endpoints[i]);
       if (Tester.second)
-        Log() << Verbose(1) << "  Inserting endpoint " << *((Runner->second)->endpoints[i]) << endl;
+        DoLog(1) && (Log() << Verbose(1) << "  Inserting endpoint " << *((Runner->second)->endpoints[i]) << endl);
     }
   }
@@ -1071,5 +1071,5 @@
         return false;
       } else {
-        Log() << Verbose(1) << "Candidate " << *Walker << " is inside by " << distance << "." << endl;
+        DoLog(1) && (Log() << Verbose(1) << "Candidate " << *Walker << " is inside by " << distance << "." << endl);
       }
     }
@@ -1082,15 +1082,15 @@
     TesselPointList *ListofPoints = LC->GetPointsInsideSphere(RADIUS, (*VRunner));
 
-    Log() << Verbose(1) << "The following atoms are inside sphere at " << OtherOptCenter << ":" << endl;
+    DoLog(1) && (Log() << Verbose(1) << "The following atoms are inside sphere at " << OtherOptCenter << ":" << endl);
     for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner)
-      Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&OtherOptCenter) << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&OtherOptCenter) << "." << endl);
 
     // remove baseline's endpoints and candidates
     for (int i = 0; i < 2; i++) {
-      Log() << Verbose(1) << "INFO: removing baseline tesselpoint " << *BaseLine->endpoints[i]->node << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "INFO: removing baseline tesselpoint " << *BaseLine->endpoints[i]->node << "." << endl);
       ListofPoints->remove(BaseLine->endpoints[i]->node);
     }
     for (TesselPointList::const_iterator Runner = pointlist.begin(); Runner != pointlist.end(); ++Runner) {
-      Log() << Verbose(1) << "INFO: removing candidate tesselpoint " << *(*Runner) << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "INFO: removing candidate tesselpoint " << *(*Runner) << "." << endl);
       ListofPoints->remove(*Runner);
     }
@@ -1106,8 +1106,8 @@
     // check with animate_sphere.tcl VMD script
     if (ThirdPoint != NULL) {
-      Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " " << ThirdPoint->Nr + 1 << " " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl;
+      DoLog(1) && (Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " " << ThirdPoint->Nr + 1 << " " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl);
     } else {
-      Log() << Verbose(1) << "Check by: ... missing third point ..." << endl;
-      Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " ??? " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl;
+      DoLog(1) && (Log() << Verbose(1) << "Check by: ... missing third point ..." << endl);
+      DoLog(1) && (Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " ??? " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl);
     }
   }
@@ -1157,5 +1157,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(0) << "Free'ing TesselStruct ... " << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Free'ing TesselStruct ... " << endl);
   for (TriangleMap::iterator runner = TrianglesOnBoundary.begin(); runner != TrianglesOnBoundary.end(); runner++) {
     if (runner->second != NULL) {
@@ -1165,5 +1165,5 @@
       DoeLog(1) && (eLog() << Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl);
   }
-  Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl);
 }
 ;
@@ -1319,5 +1319,5 @@
     // 3. construct plane vector
     PlaneVector.MakeNormalVector(A->second->node->node, baseline->second.first->second->node->node, baseline->second.second->second->node->node);
-    Log() << Verbose(2) << "Plane vector of candidate triangle is " << PlaneVector << endl;
+    DoLog(2) && (Log() << Verbose(2) << "Plane vector of candidate triangle is " << PlaneVector << endl);
     // 4. loop over all points
     double sign = 0.;
@@ -1333,13 +1333,13 @@
       if (fabs(distance) < 1e-4) // we need to have a small epsilon around 0 which is still ok
         continue;
-      Log() << Verbose(2) << "Projection of " << checker->second->node->Name << " yields distance of " << distance << "." << endl;
+      DoLog(2) && (Log() << Verbose(2) << "Projection of " << checker->second->node->Name << " yields distance of " << distance << "." << endl);
       tmp = distance / fabs(distance);
       // 4b. Any have different sign to than before? (i.e. would lie outside convex hull with this starting triangle)
       if ((sign != 0) && (tmp != sign)) {
         // 4c. If so, break 4. loop and continue with next candidate in 1. loop
-        Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leaves " << checker->second->node->Name << " outside the convex hull." << endl;
+        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leaves " << checker->second->node->Name << " outside the convex hull." << endl);
         break;
       } else { // note the sign for later
-        Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leave " << checker->second->node->Name << " inside the convex hull." << endl;
+        DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leave " << checker->second->node->Name << " inside the convex hull." << endl);
         sign = tmp;
       }
@@ -1361,5 +1361,5 @@
     // 5. come this far, all on same side? Then break 1. loop and construct triangle
     if (checker == PointsOnBoundary.end()) {
-      Log() << Verbose(2) << "Looks like we have a candidate!" << endl;
+      DoLog(2) && (Log() << Verbose(2) << "Looks like we have a candidate!" << endl);
       break;
     }
@@ -1385,5 +1385,5 @@
     }
 
-    Log() << Verbose(1) << "Starting triangle is " << *BTS << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Starting triangle is " << *BTS << "." << endl);
   } else {
     DoeLog(0) && (eLog() << Verbose(0) << "No starting triangle found." << endl);
@@ -1426,9 +1426,9 @@
         // get peak point with respect to this base line's only triangle
         BTS = baseline->second->triangles.begin()->second; // there is only one triangle so far
-        Log() << Verbose(0) << "Current baseline is between " << *(baseline->second) << "." << endl;
+        DoLog(0) && (Log() << Verbose(0) << "Current baseline is between " << *(baseline->second) << "." << endl);
         for (int i = 0; i < 3; i++)
           if ((BTS->endpoints[i] != baseline->second->endpoints[0]) && (BTS->endpoints[i] != baseline->second->endpoints[1]))
             peak = BTS->endpoints[i];
-        Log() << Verbose(1) << " and has peak " << *peak << "." << endl;
+        DoLog(1) && (Log() << Verbose(1) << " and has peak " << *peak << "." << endl);
 
         // prepare some auxiliary vectors
@@ -1445,5 +1445,5 @@
           CenterVector.AddVector(BTS->endpoints[i]->node->node);
         CenterVector.Scale(1. / 3.);
-        Log() << Verbose(2) << "CenterVector of base triangle is " << CenterVector << endl;
+        DoLog(2) && (Log() << Verbose(2) << "CenterVector of base triangle is " << CenterVector << endl);
 
         // normal vector of triangle
@@ -1452,5 +1452,5 @@
         BTS->GetNormalVector(NormalVector);
         NormalVector.CopyVector(&BTS->NormalVector);
-        Log() << Verbose(2) << "NormalVector of base triangle is " << NormalVector << endl;
+        DoLog(2) && (Log() << Verbose(2) << "NormalVector of base triangle is " << NormalVector << endl);
 
         // vector in propagation direction (out of triangle)
@@ -1462,5 +1462,5 @@
         if (PropagationVector.ScalarProduct(&TempVector) > 0) // make sure normal propagation vector points outward from baseline
           PropagationVector.Scale(-1.);
-        Log() << Verbose(2) << "PropagationVector of base triangle is " << PropagationVector << endl;
+        DoLog(2) && (Log() << Verbose(2) << "PropagationVector of base triangle is " << PropagationVector << endl);
         winner = PointsOnBoundary.end();
 
@@ -1468,5 +1468,5 @@
         for (PointMap::iterator target = PointsOnBoundary.begin(); target != PointsOnBoundary.end(); target++) {
           if ((target->second != baseline->second->endpoints[0]) && (target->second != baseline->second->endpoints[1])) { // don't take the same endpoints
-            Log() << Verbose(1) << "Target point is " << *(target->second) << ":" << endl;
+            DoLog(1) && (Log() << Verbose(1) << "Target point is " << *(target->second) << ":" << endl);
 
             // first check direction, so that triangles don't intersect
@@ -1475,10 +1475,10 @@
             VirtualNormalVector.ProjectOntoPlane(&NormalVector);
             TempAngle = VirtualNormalVector.Angle(&PropagationVector);
-            Log() << Verbose(2) << "VirtualNormalVector is " << VirtualNormalVector << " and PropagationVector is " << PropagationVector << "." << endl;
+            DoLog(2) && (Log() << Verbose(2) << "VirtualNormalVector is " << VirtualNormalVector << " and PropagationVector is " << PropagationVector << "." << endl);
             if (TempAngle > (M_PI / 2.)) { // no bends bigger than Pi/2 (90 degrees)
-              Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", bad direction!" << endl;
+              DoLog(2) && (Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", bad direction!" << endl);
               continue;
             } else
-              Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", good direction!" << endl;
+              DoLog(2) && (Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", good direction!" << endl);
 
             // check first and second endpoint (if any connecting line goes to target has at least not more than 1 triangle)
@@ -1486,9 +1486,9 @@
             LineChecker[1] = baseline->second->endpoints[1]->lines.find(target->first);
             if (((LineChecker[0] != baseline->second->endpoints[0]->lines.end()) && (LineChecker[0]->second->triangles.size() == 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;
+              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);
               continue;
             }
             if (((LineChecker[1] != baseline->second->endpoints[1]->lines.end()) && (LineChecker[1]->second->triangles.size() == 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;
+              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);
               continue;
             }
@@ -1496,5 +1496,5 @@
             // check whether the envisaged triangle does not already exist (if both lines exist and have same endpoint)
             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)))) {
-              Log() << Verbose(4) << "Current target is peak!" << endl;
+              DoLog(4) && (Log() << Verbose(4) << "Current target is peak!" << endl);
               continue;
             }
@@ -1507,5 +1507,5 @@
             helper.ProjectOntoPlane(&TempVector);
             if (fabs(helper.NormSquared()) < MYEPSILON) {
-              Log() << Verbose(2) << "Chosen set of vectors is linear dependent." << endl;
+              DoLog(2) && (Log() << Verbose(2) << "Chosen set of vectors is linear dependent." << endl);
               continue;
             }
@@ -1524,9 +1524,9 @@
             // calculate angle
             TempAngle = NormalVector.Angle(&VirtualNormalVector);
-            Log() << Verbose(2) << "NormalVector is " << VirtualNormalVector << " and the angle is " << TempAngle << "." << endl;
+            DoLog(2) && (Log() << Verbose(2) << "NormalVector is " << VirtualNormalVector << " and the angle is " << TempAngle << "." << endl);
             if ((SmallestAngle - TempAngle) > MYEPSILON) { // set to new possible winner
               SmallestAngle = TempAngle;
               winner = target;
-              Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl;
+              DoLog(2) && (Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl);
             } else if (fabs(SmallestAngle - TempAngle) < MYEPSILON) { // check the angle to propagation, both possible targets are in one plane! (their normals have same angle)
               // hence, check the angles to some normal direction from our base line but in this common plane of both targets...
@@ -1546,9 +1546,9 @@
                 SmallestAngle = TempAngle;
                 winner = target;
-                Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle " << TempAngle << " to propagation direction." << endl;
+                DoLog(2) && (Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle " << TempAngle << " to propagation direction." << endl);
               } else
-                Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle to propagation direction." << endl;
+                DoLog(2) && (Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle to propagation direction." << endl);
             } else
-              Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl;
+              DoLog(2) && (Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl);
           }
         } // end of loop over all boundary points
@@ -1556,5 +1556,5 @@
         // 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
         if (winner != PointsOnBoundary.end()) {
-          Log() << Verbose(0) << "Winning target point is " << *(winner->second) << " with angle " << SmallestAngle << "." << endl;
+          DoLog(0) && (Log() << Verbose(0) << "Winning target point is " << *(winner->second) << " with angle " << SmallestAngle << "." << endl);
           // create the lins of not yet present
           BLS[0] = baseline->second;
@@ -1591,5 +1591,5 @@
         // 5d. If the set of lines is not yet empty, go to 5. and continue
       } else
-        Log() << Verbose(0) << "Baseline candidate " << *(baseline->second) << " has a triangle count of " << baseline->second->triangles.size() << "." << endl;
+        DoLog(0) && (Log() << Verbose(0) << "Baseline candidate " << *(baseline->second) << " has a triangle count of " << baseline->second->triangles.size() << "." << endl);
   } while (flag);
 
@@ -1624,25 +1624,25 @@
     }
     Walker = cloud->GetPoint();
-    Log() << Verbose(0) << "Current point is " << *Walker << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Current point is " << *Walker << "." << endl);
     // get the next triangle
     triangles = FindClosestTrianglesToVector(Walker->node, BoundaryPoints);
     BTS = triangles->front();
     if ((triangles == NULL) || (BTS->ContainsBoundaryPoint(Walker))) {
-      Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl;
+      DoLog(0) && (Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl);
       cloud->GoToNext();
       continue;
     } else {
     }
-    Log() << Verbose(0) << "Closest triangle is " << *BTS << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Closest triangle is " << *BTS << "." << endl);
     // get the intersection point
     if (BTS->GetIntersectionInsideTriangle(Center, Walker->node, &Intersection)) {
-      Log() << Verbose(0) << "We have an intersection at " << Intersection << "." << endl;
+      DoLog(0) && (Log() << Verbose(0) << "We have an intersection at " << Intersection << "." << endl);
       // we have the intersection, check whether in- or outside of boundary
       if ((Center->DistanceSquared(Walker->node) - Center->DistanceSquared(&Intersection)) < -MYEPSILON) {
         // inside, next!
-        Log() << Verbose(0) << *Walker << " is inside wrt triangle " << *BTS << "." << endl;
+        DoLog(0) && (Log() << Verbose(0) << *Walker << " is inside wrt triangle " << *BTS << "." << endl);
       } else {
         // outside!
-        Log() << Verbose(0) << *Walker << " is outside wrt triangle " << *BTS << "." << endl;
+        DoLog(0) && (Log() << Verbose(0) << *Walker << " is outside wrt triangle " << *BTS << "." << endl);
         class BoundaryLineSet *OldLines[3], *NewLines[3];
         class BoundaryPointSet *OldPoints[3], *NewPoint;
@@ -1654,5 +1654,5 @@
         Normal.CopyVector(&BTS->NormalVector);
         // add Walker to boundary points
-        Log() << Verbose(0) << "Adding " << *Walker << " to BoundaryPoints." << endl;
+        DoLog(0) && (Log() << Verbose(0) << "Adding " << *Walker << " to BoundaryPoints." << endl);
         AddFlag = true;
         if (AddBoundaryPoint(Walker, 0))
@@ -1661,5 +1661,5 @@
           continue;
         // remove triangle
-        Log() << Verbose(0) << "Erasing triangle " << *BTS << "." << endl;
+        DoLog(0) && (Log() << Verbose(0) << "Erasing triangle " << *BTS << "." << endl);
         TrianglesOnBoundary.erase(BTS->Nr);
         delete (BTS);
@@ -1669,5 +1669,5 @@
           BPS[1] = OldPoints[i];
           NewLines[i] = new class BoundaryLineSet(BPS, LinesOnBoundaryCount);
-          Log() << Verbose(1) << "Creating new line " << *NewLines[i] << "." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "Creating new line " << *NewLines[i] << "." << endl);
           LinesOnBoundary.insert(LinePair(LinesOnBoundaryCount, NewLines[i])); // no need for check for unique insertion as BPS[0] is definitely a new one
           LinesOnBoundaryCount++;
@@ -1691,5 +1691,5 @@
           BTS->GetNormalVector(Normal);
           Normal.Scale(-1.);
-          Log() << Verbose(0) << "Created new triangle " << *BTS << "." << endl;
+          DoLog(0) && (Log() << Verbose(0) << "Created new triangle " << *BTS << "." << endl);
           TrianglesOnBoundary.insert(TrianglePair(TrianglesOnBoundaryCount, BTS));
           TrianglesOnBoundaryCount++;
@@ -1746,5 +1746,5 @@
   } else {
     delete TPS[n];
-    Log() << Verbose(0) << "Node " << *((InsertUnique.first)->second->node) << " is already present in PointsOnBoundary." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Node " << *((InsertUnique.first)->second->node) << " is already present in PointsOnBoundary." << endl);
     TPS[n] = (InsertUnique.first)->second;
   }
@@ -1783,5 +1783,5 @@
   BoundaryLineSet *WinningLine = NULL;
   if (FindLine != a->lines.end()) {
-    Log() << Verbose(1) << "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << "." << endl);
 
     pair<LineMap::iterator, LineMap::iterator> FindPair;
@@ -1789,12 +1789,12 @@
 
     for (FindLine = FindPair.first; (FindLine != FindPair.second) && (insertNewLine); FindLine++) {
-      Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl);
       // If there is a line with less than two attached triangles, we don't need a new line.
       if (FindLine->second->triangles.size() == 1) {
         CandidateMap::iterator Finder = OpenLines.find(FindLine->second);
         if (!Finder->second->pointlist.empty())
-          Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl);
         else
-          Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate." << endl);
         // get open line
         for (TesselPointList::const_iterator CandidateChecker = Finder->second->pointlist.begin(); CandidateChecker != Finder->second->pointlist.end(); ++CandidateChecker) {
@@ -1828,5 +1828,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(0) << "Adding open line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Adding open line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << "." << endl);
   BPS[0] = a;
   BPS[1] = b;
@@ -1850,5 +1850,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(0) << "Using existing line " << *Line << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Using existing line " << *Line << endl);
 
   // set endpoints and line
@@ -1859,5 +1859,5 @@
   CandidateMap::iterator CandidateLine = OpenLines.find(BLS[n]);
   if (CandidateLine != OpenLines.end()) {
-    Log() << Verbose(1) << " Removing line from OpenLines." << endl;
+    DoLog(1) && (Log() << Verbose(1) << " Removing line from OpenLines." << endl);
     delete (CandidateLine->second);
     OpenLines.erase(CandidateLine);
@@ -1874,5 +1874,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl);
 
   // add triangle to global map
@@ -1894,5 +1894,5 @@
 {
   Info FunctionInfo(__func__);
-  Log() << Verbose(0) << "Adding triangle to global TrianglesOnBoundary map." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Adding triangle to global TrianglesOnBoundary map." << endl);
 
   // add triangle to global map
@@ -1918,15 +1918,15 @@
   for (int i = 0; i < 3; i++) {
     if (triangle->lines[i] != NULL) {
-      Log() << Verbose(0) << "Removing triangle Nr." << triangle->Nr << " in line " << *triangle->lines[i] << "." << endl;
+      DoLog(0) && (Log() << Verbose(0) << "Removing triangle Nr." << triangle->Nr << " in line " << *triangle->lines[i] << "." << endl);
       triangle->lines[i]->triangles.erase(triangle->Nr);
       if (triangle->lines[i]->triangles.empty()) {
-        Log() << Verbose(0) << *triangle->lines[i] << " is no more attached to any triangle, erasing." << endl;
+        DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is no more attached to any triangle, erasing." << endl);
         RemoveTesselationLine(triangle->lines[i]);
       } else {
-        Log() << Verbose(0) << *triangle->lines[i] << " is still attached to another triangle: ";
+        DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is still attached to another triangle: ");
         OpenLines.insert(pair<BoundaryLineSet *, CandidateForTesselation *> (triangle->lines[i], NULL));
         for (TriangleMap::iterator TriangleRunner = triangle->lines[i]->triangles.begin(); TriangleRunner != triangle->lines[i]->triangles.end(); TriangleRunner++)
-          Log() << Verbose(0) << "[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t";
-        Log() << Verbose(0) << endl;
+          DoLog(0) && (Log() << Verbose(0) << "[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t");
+        DoLog(0) && (Log() << Verbose(0) << endl);
         //        for (int j=0;j<2;j++) {
         //          Log() << Verbose(0) << "Lines of endpoint " << *(triangle->lines[i]->endpoints[j]) << ": ";
@@ -1942,5 +1942,5 @@
 
   if (TrianglesOnBoundary.erase(triangle->Nr))
-    Log() << Verbose(0) << "Removing triangle Nr. " << triangle->Nr << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Removing triangle Nr. " << triangle->Nr << "." << endl);
   delete (triangle);
 }
@@ -1974,5 +1974,5 @@
         for (LineMap::iterator Runner = erasor.first; Runner != erasor.second; Runner++)
           if ((*Runner).second == line) {
-            Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl;
+            DoLog(0) && (Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl);
             line->endpoints[i]->lines.erase(Runner);
             break;
@@ -1980,14 +1980,14 @@
       } else { // there's just a single line left
         if (line->endpoints[i]->lines.erase(line->Nr))
-          Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl;
+          DoLog(0) && (Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl);
       }
       if (line->endpoints[i]->lines.empty()) {
-        Log() << Verbose(0) << *line->endpoints[i] << " has no more lines it's attached to, erasing." << endl;
+        DoLog(0) && (Log() << Verbose(0) << *line->endpoints[i] << " has no more lines it's attached to, erasing." << endl);
         RemoveTesselationPoint(line->endpoints[i]);
       } else {
-        Log() << Verbose(0) << *line->endpoints[i] << " has still lines it's attached to: ";
+        DoLog(0) && (Log() << Verbose(0) << *line->endpoints[i] << " has still lines it's attached to: ");
         for (LineMap::iterator LineRunner = line->endpoints[i]->lines.begin(); LineRunner != line->endpoints[i]->lines.end(); LineRunner++)
-          Log() << Verbose(0) << "[" << *(LineRunner->second) << "] \t";
-        Log() << Verbose(0) << endl;
+          DoLog(0) && (Log() << Verbose(0) << "[" << *(LineRunner->second) << "] \t");
+        DoLog(0) && (Log() << Verbose(0) << endl);
       }
       line->endpoints[i] = NULL; // free'd or not: disconnect
@@ -1999,5 +1999,5 @@
 
   if (LinesOnBoundary.erase(line->Nr))
-    Log() << Verbose(0) << "Removing line Nr. " << line->Nr << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Removing line Nr. " << line->Nr << "." << endl);
   delete (line);
 }
@@ -2015,5 +2015,5 @@
     return;
   if (PointsOnBoundary.erase(point->Nr))
-    Log() << Verbose(0) << "Removing point Nr. " << point->Nr << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Removing point Nr. " << point->Nr << "." << endl);
   delete (point);
 }
@@ -2035,11 +2035,11 @@
   bool flag = true;
 
-  Log() << Verbose(1) << "Check by: draw sphere {" << CandidateLine.OtherOptCenter.x[0] << " " << CandidateLine.OtherOptCenter.x[1] << " " << CandidateLine.OtherOptCenter.x[2] << "} radius " << RADIUS << " resolution 30" << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Check by: draw sphere {" << CandidateLine.OtherOptCenter.x[0] << " " << CandidateLine.OtherOptCenter.x[1] << " " << CandidateLine.OtherOptCenter.x[2] << "} radius " << RADIUS << " resolution 30" << endl);
   // get all points inside the sphere
   TesselPointList *ListofPoints = LC->GetPointsInsideSphere(RADIUS, &CandidateLine.OtherOptCenter);
 
-  Log() << Verbose(1) << "The following atoms are inside sphere at " << CandidateLine.OtherOptCenter << ":" << endl;
+  DoLog(1) && (Log() << Verbose(1) << "The following atoms are inside sphere at " << CandidateLine.OtherOptCenter << ":" << endl);
   for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner)
-    Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl);
 
   // remove triangles's endpoints
@@ -2053,9 +2053,9 @@
   // check for other points
   if (!ListofPoints->empty()) {
-    Log() << Verbose(1) << "CheckDegeneracy: There are still " << ListofPoints->size() << " points inside the sphere." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "CheckDegeneracy: There are still " << ListofPoints->size() << " points inside the sphere." << endl);
     flag = false;
-    Log() << Verbose(1) << "External atoms inside of sphere at " << CandidateLine.OtherOptCenter << ":" << endl;
+    DoLog(1) && (Log() << Verbose(1) << "External atoms inside of sphere at " << CandidateLine.OtherOptCenter << ":" << endl);
     for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner)
-      Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "  " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl);
   }
   delete (ListofPoints);
@@ -2098,5 +2098,5 @@
           for (; (FindLine != Points[i]->lines.end()) && (FindLine->first == Points[j]->node->nr); FindLine++) {
             TriangleMap *triangles = &FindLine->second->triangles;
-            Log() << Verbose(1) << "Current line is " << FindLine->first << ": " << *(FindLine->second) << " with triangles " << triangles << "." << endl;
+            DoLog(1) && (Log() << Verbose(1) << "Current line is " << FindLine->first << ": " << *(FindLine->second) << " with triangles " << triangles << "." << endl);
             for (TriangleMap::const_iterator FindTriangle = triangles->begin(); FindTriangle != triangles->end(); FindTriangle++) {
               if (FindTriangle->second->IsPresentTupel(Points)) {
@@ -2104,5 +2104,5 @@
               }
             }
-            Log() << Verbose(1) << "end." << endl;
+            DoLog(1) && (Log() << Verbose(1) << "end." << endl);
           }
           // Only one of the triangle lines must be considered for the triangle count.
@@ -2114,5 +2114,5 @@
   }
 
-  Log() << Verbose(0) << "Found " << adjacentTriangleCount << " adjacent triangles for the point set." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Found " << adjacentTriangleCount << " adjacent triangles for the point set." << endl);
   return adjacentTriangleCount;
 }
@@ -2211,5 +2211,5 @@
           for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
             if ((*Runner)->node->x[i] > maxCoordinate[i]) {
-              Log() << Verbose(1) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl;
+              DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl);
               maxCoordinate[i] = (*Runner)->node->x[i];
               MaxPoint[i] = (*Runner);
@@ -2222,8 +2222,8 @@
   }
 
-  Log() << Verbose(1) << "Found maximum coordinates: ";
+  DoLog(1) && (Log() << Verbose(1) << "Found maximum coordinates: ");
   for (int i = 0; i < NDIM; i++)
-    Log() << Verbose(0) << i << ": " << *MaxPoint[i] << "\t";
-  Log() << Verbose(0) << endl;
+    DoLog(0) && (Log() << Verbose(0) << i << ": " << *MaxPoint[i] << "\t");
+  DoLog(0) && (Log() << Verbose(0) << endl);
 
   BTS = NULL;
@@ -2233,5 +2233,5 @@
     BaseLine = new BoundaryLineSet();
     BaseLine->endpoints[0] = new BoundaryPointSet(MaxPoint[k]);
-    Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl);
 
     double ShortestAngle;
@@ -2271,13 +2271,13 @@
 
     // adding point 1 and point 2 and add the line between them
-    Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl;
-    Log() << Verbose(0) << "Found second point is at " << *BaseLine->endpoints[1]->node << ".\n";
+    DoLog(0) && (Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl);
+    DoLog(0) && (Log() << Verbose(0) << "Found second point is at " << *BaseLine->endpoints[1]->node << ".\n");
 
     //Log() << Verbose(1) << "INFO: OldSphereCenter is at " << helper << ".\n";
     CandidateForTesselation OptCandidates(BaseLine);
     FindThirdPointForTesselation(NormalVector, SearchDirection, SphereCenter, OptCandidates, NULL, RADIUS, LC);
-    Log() << Verbose(0) << "List of third Points is:" << endl;
+    DoLog(0) && (Log() << Verbose(0) << "List of third Points is:" << endl);
     for (TesselPointList::iterator it = OptCandidates.pointlist.begin(); it != OptCandidates.pointlist.end(); it++) {
-      Log() << Verbose(0) << " " << *(*it) << endl;
+      DoLog(0) && (Log() << Verbose(0) << " " << *(*it) << endl);
     }
     if (!OptCandidates.pointlist.empty()) {
@@ -2465,5 +2465,5 @@
       break;
     }
-  Log() << Verbose(0) << "Current baseline is " << *CandidateLine.BaseLine << " with ThirdPoint " << *ThirdPoint << " of triangle " << T << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Current baseline is " << *CandidateLine.BaseLine << " with ThirdPoint " << *ThirdPoint << " of triangle " << T << "." << endl);
 
   CandidateLine.T = &T;
@@ -2487,7 +2487,7 @@
     CircleRadius = RADIUS * RADIUS - radius / 4.;
     CirclePlaneNormal.Normalize();
-    Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
-
-    Log() << Verbose(1) << "INFO: OldSphereCenter is at " << T.SphereCenter << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl);
+
+    DoLog(1) && (Log() << Verbose(1) << "INFO: OldSphereCenter is at " << T.SphereCenter << "." << endl);
 
     // construct SearchDirection and an "outward pointer"
@@ -2497,5 +2497,5 @@
     if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON)// ohoh, SearchDirection points inwards!
       SearchDirection.Scale(-1.);
-    Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl);
     if (fabs(RelativeSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {
       // rotated the wrong way!
@@ -2507,5 +2507,5 @@
 
   } else {
-    Log() << Verbose(0) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and base triangle " << T << " is too big!" << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and base triangle " << T << " is too big!" << endl);
   }
 
@@ -2514,7 +2514,7 @@
     return false;
   }
-  Log() << Verbose(0) << "Third Points are: " << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Third Points are: " << endl);
   for (TesselPointList::iterator it = CandidateLine.pointlist.begin(); it != CandidateLine.pointlist.end(); ++it) {
-    Log() << Verbose(0) << " " << *(*it) << endl;
+    DoLog(0) && (Log() << Verbose(0) << " " << *(*it) << endl);
   }
 
@@ -2539,5 +2539,5 @@
     if (baseline->pointlist.empty()) {
       T = (((baseline->BaseLine->triangles.begin()))->second);
-      Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl;
+      DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl);
       TesselationFailFlag = TesselationFailFlag && FindNextSuitableTriangle(*baseline, *T, RADIUS, LCList); //the line is there, so there is a triangle, but only one.
     }
@@ -2569,7 +2569,7 @@
   TesselPointList *connectedClosestPoints = GetCircleOfSetOfPoints(&SetOfNeighbours, TurningPoint, CandidateLine.BaseLine->endpoints[1]->node->node);
 
-  Log() << Verbose(0) << "List of Candidates for Turning Point " << *TurningPoint << ":" << endl;
+  DoLog(0) && (Log() << Verbose(0) << "List of Candidates for Turning Point " << *TurningPoint << ":" << endl);
   for (TesselPointList::iterator TesselRunner = connectedClosestPoints->begin(); TesselRunner != connectedClosestPoints->end(); ++TesselRunner)
-    Log() << Verbose(0) << " " << **TesselRunner << endl;
+    DoLog(0) && (Log() << Verbose(0) << " " << **TesselRunner << endl);
 
   // go through all angle-sorted candidates (in degenerate n-nodes case we may have to add multiple triangles)
@@ -2578,5 +2578,5 @@
   Sprinter++;
   while (Sprinter != connectedClosestPoints->end()) {
-    Log() << Verbose(0) << "Current Runner is " << *(*Runner) << " and sprinter is " << *(*Sprinter) << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Current Runner is " << *(*Runner) << " and sprinter is " << *(*Sprinter) << "." << endl);
 
     AddTesselationPoint(TurningPoint, 0);
@@ -2591,5 +2591,5 @@
       // fill the internal open lines with its respective candidate (otherwise lines in degenerate case are not picked)
       FindDegeneratedCandidatesforOpenLines(*Sprinter, &CandidateLine.OptCenter);
-      Log() << Verbose(0) << " There are still more triangles to add." << endl;
+      DoLog(0) && (Log() << Verbose(0) << " There are still more triangles to add." << endl);
     }
     // pick candidates for other open lines as well
@@ -2599,5 +2599,5 @@
     if (CheckDegeneracy(CandidateLine, RADIUS, LC)) {
       // add normal and degenerate triangles
-      Log() << Verbose(1) << "Triangle of endpoints " << *TPS[0] << "," << *TPS[1] << " and " << *TPS[2] << " is degenerated, adding both sides." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "Triangle of endpoints " << *TPS[0] << "," << *TPS[1] << " and " << *TPS[2] << " is degenerated, adding both sides." << endl);
       AddCandidateTriangle(CandidateLine, OtherOpt);
 
@@ -2623,12 +2623,12 @@
   pair<LineMap::iterator, LineMap::iterator> FindPair = TPS[0]->lines.equal_range(TPS[2]->node->nr);
   for (LineMap::const_iterator FindLine = FindPair.first; FindLine != FindPair.second; FindLine++) {
-    Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl);
     // If there is a line with less than two attached triangles, we don't need a new line.
     if (FindLine->second->triangles.size() == 1) {
       CandidateMap::iterator Finder = OpenLines.find(FindLine->second);
       if (!Finder->second->pointlist.empty())
-        Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl;
+        DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl);
       else {
-        Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate, setting to next Sprinter" << (*Sprinter) << endl;
+        DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate, setting to next Sprinter" << (*Sprinter) << endl);
         Finder->second->pointlist.push_back(Sprinter);
         Finder->second->ShortestAngle = 0.;
@@ -2654,13 +2654,13 @@
 
   /// 1. Create or pick the lines for the first triangle
-  Log() << Verbose(0) << "INFO: Creating/Picking lines for first triangle ..." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Creating/Picking lines for first triangle ..." << endl);
   for (int i = 0; i < 3; i++) {
     BLS[i] = NULL;
-    Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
     AddTesselationLine(&CandidateLine.OptCenter, TPS[(i + 2) % 3], TPS[(i + 0) % 3], TPS[(i + 1) % 3], i);
   }
 
   /// 2. create the first triangle and NormalVector and so on
-  Log() << Verbose(0) << "INFO: Adding first triangle with center at " << CandidateLine.OptCenter << " ..." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Adding first triangle with center at " << CandidateLine.OptCenter << " ..." << endl);
   BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
   AddTesselationTriangle();
@@ -2673,13 +2673,13 @@
   // give some verbose output about the whole procedure
   if (CandidateLine.T != NULL)
-    Log() << Verbose(0) << "--> New triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "--> New triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl);
   else
-    Log() << Verbose(0) << "--> New starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "--> New starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl);
   triangle = BTS;
 
   /// 3. Gather candidates for each new line
-  Log() << Verbose(0) << "INFO: Adding candidates to new lines ..." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Adding candidates to new lines ..." << endl);
   for (int i = 0; i < 3; i++) {
-    Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
     CandidateCheck = OpenLines.find(BLS[i]);
     if ((CandidateCheck != OpenLines.end()) && (CandidateCheck->second->pointlist.empty())) {
@@ -2691,12 +2691,12 @@
 
   /// 4. Create or pick the lines for the second triangle
-  Log() << Verbose(0) << "INFO: Creating/Picking lines for second triangle ..." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Creating/Picking lines for second triangle ..." << endl);
   for (int i = 0; i < 3; i++) {
-    Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
     AddTesselationLine(&CandidateLine.OtherOptCenter, TPS[(i + 2) % 3], TPS[(i + 0) % 3], TPS[(i + 1) % 3], i);
   }
 
   /// 5. create the second triangle and NormalVector and so on
-  Log() << Verbose(0) << "INFO: Adding second triangle with center at " << CandidateLine.OtherOptCenter << " ..." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Adding second triangle with center at " << CandidateLine.OtherOptCenter << " ..." << endl);
   BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
   AddTesselationTriangle();
@@ -2708,12 +2708,12 @@
   // give some verbose output about the whole procedure
   if (CandidateLine.T != NULL)
-    Log() << Verbose(0) << "--> New degenerate triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "--> New degenerate triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl);
   else
-    Log() << Verbose(0) << "--> New degenerate starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "--> New degenerate starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl);
 
   /// 6. Adding triangle to new lines
-  Log() << Verbose(0) << "INFO: Adding second triangles to new lines ..." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Adding second triangles to new lines ..." << endl);
   for (int i = 0; i < 3; i++) {
-    Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl);
     CandidateCheck = OpenLines.find(BLS[i]);
     if ((CandidateCheck != OpenLines.end()) && (CandidateCheck->second->pointlist.empty())) {
@@ -2753,7 +2753,7 @@
   // give some verbose output about the whole procedure
   if (CandidateLine.T != NULL)
-    Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl;
+    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);
   else
-    Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl);
 }
 ;
@@ -2780,6 +2780,6 @@
   OtherBase = new class BoundaryLineSet(BPS, -1);
 
-  Log() << Verbose(1) << "INFO: Current base line is " << *Base << "." << endl;
-  Log() << Verbose(1) << "INFO: Other base line is " << *OtherBase << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Current base line is " << *Base << "." << endl);
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Other base line is " << *OtherBase << "." << endl);
 
   // get the closest point on each line to the other line
@@ -2801,5 +2801,5 @@
   delete (ClosestPoint);
   if ((distance[0] * distance[1]) > 0) { // have same sign?
-    Log() << Verbose(1) << "REJECT: Both SKPs have same sign: " << distance[0] << " and " << distance[1] << ". " << *Base << "' rectangle is concave." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "REJECT: Both SKPs have same sign: " << distance[0] << " and " << distance[1] << ". " << *Base << "' rectangle is concave." << endl);
     if (distance[0] < distance[1]) {
       Spot = Base->endpoints[0];
@@ -2809,5 +2809,5 @@
     return Spot;
   } else { // different sign, i.e. we are in between
-    Log() << Verbose(0) << "ACCEPT: Rectangle of triangles of base line " << *Base << " is convex." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Rectangle of triangles of base line " << *Base << " is convex." << endl);
     return NULL;
   }
@@ -2820,7 +2820,7 @@
   Info FunctionInfo(__func__);
   // print all lines
-  Log() << Verbose(0) << "Printing all boundary points for debugging:" << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Printing all boundary points for debugging:" << endl);
   for (PointMap::const_iterator PointRunner = PointsOnBoundary.begin(); PointRunner != PointsOnBoundary.end(); PointRunner++)
-    Log() << Verbose(0) << *(PointRunner->second) << endl;
+    DoLog(0) && (Log() << Verbose(0) << *(PointRunner->second) << endl);
 }
 ;
@@ -2830,7 +2830,7 @@
   Info FunctionInfo(__func__);
   // print all lines
-  Log() << Verbose(0) << "Printing all boundary lines for debugging:" << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Printing all boundary lines for debugging:" << endl);
   for (LineMap::const_iterator LineRunner = LinesOnBoundary.begin(); LineRunner != LinesOnBoundary.end(); LineRunner++)
-    Log() << Verbose(0) << *(LineRunner->second) << endl;
+    DoLog(0) && (Log() << Verbose(0) << *(LineRunner->second) << endl);
 }
 ;
@@ -2840,7 +2840,7 @@
   Info FunctionInfo(__func__);
   // print all triangles
-  Log() << Verbose(0) << "Printing all boundary triangles for debugging:" << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Printing all boundary triangles for debugging:" << endl);
   for (TriangleMap::const_iterator TriangleRunner = TrianglesOnBoundary.begin(); TriangleRunner != TrianglesOnBoundary.end(); TriangleRunner++)
-    Log() << Verbose(0) << *(TriangleRunner->second) << endl;
+    DoLog(0) && (Log() << Verbose(0) << *(TriangleRunner->second) << endl);
 }
 ;
@@ -2865,6 +2865,6 @@
   OtherBase = new class BoundaryLineSet(BPS, -1);
 
-  Log() << Verbose(0) << "INFO: Current base line is " << *Base << "." << endl;
-  Log() << Verbose(0) << "INFO: Other base line is " << *OtherBase << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Current base line is " << *Base << "." << endl);
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Other base line is " << *OtherBase << "." << endl);
 
   // get the closest point on each line to the other line
@@ -2886,5 +2886,5 @@
 
   if (Distance.NormSquared() < MYEPSILON) { // check for intersection
-    Log() << Verbose(0) << "REJECT: Both lines have an intersection: Nothing to do." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "REJECT: Both lines have an intersection: Nothing to do." << endl);
     return false;
   } else { // check for sign against BaseLineNormal
@@ -2896,5 +2896,5 @@
     }
     for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) {
-      Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl);
       BaseLineNormal.AddVector(&(runner->second->NormalVector));
     }
@@ -2902,9 +2902,9 @@
 
     if (Distance.ScalarProduct(&BaseLineNormal) > MYEPSILON) { // Distance points outwards, hence OtherBase higher than Base -> flip
-      Log() << Verbose(0) << "ACCEPT: Other base line would be higher: Flipping baseline." << endl;
+      DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Other base line would be higher: Flipping baseline." << endl);
       // calculate volume summand as a general tetraeder
       return volume;
     } else { // Base higher than OtherBase -> do nothing
-      Log() << Verbose(0) << "REJECT: Base line is higher: Nothing to do." << endl;
+      DoLog(0) && (Log() << Verbose(0) << "REJECT: Base line is higher: Nothing to do." << endl);
       return 0.;
     }
@@ -2936,5 +2936,5 @@
   }
   for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) {
-    Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl);
     BaseLineNormal.AddVector(&(runner->second->NormalVector));
   }
@@ -2949,20 +2949,20 @@
   i = 0;
   m = 0;
-  Log() << Verbose(0) << "The four old lines are: ";
+  DoLog(0) && (Log() << Verbose(0) << "The four old lines are: ");
   for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++)
     for (int j = 0; j < 3; j++) // all of their endpoints and baselines
       if (runner->second->lines[j] != Base) { // pick not the central baseline
         OldLines[i++] = runner->second->lines[j];
-        Log() << Verbose(0) << *runner->second->lines[j] << "\t";
+        DoLog(0) && (Log() << Verbose(0) << *runner->second->lines[j] << "\t");
       }
-  Log() << Verbose(0) << endl;
-  Log() << Verbose(0) << "The two old points are: ";
+  DoLog(0) && (Log() << Verbose(0) << endl);
+  DoLog(0) && (Log() << Verbose(0) << "The two old points are: ");
   for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++)
     for (int j = 0; j < 3; j++) // all of their endpoints and baselines
       if (!Base->ContainsBoundaryPoint(runner->second->endpoints[j])) { // and neither of its endpoints
         OldPoints[m++] = runner->second->endpoints[j];
-        Log() << Verbose(0) << *runner->second->endpoints[j] << "\t";
+        DoLog(0) && (Log() << Verbose(0) << *runner->second->endpoints[j] << "\t");
       }
-  Log() << Verbose(0) << endl;
+  DoLog(0) && (Log() << Verbose(0) << endl);
 
   // check whether everything is in place to create new lines and triangles
@@ -2983,9 +2983,9 @@
 
   // remove triangles and baseline removes itself
-  Log() << Verbose(0) << "INFO: Deleting baseline " << *Base << " from global list." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting baseline " << *Base << " from global list." << endl);
   OldBaseLineNr = Base->Nr;
   m = 0;
   for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) {
-    Log() << Verbose(0) << "INFO: Deleting triangle " << *(runner->second) << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting triangle " << *(runner->second) << "." << endl);
     OldTriangleNrs[m++] = runner->second->Nr;
     RemoveTesselationTriangle(runner->second);
@@ -2997,5 +2997,5 @@
   NewLine = new class BoundaryLineSet(BPS, OldBaseLineNr);
   LinesOnBoundary.insert(LinePair(OldBaseLineNr, NewLine)); // no need for check for unique insertion as NewLine is definitely a new one
-  Log() << Verbose(0) << "INFO: Created new baseline " << *NewLine << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "INFO: Created new baseline " << *NewLine << "." << endl);
 
   // construct new triangles with flipped baseline
@@ -3012,5 +3012,5 @@
     BTS->GetNormalVector(BaseLineNormal);
     AddTesselationTriangle(OldTriangleNrs[0]);
-    Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl);
 
     BLS[0] = (i == 2 ? OldLines[3] : OldLines[2]);
@@ -3020,5 +3020,5 @@
     BTS->GetNormalVector(BaseLineNormal);
     AddTesselationTriangle(OldTriangleNrs[1]);
-    Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl);
   } else {
     DoeLog(0) && (eLog() << Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl);
@@ -3061,5 +3061,5 @@
     Nupper[i] = ((N[i] + 1) < LC->N[i]) ? N[i] + 1 : LC->N[i] - 1;
   }
-  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;
+  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);
 
   for (LC->n[0] = Nlower[0]; LC->n[0] <= Nupper[0]; LC->n[0]++)
@@ -3099,5 +3099,5 @@
                 if (angle < Storage[0]) {
                   //Log() << Verbose(1) << "Old values of Storage: %lf %lf \n", Storage[0], Storage[1]);
-                  Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".\n";
+                  DoLog(1) && (Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".\n");
                   OptCandidate = Candidate;
                   Storage[0] = angle;
@@ -3114,5 +3114,5 @@
           }
         } else {
-          Log() << Verbose(0) << "Linked cell list is empty." << endl;
+          DoLog(0) && (Log() << Verbose(0) << "Linked cell list is empty." << endl);
         }
       }
@@ -3169,5 +3169,5 @@
   TesselPoint *Candidate = NULL;
 
-  Log() << Verbose(1) << "INFO: NormalVector of BaseTriangle is " << NormalVector << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of BaseTriangle is " << NormalVector << "." << endl);
 
   // copy old center
@@ -3193,5 +3193,5 @@
     CircleRadius = RADIUS * RADIUS - radius;
     CirclePlaneNormal.Normalize();
-    Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl);
 
     // test whether old center is on the band's plane
@@ -3202,8 +3202,8 @@
     radius = RelativeOldSphereCenter.NormSquared();
     if (fabs(radius - CircleRadius) < HULLEPSILON) {
-      Log() << Verbose(1) << "INFO: RelativeOldSphereCenter is at " << RelativeOldSphereCenter << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "INFO: RelativeOldSphereCenter is at " << RelativeOldSphereCenter << "." << endl);
 
       // check SearchDirection
-      Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl);
       if (fabs(RelativeOldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { // rotated the wrong way!
         DoeLog(1) && (eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl);
@@ -3237,17 +3237,17 @@
 
                 // check for three unique points
-                Log() << Verbose(2) << "INFO: Current Candidate is " << *Candidate << " for BaseLine " << *CandidateLine.BaseLine << " with OldSphereCenter " << OldSphereCenter << "." << endl;
+                DoLog(2) && (Log() << Verbose(2) << "INFO: Current Candidate is " << *Candidate << " for BaseLine " << *CandidateLine.BaseLine << " with OldSphereCenter " << OldSphereCenter << "." << endl);
                 if ((Candidate != CandidateLine.BaseLine->endpoints[0]->node) && (Candidate != CandidateLine.BaseLine->endpoints[1]->node)) {
 
                   // find center on the plane
                   GetCenterofCircumcircle(&NewPlaneCenter, *CandidateLine.BaseLine->endpoints[0]->node->node, *CandidateLine.BaseLine->endpoints[1]->node->node, *Candidate->node);
-                  Log() << Verbose(1) << "INFO: NewPlaneCenter is " << NewPlaneCenter << "." << endl;
+                  DoLog(1) && (Log() << Verbose(1) << "INFO: NewPlaneCenter is " << NewPlaneCenter << "." << endl);
 
                   if (NewNormalVector.MakeNormalVector(CandidateLine.BaseLine->endpoints[0]->node->node, CandidateLine.BaseLine->endpoints[1]->node->node, Candidate->node) && (fabs(NewNormalVector.NormSquared()) > HULLEPSILON)) {
-                    Log() << Verbose(1) << "INFO: NewNormalVector is " << NewNormalVector << "." << endl;
+                    DoLog(1) && (Log() << Verbose(1) << "INFO: NewNormalVector is " << NewNormalVector << "." << endl);
                     radius = CandidateLine.BaseLine->endpoints[0]->node->node->DistanceSquared(&NewPlaneCenter);
-                    Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;
-                    Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
-                    Log() << Verbose(1) << "INFO: Radius of CircumCenterCircle is " << radius << "." << endl;
+                    DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl);
+                    DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl);
+                    DoLog(1) && (Log() << Verbose(1) << "INFO: Radius of CircumCenterCircle is " << radius << "." << endl);
                     if (radius < RADIUS * RADIUS) {
                       otherradius = CandidateLine.BaseLine->endpoints[1]->node->node->DistanceSquared(&NewPlaneCenter);
@@ -3260,11 +3260,11 @@
                       helper.CopyVector(&NewNormalVector);
                       helper.Scale(sqrt(RADIUS * RADIUS - radius));
-                      Log() << Verbose(2) << "INFO: Distance of NewPlaneCenter " << NewPlaneCenter << " to either NewSphereCenter is " << helper.Norm() << " of vector " << helper << " with sphere radius " << RADIUS << "." << endl;
+                      DoLog(2) && (Log() << Verbose(2) << "INFO: Distance of NewPlaneCenter " << NewPlaneCenter << " to either NewSphereCenter is " << helper.Norm() << " of vector " << helper << " with sphere radius " << RADIUS << "." << endl);
                       NewSphereCenter.AddVector(&helper);
-                      Log() << Verbose(2) << "INFO: NewSphereCenter is at " << NewSphereCenter << "." << endl;
+                      DoLog(2) && (Log() << Verbose(2) << "INFO: NewSphereCenter is at " << NewSphereCenter << "." << endl);
                       // OtherNewSphereCenter is created by the same vector just in the other direction
                       helper.Scale(-1.);
                       OtherNewSphereCenter.AddVector(&helper);
-                      Log() << Verbose(2) << "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << "." << endl;
+                      DoLog(2) && (Log() << Verbose(2) << "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << "." << endl);
 
                       alpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, NewSphereCenter, OldSphereCenter, NormalVector, SearchDirection);
@@ -3285,31 +3285,31 @@
                         if ((CandidateLine.ShortestAngle - HULLEPSILON) < alpha) {
                           CandidateLine.pointlist.push_back(Candidate);
-                          Log() << Verbose(0) << "ACCEPT: We have found an equally good candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl;
+                          DoLog(0) && (Log() << Verbose(0) << "ACCEPT: We have found an equally good candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl);
                         } else {
                           // remove all candidates from the list and then the list itself
                           CandidateLine.pointlist.clear();
                           CandidateLine.pointlist.push_back(Candidate);
-                          Log() << Verbose(0) << "ACCEPT: We have found a better candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl;
+                          DoLog(0) && (Log() << Verbose(0) << "ACCEPT: We have found a better candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl);
                         }
                         CandidateLine.ShortestAngle = alpha;
-                        Log() << Verbose(0) << "INFO: There are " << CandidateLine.pointlist.size() << " candidates in the list now." << endl;
+                        DoLog(0) && (Log() << Verbose(0) << "INFO: There are " << CandidateLine.pointlist.size() << " candidates in the list now." << endl);
                       } else {
                         if ((Candidate != NULL) && (CandidateLine.pointlist.begin() != CandidateLine.pointlist.end())) {
-                          Log() << Verbose(1) << "REJECT: Old candidate " << *(*CandidateLine.pointlist.begin()) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " ." << endl;
+                          DoLog(1) && (Log() << Verbose(1) << "REJECT: Old candidate " << *(*CandidateLine.pointlist.begin()) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " ." << endl);
                         } else {
-                          Log() << Verbose(1) << "REJECT: Candidate " << *Candidate << " with " << alpha << " was rejected." << endl;
+                          DoLog(1) && (Log() << Verbose(1) << "REJECT: Candidate " << *Candidate << " with " << alpha << " was rejected." << endl);
                         }
                       }
                     } else {
-                      Log() << Verbose(1) << "REJECT: NewSphereCenter " << NewSphereCenter << " for " << *Candidate << " is too far away: " << radius << "." << endl;
+                      DoLog(1) && (Log() << Verbose(1) << "REJECT: NewSphereCenter " << NewSphereCenter << " for " << *Candidate << " is too far away: " << radius << "." << endl);
                     }
                   } else {
-                    Log() << Verbose(1) << "REJECT: Three points from " << *CandidateLine.BaseLine << " and Candidate " << *Candidate << " are linear-dependent." << endl;
+                    DoLog(1) && (Log() << Verbose(1) << "REJECT: Three points from " << *CandidateLine.BaseLine << " and Candidate " << *Candidate << " are linear-dependent." << endl);
                   }
                 } else {
                   if (ThirdPoint != NULL) {
-                    Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " and " << *ThirdPoint << " contains Candidate " << *Candidate << "." << endl;
+                    DoLog(1) && (Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " and " << *ThirdPoint << " contains Candidate " << *Candidate << "." << endl);
                   } else {
-                    Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " contains Candidate " << *Candidate << "." << endl;
+                    DoLog(1) && (Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " contains Candidate " << *Candidate << "." << endl);
                   }
                 }
@@ -3322,7 +3322,7 @@
   } else {
     if (ThirdPoint != NULL)
-      Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and third node " << *ThirdPoint << " is too big!" << endl;
+      DoLog(1) && (Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and third node " << *ThirdPoint << " is too big!" << endl);
     else
-      Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " is too big!" << endl;
+      DoLog(1) && (Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " is too big!" << endl);
   }
 
@@ -3358,5 +3358,5 @@
       if (!OrderTest.second) { // if insertion fails, we have common endpoint
         node = OrderTest.first->second;
-        Log() << Verbose(1) << "Common endpoint of lines " << *line1 << " and " << *line2 << " is: " << *node << "." << endl;
+        DoLog(1) && (Log() << Verbose(1) << "Common endpoint of lines " << *line1 << " and " << *line2 << " is: " << *node << "." << endl);
         j = 2;
         i = 2;
@@ -3388,5 +3388,5 @@
   for (int i = 0; i < NDIM; i++) // store indices of this cell
     N[i] = LC->n[i];
-  Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl);
   DistanceToPointMap * points = new DistanceToPointMap;
   LC->GetNeighbourBounds(Nlower, Nupper);
@@ -3402,5 +3402,5 @@
             if (FindPoint != PointsOnBoundary.end()) {
               points->insert(DistanceToPointPair(FindPoint->second->node->node->DistanceSquared(x), FindPoint->second));
-              Log() << Verbose(1) << "INFO: Putting " << *FindPoint->second << " into the list." << endl;
+              DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *FindPoint->second << " into the list." << endl);
             }
           }
@@ -3436,5 +3436,5 @@
 
   // for each point, check its lines, remember closest
-  Log() << Verbose(1) << "Finding closest BoundaryLine to " << *x << " ... " << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Finding closest BoundaryLine to " << *x << " ... " << endl);
   BoundaryLineSet *ClosestLine = NULL;
   double MinDistance = -1.;
@@ -3467,10 +3467,10 @@
           ClosestLine = LineRunner->second;
           MinDistance = distance;
-          Log() << Verbose(1) << "ACCEPT: New closest line is " << *ClosestLine << " with projected distance " << MinDistance << "." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "ACCEPT: New closest line is " << *ClosestLine << " with projected distance " << MinDistance << "." << endl);
         } else {
-          Log() << Verbose(1) << "REJECT: Intersection is outside of the line section: " << lengthA << " and " << lengthB << "." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "REJECT: Intersection is outside of the line section: " << lengthA << " and " << lengthB << "." << endl);
         }
       } else {
-        Log() << Verbose(1) << "REJECT: Point is too further away than present line: " << distance << " >> " << MinDistance << "." << endl;
+        DoLog(1) && (Log() << Verbose(1) << "REJECT: Point is too further away than present line: " << distance << " >> " << MinDistance << "." << endl);
       }
     }
@@ -3479,5 +3479,5 @@
   // check whether closest line is "too close" :), then it's inside
   if (ClosestLine == NULL) {
-    Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl);
     return NULL;
   }
@@ -3502,5 +3502,5 @@
 
   // for each point, check its lines, remember closest
-  Log() << Verbose(1) << "Finding closest BoundaryTriangle to " << *x << " ... " << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Finding closest BoundaryTriangle to " << *x << " ... " << endl);
   LineSet ClosestLines;
   double MinDistance = 1e+16;
@@ -3530,10 +3530,10 @@
           ClosestLines.insert(LineRunner->second);
           MinDistance = lengthEnd;
-          Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[0]->node << " is closer with " << lengthEnd << "." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[0]->node << " is closer with " << lengthEnd << "." << endl);
         } else if (fabs(lengthEnd - MinDistance) < MYEPSILON) { // additional best candidate
           ClosestLines.insert(LineRunner->second);
-          Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[1]->node << " is equally good with " << lengthEnd << "." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[1]->node << " is equally good with " << lengthEnd << "." << endl);
         } else { // line is worse
-          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;
+          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);
         }
       } else { // intersection is closer, calculate
@@ -3551,7 +3551,7 @@
           ClosestLines.insert(LineRunner->second);
           MinDistance = distance;
-          Log() << Verbose(1) << "ACCEPT: Intersection in between endpoints, new closest line " << *LineRunner->second << " is " << *ClosestLines.begin() << " with projected distance " << MinDistance << "." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Intersection in between endpoints, new closest line " << *LineRunner->second << " is " << *ClosestLines.begin() << " with projected distance " << MinDistance << "." << endl);
         } else {
-          Log() << Verbose(2) << "REJECT: Point is further away from line " << *LineRunner->second << " than present closest line: " << distance << " >> " << MinDistance << "." << endl;
+          DoLog(2) && (Log() << Verbose(2) << "REJECT: Point is further away from line " << *LineRunner->second << " than present closest line: " << distance << " >> " << MinDistance << "." << endl);
         }
       }
@@ -3562,5 +3562,5 @@
   // check whether closest line is "too close" :), then it's inside
   if (ClosestLines.empty()) {
-    Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl);
     return NULL;
   }
@@ -3603,7 +3603,7 @@
       result = *Runner;
       MinAlignment = Alignment;
-      Log() << Verbose(1) << "ACCEPT: Triangle " << *result << " is better aligned with " << MinAlignment << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Triangle " << *result << " is better aligned with " << MinAlignment << "." << endl);
     } else {
-      Log() << Verbose(1) << "REJECT: Triangle " << *result << " is worse aligned with " << MinAlignment << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "REJECT: Triangle " << *result << " is worse aligned with " << MinAlignment << "." << endl);
     }
   }
@@ -3658,15 +3658,15 @@
 
   if (triangle == NULL) {// is boundary point or only point in point cloud?
-    Log() << Verbose(1) << "No triangle given!" << endl;
+    DoLog(1) && (Log() << Verbose(1) << "No triangle given!" << endl);
     return -1.;
   } else {
-    Log() << Verbose(1) << "INFO: Closest triangle found is " << *triangle << " with normal vector " << triangle->NormalVector << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: Closest triangle found is " << *triangle << " with normal vector " << triangle->NormalVector << "." << endl);
   }
 
   triangle->GetCenter(&Center);
-  Log() << Verbose(2) << "INFO: Central point of the triangle is " << Center << "." << endl;
+  DoLog(2) && (Log() << Verbose(2) << "INFO: Central point of the triangle is " << Center << "." << endl);
   DistanceToCenter.CopyVector(&Center);
   DistanceToCenter.SubtractVector(&Point);
-  Log() << Verbose(2) << "INFO: Vector from point to test to center is " << DistanceToCenter << "." << endl;
+  DoLog(2) && (Log() << Verbose(2) << "INFO: Vector from point to test to center is " << DistanceToCenter << "." << endl);
 
   // check whether we are on boundary
@@ -3677,10 +3677,10 @@
     Center.SubtractVector(&triangle->NormalVector); // points towards MolCenter
     DistanceToCenter.AddVector(&triangle->NormalVector); // points outside
-    Log() << Verbose(1) << "INFO: Calling Intersection with " << Center << " and " << DistanceToCenter << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: Calling Intersection with " << Center << " and " << DistanceToCenter << "." << endl);
     if (triangle->GetIntersectionInsideTriangle(&Center, &DistanceToCenter, &Intersection)) {
-      Log() << Verbose(1) << Point << " is inner point: sufficiently close to boundary, " << Intersection << "." << endl;
+      DoLog(1) && (Log() << Verbose(1) << Point << " is inner point: sufficiently close to boundary, " << Intersection << "." << endl);
       return 0.;
     } else {
-      Log() << Verbose(1) << Point << " is NOT an inner point: on triangle plane but outside of triangle bounds." << endl;
+      DoLog(1) && (Log() << Verbose(1) << Point << " is NOT an inner point: on triangle plane but outside of triangle bounds." << endl);
       return false;
     }
@@ -3688,12 +3688,12 @@
     // calculate smallest distance
     distance = triangle->GetClosestPointInsideTriangle(&Point, &Intersection);
-    Log() << Verbose(1) << "Closest point on triangle is " << Intersection << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Closest point on triangle is " << Intersection << "." << endl);
 
     // then check direction to boundary
     if (DistanceToCenter.ScalarProduct(&triangle->NormalVector) > MYEPSILON) {
-      Log() << Verbose(1) << Point << " is an inner point, " << distance << " below surface." << endl;
+      DoLog(1) && (Log() << Verbose(1) << Point << " is an inner point, " << distance << " below surface." << endl);
       return -distance;
     } else {
-      Log() << Verbose(1) << Point << " is NOT an inner point, " << distance << " above surface." << endl;
+      DoLog(1) && (Log() << Verbose(1) << Point << " is NOT an inner point, " << distance << " above surface." << endl);
       return +distance;
     }
@@ -3775,5 +3775,5 @@
 
     if (takePoint) {
-      Log() << Verbose(1) << "INFO: Endpoint " << *current << " of line " << *(findLines->second) << " is enlisted." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "INFO: Endpoint " << *current << " of line " << *(findLines->second) << " is enlisted." << endl);
       connectedPoints->insert(current);
     }
@@ -3831,5 +3831,5 @@
   }
   PlaneNormal.Scale(1.0 / triangles->size());
-  Log() << Verbose(1) << "INFO: Calculated PlaneNormal of all circle points is " << PlaneNormal << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Calculated PlaneNormal of all circle points is " << PlaneNormal << "." << endl);
   PlaneNormal.Normalize();
 
@@ -3841,5 +3841,5 @@
   }
   if ((Reference == NULL) || (AngleZero.NormSquared() < MYEPSILON)) {
-    Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl);
     AngleZero.CopyVector((*SetOfNeighbours->begin())->node);
     AngleZero.SubtractVector(Point->node);
@@ -3850,10 +3850,10 @@
     }
   }
-  Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl);
   if (AngleZero.NormSquared() > MYEPSILON)
     OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero);
   else
     OrthogonalVector.MakeNormalVector(&PlaneNormal);
-  Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl);
 
   // go through all connected points and calculate angle
@@ -3863,5 +3863,5 @@
     helper.ProjectOntoPlane(&PlaneNormal);
     double angle = GetAngle(helper, AngleZero, OrthogonalVector);
-    Log() << Verbose(0) << "INFO: Calculated angle is " << angle << " for point " << **listRunner << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "INFO: Calculated angle is " << angle << " for point " << **listRunner << "." << endl);
     anglesOfPoints.insert(pair<double, TesselPoint*> (angle, (*listRunner)));
   }
@@ -3909,5 +3909,5 @@
   }
 
-  Log() << Verbose(1) << "INFO: Point is " << *Point << " and Reference is " << *Reference << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Point is " << *Point << " and Reference is " << *Reference << "." << endl);
   // calculate central point
   TesselPointSet::const_iterator TesselA = SetOfNeighbours->begin();
@@ -3920,5 +3920,5 @@
   while (TesselC != SetOfNeighbours->end()) {
     helper.MakeNormalVector((*TesselA)->node, (*TesselB)->node, (*TesselC)->node);
-    Log() << Verbose(0) << "Making normal vector out of " << *(*TesselA) << ", " << *(*TesselB) << " and " << *(*TesselC) << ":" << helper << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Making normal vector out of " << *(*TesselA) << ", " << *(*TesselB) << " and " << *(*TesselC) << ":" << helper << endl);
     counter++;
     TesselA++;
@@ -3936,5 +3936,5 @@
   //  PlaneNormal.SubtractVector(&center);
   //  PlaneNormal.Normalize();
-  Log() << Verbose(1) << "INFO: Calculated plane normal of circle is " << PlaneNormal << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Calculated plane normal of circle is " << PlaneNormal << "." << endl);
 
   // construct one orthogonal vector
@@ -3945,5 +3945,5 @@
   }
   if ((Reference == NULL) || (AngleZero.NormSquared() < MYEPSILON)) {
-    Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl);
     AngleZero.CopyVector((*SetOfNeighbours->begin())->node);
     AngleZero.SubtractVector(Point->node);
@@ -3954,10 +3954,10 @@
     }
   }
-  Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl);
   if (AngleZero.NormSquared() > MYEPSILON)
     OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero);
   else
     OrthogonalVector.MakeNormalVector(&PlaneNormal);
-  Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl);
 
   // go through all connected points and calculate angle
@@ -3970,5 +3970,5 @@
     if (angle > M_PI) // the correction is of no use here (and not desired)
       angle = 2. * M_PI - angle;
-    Log() << Verbose(0) << "INFO: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "INFO: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << "." << endl);
     InserterTest = anglesOfPoints.insert(pair<double, TesselPoint*> (angle, (*listRunner)));
     if (!InserterTest.second) {
@@ -4037,13 +4037,13 @@
         StartLine = CurrentLine;
         CurrentPoint = CurrentLine->GetOtherEndpoint(ReferencePoint);
-        Log() << Verbose(1) << "INFO: Beginning path retrieval at " << *CurrentPoint << " of line " << *CurrentLine << "." << endl;
+        DoLog(1) && (Log() << Verbose(1) << "INFO: Beginning path retrieval at " << *CurrentPoint << " of line " << *CurrentLine << "." << endl);
         do {
           // push current one
-          Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl);
           connectedPath->push_back(CurrentPoint->node);
 
           // find next triangle
           for (TriangleMap::iterator Runner = CurrentLine->triangles.begin(); Runner != CurrentLine->triangles.end(); Runner++) {
-            Log() << Verbose(1) << "INFO: Inspecting triangle " << *Runner->second << "." << endl;
+            DoLog(1) && (Log() << Verbose(1) << "INFO: Inspecting triangle " << *Runner->second << "." << endl);
             if ((Runner->second != triangle)) { // look for first triangle not equal to old one
               triangle = Runner->second;
@@ -4052,8 +4052,8 @@
                 if (!TriangleRunner->second) {
                   TriangleRunner->second = true;
-                  Log() << Verbose(1) << "INFO: Connecting triangle is " << *triangle << "." << endl;
+                  DoLog(1) && (Log() << Verbose(1) << "INFO: Connecting triangle is " << *triangle << "." << endl);
                   break;
                 } else {
-                  Log() << Verbose(1) << "INFO: Skipping " << *triangle << ", as we have already visited it." << endl;
+                  DoLog(1) && (Log() << Verbose(1) << "INFO: Skipping " << *triangle << ", as we have already visited it." << endl);
                   triangle = NULL;
                 }
@@ -4070,5 +4070,5 @@
             if ((triangle->lines[i] != CurrentLine) && (triangle->lines[i]->ContainsBoundaryPoint(ReferencePoint))) { // not the current line and still containing Point
               CurrentLine = triangle->lines[i];
-              Log() << Verbose(1) << "INFO: Connecting line is " << *CurrentLine << "." << endl;
+              DoLog(1) && (Log() << Verbose(1) << "INFO: Connecting line is " << *CurrentLine << "." << endl);
               break;
             }
@@ -4084,5 +4084,5 @@
         } while (CurrentLine != StartLine);
         // last point is missing, as it's on start line
-        Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl;
+        DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl);
         if (StartLine->GetOtherEndpoint(ReferencePoint)->node != connectedPath->back())
           connectedPath->push_back(StartLine->GetOtherEndpoint(ReferencePoint)->node);
@@ -4090,5 +4090,5 @@
         ListOfPaths->push_back(connectedPath);
       } else {
-        Log() << Verbose(1) << "INFO: Skipping " << *runner->second << ", as we have already visited it." << endl;
+        DoLog(1) && (Log() << Verbose(1) << "INFO: Skipping " << *runner->second << ", as we have already visited it." << endl);
       }
     }
@@ -4120,5 +4120,5 @@
     connectedPath = *ListRunner;
 
-    Log() << Verbose(1) << "INFO: Current path is " << connectedPath << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: Current path is " << connectedPath << "." << endl);
 
     // go through list, look for reappearance of starting Point and count
@@ -4129,12 +4129,12 @@
       if ((*CircleRunner == *CircleStart) && (CircleRunner != CircleStart)) { // is not the very first point
         // we have a closed circle from Marker to new Marker
-        Log() << Verbose(1) << count + 1 << ". closed path consists of: ";
+        DoLog(1) && (Log() << Verbose(1) << count + 1 << ". closed path consists of: ");
         newPath = new TesselPointList;
         TesselPointList::iterator CircleSprinter = Marker;
         for (; CircleSprinter != CircleRunner; CircleSprinter++) {
           newPath->push_back(*CircleSprinter);
-          Log() << Verbose(0) << (**CircleSprinter) << " <-> ";
+          DoLog(0) && (Log() << Verbose(0) << (**CircleSprinter) << " <-> ");
         }
-        Log() << Verbose(0) << ".." << endl;
+        DoLog(0) && (Log() << Verbose(0) << ".." << endl);
         count++;
         Marker = CircleRunner;
@@ -4145,5 +4145,5 @@
     }
   }
-  Log() << Verbose(1) << "INFO: " << count << " closed additional path(s) have been created." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: " << count << " closed additional path(s) have been created." << endl);
 
   // delete list of paths
@@ -4207,5 +4207,5 @@
     return 0.;
   } else
-    Log() << Verbose(0) << "Removing point " << *point << " from tesselated boundary ..." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Removing point " << *point << " from tesselated boundary ..." << endl);
 
   // copy old location for the volume
@@ -4237,10 +4237,10 @@
   NormalVector.Zero();
   for (TriangleMap::iterator Runner = Candidates.begin(); Runner != Candidates.end(); Runner++) {
-    Log() << Verbose(1) << "INFO: Removing triangle " << *(Runner->second) << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "INFO: Removing triangle " << *(Runner->second) << "." << endl);
     NormalVector.SubtractVector(&Runner->second->NormalVector); // has to point inward
     RemoveTesselationTriangle(Runner->second);
     count++;
   }
-  Log() << Verbose(1) << count << " triangles were removed." << endl;
+  DoLog(1) && (Log() << Verbose(1) << count << " triangles were removed." << endl);
 
   list<TesselPointList *>::iterator ListAdvance = ListOfClosedPaths->begin();
@@ -4266,5 +4266,5 @@
         smallestangle = 0.;
         for (MiddleNode = connectedPath->begin(); MiddleNode != connectedPath->end(); MiddleNode++) {
-          Log() << Verbose(1) << "INFO: MiddleNode is " << **MiddleNode << "." << endl;
+          DoLog(1) && (Log() << Verbose(1) << "INFO: MiddleNode is " << **MiddleNode << "." << endl);
           // construct vectors to next and previous neighbour
           StartNode = MiddleNode;
@@ -4304,8 +4304,8 @@
         if (EndNode == connectedPath->end())
           EndNode = connectedPath->begin();
-        Log() << Verbose(2) << "INFO: StartNode is " << **StartNode << "." << endl;
-        Log() << Verbose(2) << "INFO: MiddleNode is " << **MiddleNode << "." << endl;
-        Log() << Verbose(2) << "INFO: EndNode is " << **EndNode << "." << endl;
-        Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->Name << ", " << (*MiddleNode)->Name << " and " << (*EndNode)->Name << "." << endl;
+        DoLog(2) && (Log() << Verbose(2) << "INFO: StartNode is " << **StartNode << "." << endl);
+        DoLog(2) && (Log() << Verbose(2) << "INFO: MiddleNode is " << **MiddleNode << "." << endl);
+        DoLog(2) && (Log() << Verbose(2) << "INFO: EndNode is " << **EndNode << "." << endl);
+        DoLog(1) && (Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->Name << ", " << (*MiddleNode)->Name << " and " << (*EndNode)->Name << "." << endl);
         TriangleCandidates[0] = *StartNode;
         TriangleCandidates[1] = *MiddleNode;
@@ -4325,9 +4325,9 @@
           continue;
         }
-        Log() << Verbose(3) << "Adding new triangle points." << endl;
+        DoLog(3) && (Log() << Verbose(3) << "Adding new triangle points." << endl);
         AddTesselationPoint(*StartNode, 0);
         AddTesselationPoint(*MiddleNode, 1);
         AddTesselationPoint(*EndNode, 2);
-        Log() << Verbose(3) << "Adding new triangle lines." << endl;
+        DoLog(3) && (Log() << Verbose(3) << "Adding new triangle lines." << endl);
         AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0);
         AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1);
@@ -4344,5 +4344,5 @@
         // prepare nodes for next triangle
         StartNode = EndNode;
-        Log() << Verbose(2) << "Removing " << **MiddleNode << " from closed path, remaining points: " << connectedPath->size() << "." << endl;
+        DoLog(2) && (Log() << Verbose(2) << "Removing " << **MiddleNode << " from closed path, remaining points: " << connectedPath->size() << "." << endl);
         connectedPath->remove(*MiddleNode); // remove the middle node (it is surrounded by triangles)
         if (connectedPath->size() == 2) { // we are done
@@ -4380,5 +4380,5 @@
           if (maxgain != 0) {
             volume += maxgain;
-            Log() << Verbose(1) << "Flipping baseline with highest volume" << **Candidate << "." << endl;
+            DoLog(1) && (Log() << Verbose(1) << "Flipping baseline with highest volume" << **Candidate << "." << endl);
             OtherBase = FlipBaseline(*Candidate);
             NewLines.erase(Candidate);
@@ -4391,5 +4391,5 @@
       delete (connectedPath);
     }
-    Log() << Verbose(0) << count << " triangles were created." << endl;
+    DoLog(0) && (Log() << Verbose(0) << count << " triangles were created." << endl);
   } else {
     while (!ListOfClosedPaths->empty()) {
@@ -4399,9 +4399,9 @@
       delete (connectedPath);
     }
-    Log() << Verbose(0) << "No need to create any triangles." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "No need to create any triangles." << endl);
   }
   delete (ListOfClosedPaths);
 
-  Log() << Verbose(0) << "Removed volume is " << volume << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Removed volume is " << volume << "." << endl);
 
   return volume;
@@ -4568,5 +4568,5 @@
   AllLines.clear();
 
-  Log() << Verbose(0) << "FindAllDegeneratedLines() found " << DegeneratedLines->size() << " lines." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "FindAllDegeneratedLines() found " << DegeneratedLines->size() << " lines." << endl);
   IndexToIndex::iterator it;
   for (it = DegeneratedLines->begin(); it != DegeneratedLines->end(); it++) {
@@ -4574,5 +4574,5 @@
     const LineMap::const_iterator Line2 = LinesOnBoundary.find((*it).second);
     if (Line1 != LinesOnBoundary.end() && Line2 != LinesOnBoundary.end())
-      Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl;
+      DoLog(0) && (Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl);
     else
       DoeLog(1) && (eLog() << Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl);
@@ -4616,8 +4616,8 @@
   delete (DegeneratedLines);
 
-  Log() << Verbose(0) << "FindAllDegeneratedTriangles() found " << DegeneratedTriangles->size() << " triangles:" << endl;
+  DoLog(0) && (Log() << Verbose(0) << "FindAllDegeneratedTriangles() found " << DegeneratedTriangles->size() << " triangles:" << endl);
   IndexToIndex::iterator it;
   for (it = DegeneratedTriangles->begin(); it != DegeneratedTriangles->end(); it++)
-    Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl;
+    DoLog(0) && (Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl);
 
   return DegeneratedTriangles;
@@ -4687,11 +4687,11 @@
       // erase the pair
       count += (int) DegeneratedTriangles->erase(triangle->Nr);
-      Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *triangle << "." << endl;
+      DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *triangle << "." << endl);
       RemoveTesselationTriangle(triangle);
       count += (int) DegeneratedTriangles->erase(partnerTriangle->Nr);
-      Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *partnerTriangle << "." << endl;
+      DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *partnerTriangle << "." << endl);
       RemoveTesselationTriangle(partnerTriangle);
     } else {
-      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;
+      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);
     }
   }
@@ -4700,5 +4700,5 @@
     LastTriangle = NULL;
 
-  Log() << Verbose(0) << "RemoveDegeneratedTriangles() removed " << count << " triangles:" << endl;
+  DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removed " << count << " triangles:" << endl);
 }
 
@@ -4729,5 +4729,5 @@
     return;
   }
-  Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->Name << "." << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->Name << "." << endl);
 
   // go through its lines and find the best one to split
@@ -4762,9 +4762,9 @@
 
   // create new triangle to connect point (connects automatically with the missing spot of the chosen line)
-  Log() << Verbose(2) << "Adding new triangle points." << endl;
+  DoLog(2) && (Log() << Verbose(2) << "Adding new triangle points." << endl);
   AddTesselationPoint((BestLine->endpoints[0]->node), 0);
   AddTesselationPoint((BestLine->endpoints[1]->node), 1);
   AddTesselationPoint(point, 2);
-  Log() << Verbose(2) << "Adding new triangle lines." << endl;
+  DoLog(2) && (Log() << Verbose(2) << "Adding new triangle lines." << endl);
   AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0);
   AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1);
@@ -4773,13 +4773,13 @@
   BTS->GetNormalVector(TempTriangle->NormalVector);
   BTS->NormalVector.Scale(-1.);
-  Log() << Verbose(1) << "INFO: NormalVector of new triangle is " << BTS->NormalVector << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of new triangle is " << BTS->NormalVector << "." << endl);
   AddTesselationTriangle();
 
   // create other side of this triangle and close both new sides of the first created triangle
-  Log() << Verbose(2) << "Adding new triangle points." << endl;
+  DoLog(2) && (Log() << Verbose(2) << "Adding new triangle points." << endl);
   AddTesselationPoint((BestLine->endpoints[0]->node), 0);
   AddTesselationPoint((BestLine->endpoints[1]->node), 1);
   AddTesselationPoint(point, 2);
-  Log() << Verbose(2) << "Adding new triangle lines." << endl;
+  DoLog(2) && (Log() << Verbose(2) << "Adding new triangle lines." << endl);
   AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0);
   AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1);
@@ -4787,5 +4787,5 @@
   BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount);
   BTS->GetNormalVector(TempTriangle->NormalVector);
-  Log() << Verbose(1) << "INFO: NormalVector of other new triangle is " << BTS->NormalVector << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of other new triangle is " << BTS->NormalVector << "." << endl);
   AddTesselationTriangle();
 
@@ -4825,5 +4825,5 @@
         NameofTempFile.erase(npos, 1);
       NameofTempFile.append(TecplotSuffix);
-      Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
+      DoLog(0) && (Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n");
       tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
       WriteTecplotFile(tempstream, this, cloud, TriangleFilesWritten);
@@ -4839,5 +4839,5 @@
         NameofTempFile.erase(npos, 1);
       NameofTempFile.append(Raster3DSuffix);
-      Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
+      DoLog(0) && (Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n");
       tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
       WriteRaster3dFile(tempstream, this, cloud);
@@ -4891,8 +4891,8 @@
   pair<map<int, Vector *>::iterator, bool> TriangleInsertionTester;
   for (PointMap::const_iterator Runner = PointsOnBoundary.begin(); Runner != PointsOnBoundary.end(); Runner++) {
-    Log() << Verbose(0) << "Current point is " << *Runner->second << "." << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Current point is " << *Runner->second << "." << endl);
     map<int, Vector *> TriangleVectors;
     // gather all NormalVectors
-    Log() << Verbose(1) << "Gathering triangles ..." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Gathering triangles ..." << endl);
     for (LineMap::const_iterator LineRunner = (Runner->second)->lines.begin(); LineRunner != (Runner->second)->lines.end(); LineRunner++)
       for (TriangleMap::const_iterator TriangleRunner = (LineRunner->second)->triangles.begin(); TriangleRunner != (LineRunner->second)->triangles.end(); TriangleRunner++) {
@@ -4900,20 +4900,20 @@
           TriangleInsertionTester = TriangleVectors.insert(pair<int, Vector *> ((TriangleRunner->second)->Nr, &((TriangleRunner->second)->NormalVector)));
           if (TriangleInsertionTester.second)
-            Log() << Verbose(1) << " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list." << endl;
+            DoLog(1) && (Log() << Verbose(1) << " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list." << endl);
         } else {
-          Log() << Verbose(1) << " NOT adding triangle " << *(TriangleRunner->second) << " as it's a simply degenerated one." << endl;
+          DoLog(1) && (Log() << Verbose(1) << " NOT adding triangle " << *(TriangleRunner->second) << " as it's a simply degenerated one." << endl);
         }
       }
     // check whether there are two that are parallel
-    Log() << Verbose(1) << "Finding two parallel triangles ..." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Finding two parallel triangles ..." << endl);
     for (map<int, Vector *>::iterator VectorWalker = TriangleVectors.begin(); VectorWalker != TriangleVectors.end(); VectorWalker++)
       for (map<int, Vector *>::iterator VectorRunner = VectorWalker; VectorRunner != TriangleVectors.end(); VectorRunner++)
         if (VectorWalker != VectorRunner) { // skip equals
           const double SCP = VectorWalker->second->ScalarProduct(VectorRunner->second); // ScalarProduct should result in -1. for degenerated triangles
-          Log() << Verbose(1) << "Checking " << *VectorWalker->second << " against " << *VectorRunner->second << ": " << SCP << endl;
+          DoLog(1) && (Log() << Verbose(1) << "Checking " << *VectorWalker->second << " against " << *VectorRunner->second << ": " << SCP << endl);
           if (fabs(SCP + 1.) < ParallelEpsilon) {
             InsertionTester = EndpointCandidateList.insert((Runner->second));
             if (InsertionTester.second)
-              Log() << Verbose(0) << " Adding " << *Runner->second << " to endpoint candidate list." << endl;
+              DoLog(0) && (Log() << Verbose(0) << " Adding " << *Runner->second << " to endpoint candidate list." << endl);
             // and break out of both loops
             VectorWalker = TriangleVectors.end();
@@ -4933,5 +4933,5 @@
     Walker = *(EndpointCandidateList.begin());
     if (Current == NULL) { // create a new polygon with current candidate
-      Log() << Verbose(0) << "Starting new polygon set at point " << *Walker << endl;
+      DoLog(0) && (Log() << Verbose(0) << "Starting new polygon set at point " << *Walker << endl);
       Current = new BoundaryPolygonSet;
       Current->endpoints.insert(Walker);
@@ -4946,18 +4946,18 @@
       for (LineMap::const_iterator LineWalker = Walker->lines.begin(); LineWalker != Walker->lines.end(); LineWalker++) {
         OtherWalker = (LineWalker->second)->GetOtherEndpoint(Walker);
-        Log() << Verbose(1) << "Checking " << *OtherWalker << endl;
+        DoLog(1) && (Log() << Verbose(1) << "Checking " << *OtherWalker << endl);
         set<BoundaryPointSet *>::iterator Finder = EndpointCandidateList.find(OtherWalker);
         if (Finder != EndpointCandidateList.end()) { // found a connected partner
-          Log() << Verbose(1) << " Adding to polygon." << endl;
+          DoLog(1) && (Log() << Verbose(1) << " Adding to polygon." << endl);
           Current->endpoints.insert(OtherWalker);
           EndpointCandidateList.erase(Finder); // remove from candidates
           ToCheckConnecteds.push(OtherWalker); // but check its partners too
         } else {
-          Log() << Verbose(1) << " is not connected to " << *Walker << endl;
+          DoLog(1) && (Log() << Verbose(1) << " is not connected to " << *Walker << endl);
         }
       }
     }
 
-    Log() << Verbose(0) << "Final polygon is " << *Current << endl;
+    DoLog(0) && (Log() << Verbose(0) << "Final polygon is " << *Current << endl);
     ListofDegeneratedPolygons.insert(Current);
     Current = NULL;
@@ -4966,7 +4966,7 @@
   const int counter = ListofDegeneratedPolygons.size();
 
-  Log() << Verbose(0) << "The following " << counter << " degenerated polygons have been found: " << endl;
+  DoLog(0) && (Log() << Verbose(0) << "The following " << counter << " degenerated polygons have been found: " << endl);
   for (UniquePolygonSet::iterator PolygonRunner = ListofDegeneratedPolygons.begin(); PolygonRunner != ListofDegeneratedPolygons.end(); PolygonRunner++)
-    Log() << Verbose(0) << " " << **PolygonRunner << endl;
+    DoLog(0) && (Log() << Verbose(0) << " " << **PolygonRunner << endl);
 
   /// 4. Go through all these degenerated polygons
@@ -4979,5 +4979,5 @@
     // check whether number is bigger than 2, otherwise it's just a simply degenerated one and nothing to do.
     if (T->size() == 2) {
-      Log() << Verbose(1) << " Skipping degenerated polygon, is just a (already simply degenerated) triangle." << endl;
+      DoLog(1) && (Log() << Verbose(1) << " Skipping degenerated polygon, is just a (already simply degenerated) triangle." << endl);
       delete (T);
       continue;
@@ -4995,5 +4995,5 @@
     /// 4a. Get NormalVector for one side (this is "front")
     NormalVector.CopyVector(&(*TriangleWalker)->NormalVector);
-    Log() << Verbose(1) << "\"front\" defining triangle is " << **TriangleWalker << " and Normal vector of \"front\" side is " << NormalVector << endl;
+    DoLog(1) && (Log() << Verbose(1) << "\"front\" defining triangle is " << **TriangleWalker << " and Normal vector of \"front\" side is " << NormalVector << endl);
     TriangleWalker++;
     TriangleSet::iterator TriangleSprinter = TriangleWalker; // is the inner advanced iterator
@@ -5004,17 +5004,17 @@
       triangle = *TriangleWalker;
       TriangleSprinter++;
-      Log() << Verbose(1) << "Current triangle to test for removal: " << *triangle << endl;
+      DoLog(1) && (Log() << Verbose(1) << "Current triangle to test for removal: " << *triangle << endl);
       if (triangle->NormalVector.ScalarProduct(&NormalVector) < 0) { // if from other side, then delete and remove from list
-        Log() << Verbose(1) << " Removing ... " << endl;
+        DoLog(1) && (Log() << Verbose(1) << " Removing ... " << endl);
         TriangleNrs.push(triangle->Nr);
         T->erase(TriangleWalker);
         RemoveTesselationTriangle(triangle);
       } else
-        Log() << Verbose(1) << " Keeping ... " << endl;
+        DoLog(1) && (Log() << Verbose(1) << " Keeping ... " << endl);
     }
     /// 4c. Copy all "front" triangles but with inverse NormalVector
     TriangleWalker = T->begin();
     while (TriangleWalker != T->end()) { // go through all front triangles
-      Log() << Verbose(1) << " Re-creating triangle " << **TriangleWalker << " with NormalVector " << (*TriangleWalker)->NormalVector << endl;
+      DoLog(1) && (Log() << Verbose(1) << " Re-creating triangle " << **TriangleWalker << " with NormalVector " << (*TriangleWalker)->NormalVector << endl);
       for (int i = 0; i < 3; i++)
         AddTesselationPoint((*TriangleWalker)->endpoints[i]->node, i);
@@ -5037,8 +5037,8 @@
   }
   IndexToIndex * SimplyDegeneratedTriangles = FindAllDegeneratedTriangles();
-  Log() << Verbose(0) << "Final list of simply degenerated triangles found, containing " << SimplyDegeneratedTriangles->size() << " triangles:" << endl;
+  DoLog(0) && (Log() << Verbose(0) << "Final list of simply degenerated triangles found, containing " << SimplyDegeneratedTriangles->size() << " triangles:" << endl);
   IndexToIndex::iterator it;
   for (it = SimplyDegeneratedTriangles->begin(); it != SimplyDegeneratedTriangles->end(); it++)
-    Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl;
+    DoLog(0) && (Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl);
   delete (SimplyDegeneratedTriangles);
   /// 5. exit
