Changeset 12f57b for molecuilder/src/tesselation.cpp
- Timestamp:
- Mar 18, 2010, 11:33:54 AM (15 years ago)
- Children:
- 6acc8e4
- Parents:
- f87c2a
- git-author:
- Frederik Heber <heber@…> (03/18/10 10:26:55)
- git-committer:
- Frederik Heber <heber@…> (03/18/10 11:33:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/tesselation.cpp
rf87c2a r12f57b 55 55 //Log() << Verbose(0) << "Erasing point nr. " << Nr << "." << endl; 56 56 if (!lines.empty()) 57 eLog() << Verbose(2) << "Memory Leak! I " << *this << " am still connected to some lines." << endl;57 DoeLog(2) && (eLog()<< Verbose(2) << "Memory Leak! I " << *this << " am still connected to some lines." << endl); 58 58 node = NULL; 59 59 }; … … 188 188 } 189 189 if (!triangles.empty()) 190 eLog() << Verbose(2) << "Memory Leak! I " << *this << " am still connected to some triangles." << endl;190 DoeLog(2) && (eLog()<< Verbose(2) << "Memory Leak! I " << *this << " am still connected to some triangles." << endl); 191 191 }; 192 192 … … 226 226 // get the two triangles 227 227 if (triangles.size() != 2) { 228 eLog() << Verbose(0) << "Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!" << endl;228 DoeLog(0) && (eLog()<< Verbose(0) << "Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!" << endl); 229 229 return true; 230 230 } … … 252 252 BaseLineNormal.CopyVector(&runner->second->NormalVector); // yes, copy second on top of first 253 253 else { 254 eLog() << Verbose(0) << "Triangle " << *runner->second << " has zero normal vector!" << endl;254 DoeLog(0) && (eLog()<< Verbose(0) << "Triangle " << *runner->second << " has zero normal vector!" << endl); 255 255 } 256 256 node = runner->second->GetThirdEndpoint(this); … … 263 263 i++; 264 264 } else { 265 eLog() << Verbose(1) << "I cannot find third node in triangle, something's wrong." << endl;265 DoeLog(1) && (eLog()<< Verbose(1) << "I cannot find third node in triangle, something's wrong." << endl); 266 266 return true; 267 267 } … … 368 368 } 369 369 if (Counter < 3) { 370 eLog() << Verbose(0) << "We have a triangle with only two distinct endpoints!" << endl;370 DoeLog(0) && (eLog()<< Verbose(0) << "We have a triangle with only two distinct endpoints!" << endl); 371 371 performCriticalExit(); 372 372 } … … 430 430 431 431 if (!Intersection->GetIntersectionWithPlane(&NormalVector, endpoints[0]->node->node, MolCenter, x)) { 432 eLog() << Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl;432 DoeLog(1) && (eLog()<< Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl); 433 433 return false; 434 434 } … … 726 726 Runner[i]++; 727 727 if (Runner[i] == endpoints.end()) { 728 eLog() << Verbose(0) << "There are less than three endpoints in the polygon!" << endl;728 DoeLog(0) && (eLog()<< Verbose(0) << "There are less than three endpoints in the polygon!" << endl); 729 729 performCriticalExit(); 730 730 } … … 1072 1072 runner->second = NULL; 1073 1073 } else 1074 eLog() << Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl;1074 DoeLog(1) && (eLog()<< Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl); 1075 1075 } 1076 1076 Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl; … … 1325 1325 else 1326 1326 { 1327 eLog() << Verbose(0) << "No starting triangle found." << endl;1327 DoeLog(0) && (eLog()<< Verbose(0) << "No starting triangle found." << endl); 1328 1328 } 1329 1329 } … … 1524 1524 TrianglesOnBoundaryCount++; 1525 1525 } else { 1526 eLog() << Verbose(2) << "I could not determine a winner for this baseline " << *(baseline->second) << "." << endl;1526 DoeLog(2) && (eLog()<< Verbose(2) << "I could not determine a winner for this baseline " << *(baseline->second) << "." << endl); 1527 1527 } 1528 1528 … … 1617 1617 if (NewLines[j]->IsConnectedTo(BLS[0])) { 1618 1618 if (n>2) { 1619 eLog() << Verbose(2) << BLS[0] << " connects to all of the new lines?!" << endl;1619 DoeLog(2) && (eLog()<< Verbose(2) << BLS[0] << " connects to all of the new lines?!" << endl); 1620 1620 return false; 1621 1621 } else … … 1634 1634 } 1635 1635 } else { // something is wrong with FindClosestTriangleToPoint! 1636 eLog() << Verbose(1) << "The closest triangle did not produce an intersection!" << endl;1636 DoeLog(1) && (eLog()<< Verbose(1) << "The closest triangle did not produce an intersection!" << endl); 1637 1637 return false; 1638 1638 } … … 1737 1737 OpenLines.erase(CandidateLine); 1738 1738 } else { 1739 eLog() << Verbose(1) << "Line exists and is attached to less than two triangles, but not in OpenLines!" << endl;1739 DoeLog(1) && (eLog()<< Verbose(1) << "Line exists and is attached to less than two triangles, but not in OpenLines!" << endl); 1740 1740 } 1741 1741 … … 1843 1843 triangle->lines[i] = NULL; // free'd or not: disconnect 1844 1844 } else 1845 eLog() << Verbose(1) << "This line " << i << " has already been free'd." << endl;1845 DoeLog(1) && (eLog()<< Verbose(1) << "This line " << i << " has already been free'd." << endl); 1846 1846 } 1847 1847 … … 1897 1897 line->endpoints[i] = NULL; // free'd or not: disconnect 1898 1898 } else 1899 eLog() << Verbose(1) << "Endpoint " << i << " has already been free'd." << endl;1899 DoeLog(1) && (eLog()<< Verbose(1) << "Endpoint " << i << " has already been free'd." << endl); 1900 1900 } 1901 1901 if (!line->triangles.empty()) 1902 eLog() << Verbose(2) << "Memory Leak! I " << *line << " am still connected to some triangles." << endl;1902 DoeLog(2) && (eLog()<< Verbose(2) << "Memory Leak! I " << *line << " am still connected to some triangles." << endl); 1903 1903 1904 1904 if (LinesOnBoundary.erase(line->Nr)) … … 2073 2073 } 2074 2074 } else { 2075 eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl;2075 DoeLog(1) && (eLog()<< Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl); 2076 2076 } 2077 2077 } … … 2217 2217 // if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { 2218 2218 // // rotated the wrong way! 2219 // eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;2219 // DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl); 2220 2220 // } 2221 2221 // … … 2274 2274 // } 2275 2275 // } else { 2276 // eLog() << Verbose(2) << "Baseline is connected to two triangles already?" << endl;2276 // DoeLog(2) && (eLog()<< Verbose(2) << "Baseline is connected to two triangles already?" << endl); 2277 2277 // } 2278 2278 // } else { … … 2281 2281 // } 2282 2282 // } else { 2283 // eLog() << Verbose(1) << "Could not find the TesselPoint " << *ThirdNode << "." << endl;2283 // DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the TesselPoint " << *ThirdNode << "." << endl); 2284 2284 // } 2285 2285 // … … 2347 2347 if (fabs(RelativeSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { 2348 2348 // rotated the wrong way! 2349 eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;2349 DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl); 2350 2350 } 2351 2351 … … 2358 2358 2359 2359 if (CandidateLine.pointlist.empty()) { 2360 eLog() << Verbose(2) << "Could not find a suitable candidate." << endl;2360 DoeLog(2) && (eLog()<< Verbose(2) << "Could not find a suitable candidate." << endl); 2361 2361 return false; 2362 2362 } … … 2400 2400 // CandidateLine.ShortestAngle = ShortestAngle; 2401 2401 // } else { 2402 //// eLog() << Verbose(1) << "This triangle consisting of ";2402 //// DoeLog(1) && (eLog()<< Verbose(1) << "This triangle consisting of "); 2403 2403 //// Log() << Verbose(0) << *(*it)->point << ", "; 2404 2404 //// Log() << Verbose(0) << *BaseRay->endpoints[0]->node << " and "; … … 2421 2421 // 2422 2422 // } else { 2423 //// eLog() << Verbose(1) << "This triangle consisting of " << *(*it)->point << ", " << *BaseRay->endpoints[0]->node << " and " << *BaseRay->endpoints[1]->node << " " << "exists and is not added, as it does not seem helpful!" << endl;2423 //// DoeLog(1) && (eLog()<< Verbose(1) << "This triangle consisting of " << *(*it)->point << ", " << *BaseRay->endpoints[0]->node << " and " << *BaseRay->endpoints[1]->node << " " << "exists and is not added, as it does not seem helpful!" << endl); 2424 2424 // result = false; 2425 2425 // } … … 2437 2437 // BaseRay = BLS[0]; 2438 2438 // if ((BTS != NULL) && (BTS->NormalVector.NormSquared() < MYEPSILON)) { 2439 // eLog() << Verbose(1) << "Triangle " << *BTS << " has zero normal vector!" << endl;2439 // DoeLog(1) && (eLog()<< Verbose(1) << "Triangle " << *BTS << " has zero normal vector!" << endl); 2440 2440 // exit(255); 2441 2441 // } … … 2635 2635 BaseLineNormal.Zero(); 2636 2636 if (Base->triangles.size() < 2) { 2637 eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl;2637 DoeLog(1) && (eLog()<< Verbose(1) << "Less than two triangles are attached to this baseline!" << endl); 2638 2638 return 0.; 2639 2639 } … … 2674 2674 BaseLineNormal.Zero(); 2675 2675 if (Base->triangles.size() < 2) { 2676 eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl;2676 DoeLog(1) && (eLog()<< Verbose(1) << "Less than two triangles are attached to this baseline!" << endl); 2677 2677 return NULL; 2678 2678 } … … 2710 2710 // check whether everything is in place to create new lines and triangles 2711 2711 if (i<4) { 2712 eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl;2712 DoeLog(1) && (eLog()<< Verbose(1) << "We have not gathered enough baselines!" << endl); 2713 2713 return NULL; 2714 2714 } 2715 2715 for (int j=0;j<4;j++) 2716 2716 if (OldLines[j] == NULL) { 2717 eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl;2717 DoeLog(1) && (eLog()<< Verbose(1) << "We have not gathered enough baselines!" << endl); 2718 2718 return NULL; 2719 2719 } 2720 2720 for (int j=0;j<2;j++) 2721 2721 if (OldPoints[j] == NULL) { 2722 eLog() << Verbose(1) << "We have not gathered enough endpoints!" << endl;2722 DoeLog(1) && (eLog()<< Verbose(1) << "We have not gathered enough endpoints!" << endl); 2723 2723 return NULL; 2724 2724 } … … 2764 2764 Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl; 2765 2765 } else { 2766 eLog() << Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl;2766 DoeLog(0) && (eLog()<< Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl); 2767 2767 return NULL; 2768 2768 } … … 2795 2795 N[i] = LC->n[i]; 2796 2796 } else { 2797 eLog() << Verbose(1) << "Point " << *a << " is not found in cell " << LC->index << "." << endl;2797 DoeLog(1) && (eLog()<< Verbose(1) << "Point " << *a << " is not found in cell " << LC->index << "." << endl); 2798 2798 return; 2799 2799 } … … 2935 2935 // test whether old center is on the band's plane 2936 2936 if (fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) { 2937 eLog() << Verbose(1) << "Something's very wrong here: RelativeOldSphereCenter is not on the band's plane as desired by " << fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl;2937 DoeLog(1) && (eLog()<< Verbose(1) << "Something's very wrong here: RelativeOldSphereCenter is not on the band's plane as desired by " << fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl); 2938 2938 RelativeOldSphereCenter.ProjectOntoPlane(&CirclePlaneNormal); 2939 2939 } … … 2945 2945 Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl; 2946 2946 if (fabs(RelativeOldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { // rotated the wrong way! 2947 eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl;2947 DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl); 2948 2948 } 2949 2949 … … 2954 2954 //Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl; 2955 2955 } else { 2956 eLog() << Verbose(1) << "Vector " << CircleCenter << " is outside of LinkedCell's bounding box." << endl;2956 DoeLog(1) && (eLog()<< Verbose(1) << "Vector " << CircleCenter << " is outside of LinkedCell's bounding box." << endl); 2957 2957 return; 2958 2958 } … … 2993 2993 otherradius = CandidateLine.BaseLine->endpoints[1]->node->node->DistanceSquared(&NewPlaneCenter); 2994 2994 if (fabs(radius - otherradius) > HULLEPSILON) { 2995 eLog() << Verbose(1) << "Distance to center of circumcircle is not the same from each corner of the triangle: " << fabs(radius-otherradius) << endl;2995 DoeLog(1) && (eLog()<< Verbose(1) << "Distance to center of circumcircle is not the same from each corner of the triangle: " << fabs(radius-otherradius) << endl); 2996 2996 } 2997 2997 // construct both new centers … … 3060 3060 } 3061 3061 } else { 3062 eLog() << Verbose(1) << "The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;3062 DoeLog(1) && (eLog()<< Verbose(1) << "The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << "." << endl); 3063 3063 } 3064 3064 } else { … … 3119 3119 3120 3120 if (LinesOnBoundary.empty()) { 3121 eLog() << Verbose(1) << "There is no tesselation structure to compare the point with, please create one first." << endl;3121 DoeLog(1) && (eLog()<< Verbose(1) << "There is no tesselation structure to compare the point with, please create one first." << endl); 3122 3122 return NULL; 3123 3123 } … … 3146 3146 } 3147 3147 } else { 3148 eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl;3148 DoeLog(1) && (eLog()<< Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl); 3149 3149 } 3150 3150 } … … 3152 3152 // check whether we found some points 3153 3153 if (points->empty()) { 3154 eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;3154 DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl); 3155 3155 delete(points); 3156 3156 return NULL; … … 3171 3171 DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x,LC); 3172 3172 if (points == NULL) { 3173 eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;3173 DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl); 3174 3174 return NULL; 3175 3175 } … … 3237 3237 DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x,LC); 3238 3238 if (points == NULL) { 3239 eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;3239 DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl); 3240 3240 return NULL; 3241 3241 } … … 3286 3286 const double distance = BaseLineIntersection.NormSquared(); 3287 3287 if (Center.NormSquared() > BaseLine.NormSquared()) { 3288 eLog() << Verbose(0) << "Algorithmic error: In second case we have intersection outside of baseline!" << endl;3288 DoeLog(0) && (eLog()<< Verbose(0) << "Algorithmic error: In second case we have intersection outside of baseline!" << endl); 3289 3289 } 3290 3290 if ((ClosestLines.empty()) || (distance < MinDistance)) { … … 3485 3485 ReferencePoint = PointRunner->second; 3486 3486 } else { 3487 eLog() << Verbose(2) << "GetAllConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl;3487 DoeLog(2) && (eLog()<< Verbose(2) << "GetAllConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl); 3488 3488 ReferencePoint = NULL; 3489 3489 } … … 3517 3517 3518 3518 if (connectedPoints->empty()) { // if have not found any points 3519 eLog() << Verbose(1) << "We have not found any connected points to " << *Point<< "." << endl;3519 DoeLog(1) && (eLog()<< Verbose(1) << "We have not found any connected points to " << *Point<< "." << endl); 3520 3520 return NULL; 3521 3521 } … … 3550 3550 3551 3551 if (SetOfNeighbours == NULL) { 3552 eLog() << Verbose(2) << "Could not find any connected points!" << endl;3552 DoeLog(2) && (eLog()<< Verbose(2) << "Could not find any connected points!" << endl); 3553 3553 delete(connectedCircle); 3554 3554 return NULL; … … 3561 3561 PlaneNormal.AddVector(&(*Runner)->NormalVector); 3562 3562 } else { 3563 eLog() << Verbose(0) << "Could not find any triangles for point " << *Point << "." << endl;3563 DoeLog(0) && (eLog()<< Verbose(0) << "Could not find any triangles for point " << *Point << "." << endl); 3564 3564 performCriticalExit(); 3565 3565 } … … 3580 3580 AngleZero.ProjectOntoPlane(&PlaneNormal); 3581 3581 if (AngleZero.NormSquared() < MYEPSILON) { 3582 eLog() << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl;3582 DoeLog(0) && (eLog()<< Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl); 3583 3583 performCriticalExit(); 3584 3584 } … … 3631 3631 3632 3632 if (SetOfNeighbours == NULL) { 3633 eLog() << Verbose(2) << "Could not find any connected points!" << endl;3633 DoeLog(2) && (eLog()<< Verbose(2) << "Could not find any connected points!" << endl); 3634 3634 delete(connectedCircle); 3635 3635 return NULL; … … 3685 3685 AngleZero.ProjectOntoPlane(&PlaneNormal); 3686 3686 if (AngleZero.NormSquared() < MYEPSILON) { 3687 eLog() << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl;3687 DoeLog(0) && (eLog()<< Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl); 3688 3688 performCriticalExit(); 3689 3689 } … … 3708 3708 InserterTest = anglesOfPoints.insert(pair<double, TesselPoint*>(angle, (*listRunner))); 3709 3709 if (!InserterTest.second) { 3710 eLog() << Verbose(0) << "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner) << endl;3710 DoeLog(0) && (eLog()<< Verbose(0) << "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner) << endl); 3711 3711 performCriticalExit(); 3712 3712 } … … 3748 3748 ReferencePoint = PointRunner->second; 3749 3749 } else { 3750 eLog() << Verbose(1) << "GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl;3750 DoeLog(1) && (eLog()<< Verbose(1) << "GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl); 3751 3751 return NULL; 3752 3752 } … … 3765 3765 LineRunner = TouchedLine.find(runner->second); 3766 3766 if (LineRunner == TouchedLine.end()) { 3767 eLog() << Verbose(1) << "I could not find " << *runner->second << " in the touched list." << endl;3767 DoeLog(1) && (eLog()<< Verbose(1) << "I could not find " << *runner->second << " in the touched list." << endl); 3768 3768 } else if (!LineRunner->second) { 3769 3769 LineRunner->second = true; … … 3795 3795 } 3796 3796 } else { 3797 eLog() << Verbose(1) << "I could not find " << *triangle << " in the touched list." << endl;3797 DoeLog(1) && (eLog()<< Verbose(1) << "I could not find " << *triangle << " in the touched list." << endl); 3798 3798 triangle = NULL; 3799 3799 } … … 3812 3812 LineRunner = TouchedLine.find(CurrentLine); 3813 3813 if (LineRunner == TouchedLine.end()) 3814 eLog() << Verbose(1) << "I could not find " << *CurrentLine << " in the touched list." << endl;3814 DoeLog(1) && (eLog()<< Verbose(1) << "I could not find " << *CurrentLine << " in the touched list." << endl); 3815 3815 else 3816 3816 LineRunner->second = true; … … 3830 3830 } 3831 3831 } else { 3832 eLog() << Verbose(1) << "There are no lines attached to " << *ReferencePoint << "." << endl;3832 DoeLog(1) && (eLog()<< Verbose(1) << "There are no lines attached to " << *ReferencePoint << "." << endl); 3833 3833 } 3834 3834 … … 3910 3910 3911 3911 if (Point == NULL) { 3912 eLog() << Verbose(1) << "Point given is NULL." << endl;3912 DoeLog(1) && (eLog()<< Verbose(1) << "Point given is NULL." << endl); 3913 3913 } else { 3914 3914 // go through its lines and insert all triangles … … 3942 3942 3943 3943 if (point == NULL) { 3944 eLog() << Verbose(1) << "Cannot remove the point " << point << ", it's NULL!" << endl;3944 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot remove the point " << point << ", it's NULL!" << endl); 3945 3945 return 0.; 3946 3946 } else … … 3952 3952 // get list of connected points 3953 3953 if (point->lines.empty()) { 3954 eLog() << Verbose(1) << "Cannot remove the point " << *point << ", it's connected to no lines!" << endl;3954 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot remove the point " << *point << ", it's connected to no lines!" << endl); 3955 3955 return 0.; 3956 3956 } … … 4033 4033 MiddleNode = EndNode; 4034 4034 if (MiddleNode == connectedPath->end()) { 4035 eLog() << Verbose(0) << "CRITICAL: Could not find a smallest angle!" << endl;4035 DoeLog(0) && (eLog()<< Verbose(0) << "CRITICAL: Could not find a smallest angle!" << endl); 4036 4036 performCriticalExit(); 4037 4037 } … … 4052 4052 triangle = GetPresentTriangle(TriangleCandidates); 4053 4053 if (triangle != NULL) { 4054 eLog() << Verbose(0) << "New triangle already present, skipping!" << endl;4054 DoeLog(0) && (eLog()<< Verbose(0) << "New triangle already present, skipping!" << endl); 4055 4055 StartNode++; 4056 4056 MiddleNode++; … … 4090 4090 break; 4091 4091 } else if (connectedPath->size() < 2) { // something's gone wrong! 4092 eLog() << Verbose(0) << "CRITICAL: There are only two endpoints left!" << endl;4092 DoeLog(0) && (eLog()<< Verbose(0) << "CRITICAL: There are only two endpoints left!" << endl); 4093 4093 performCriticalExit(); 4094 4094 } else { … … 4243 4243 } 4244 4244 default: 4245 eLog() << Verbose(0) << "Number of wildcards is greater than 3, cannot happen!" << endl;4245 DoeLog(0) && (eLog()<< Verbose(0) << "Number of wildcards is greater than 3, cannot happen!" << endl); 4246 4246 performCriticalExit(); 4247 4247 break; … … 4296 4296 // sanity check 4297 4297 if (LinesOnBoundary.empty()) { 4298 eLog() << Verbose(2) << "FindAllDegeneratedTriangles() was called without any tesselation structure.";4298 DoeLog(2) && (eLog()<< Verbose(2) << "FindAllDegeneratedTriangles() was called without any tesselation structure."); 4299 4299 return DegeneratedLines; 4300 4300 } … … 4320 4320 Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl; 4321 4321 else 4322 eLog() << Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl;4322 DoeLog(1) && (eLog()<< Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl); 4323 4323 } 4324 4324 … … 4480 4480 NearestBoundaryPoint = PointRunner->second; 4481 4481 } else { 4482 eLog() << Verbose(1) << "I cannot find the boundary point." << endl;4482 DoeLog(1) && (eLog()<< Verbose(1) << "I cannot find the boundary point." << endl); 4483 4483 return; 4484 4484 } … … 4548 4548 if ((BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[0])) && (BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[1]))) { 4549 4549 if (BestLine == BTS->lines[i]){ 4550 eLog() << Verbose(0) << "BestLine is same as found line, something's wrong here!" << endl;4550 DoeLog(0) && (eLog()<< Verbose(0) << "BestLine is same as found line, something's wrong here!" << endl); 4551 4551 performCriticalExit(); 4552 4552 } … … 4740 4740 // connections to either polygon ... 4741 4741 if (T->size() % 2 != 0) { 4742 eLog() << Verbose(0) << " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!" << endl;4742 DoeLog(0) && (eLog()<< Verbose(0) << " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!" << endl); 4743 4743 performCriticalExit(); 4744 4744 } … … 4775 4775 AddTesselationLine(TPS[1], TPS[2], 2); 4776 4776 if (TriangleNrs.empty()) 4777 eLog() << Verbose(0) << "No more free triangle numbers!" << endl;4777 DoeLog(0) && (eLog()<< Verbose(0) << "No more free triangle numbers!" << endl); 4778 4778 BTS = new BoundaryTriangleSet(BLS, TriangleNrs.top()); // copy triangle ... 4779 4779 AddTesselationTriangle(); // ... and add … … 4784 4784 } 4785 4785 if (!TriangleNrs.empty()) { 4786 eLog() << Verbose(0) << "There have been less triangles created than removed!" << endl;4786 DoeLog(0) && (eLog()<< Verbose(0) << "There have been less triangles created than removed!" << endl); 4787 4787 } 4788 4788 delete(T); // remove the triangleset
Note:
See TracChangeset
for help on using the changeset viewer.