Changeset 543ce4 for molecuilder/src/tesselationhelpers.cpp
- Timestamp:
- Nov 4, 2009, 7:56:04 PM (16 years ago)
- Children:
- 4ef101, aa8542
- Parents:
- ec70ec
- File:
-
- 1 edited
-
molecuilder/src/tesselationhelpers.cpp (modified) (37 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/tesselationhelpers.cpp
rec70ec r543ce4 9 9 10 10 #include "linkedcell.hpp" 11 #include "log.hpp" 11 12 #include "tesselation.hpp" 12 13 #include "tesselationhelpers.hpp" … … 76 77 77 78 if (fabs(m11) < MYEPSILON) 78 cerr<< "ERROR: three points are colinear." << endl;79 eLog() << Verbose(0) << "ERROR: three points are colinear." << endl; 79 80 80 81 center->x[0] = 0.5 * m12/ m11; … … 83 84 84 85 if (fabs(a.Distance(center) - RADIUS) > MYEPSILON) 85 cerr<< "ERROR: The given center is further way by " << fabs(a.Distance(center) - RADIUS) << " from a than RADIUS." << endl;86 eLog() << Verbose(0) << "ERROR: The given center is further way by " << fabs(a.Distance(center) - RADIUS) << " from a than RADIUS." << endl; 86 87 87 88 gsl_matrix_free(A); … … 113 114 double Restradius; 114 115 Vector OtherCenter; 115 cout<< Verbose(3) << "Begin of GetCenterOfSphere.\n";116 Log() << Verbose(3) << "Begin of GetCenterOfSphere.\n"; 116 117 Center->Zero(); 117 118 helper.CopyVector(&a); … … 127 128 Center->Scale(1./(sin(2.*alpha) + sin(2.*beta) + sin(2.*gamma))); 128 129 NewUmkreismittelpunkt->CopyVector(Center); 129 cout<< Verbose(4) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n";130 Log() << Verbose(4) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n"; 130 131 // Here we calculated center of circumscribing circle, using barycentric coordinates 131 cout<< Verbose(4) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n";132 Log() << Verbose(4) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n"; 132 133 133 134 TempNormal.CopyVector(&a); … … 153 154 TempNormal.Normalize(); 154 155 Restradius = sqrt(RADIUS*RADIUS - Umkreisradius*Umkreisradius); 155 cout<< Verbose(4) << "Height of center of circumference to center of sphere is " << Restradius << ".\n";156 Log() << Verbose(4) << "Height of center of circumference to center of sphere is " << Restradius << ".\n"; 156 157 TempNormal.Scale(Restradius); 157 cout<< Verbose(4) << "Shift vector to sphere of circumference is " << TempNormal << ".\n";158 Log() << Verbose(4) << "Shift vector to sphere of circumference is " << TempNormal << ".\n"; 158 159 159 160 Center->AddVector(&TempNormal); 160 cout<< Verbose(0) << "Center of sphere of circumference is " << *Center << ".\n";161 Log() << Verbose(0) << "Center of sphere of circumference is " << *Center << ".\n"; 161 162 GetSphere(&OtherCenter, a, b, c, RADIUS); 162 cout<< Verbose(0) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n";163 cout<< Verbose(3) << "End of GetCenterOfSphere.\n";163 Log() << Verbose(0) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n"; 164 Log() << Verbose(3) << "End of GetCenterOfSphere.\n"; 164 165 }; 165 166 … … 185 186 beta = M_PI - SideC.Angle(&SideA); 186 187 gamma = M_PI - SideA.Angle(&SideB); 187 // cout<< Verbose(3) << "INFO: alpha = " << alpha/M_PI*180. << ", beta = " << beta/M_PI*180. << ", gamma = " << gamma/M_PI*180. << "." << endl;188 //Log() << Verbose(3) << "INFO: alpha = " << alpha/M_PI*180. << ", beta = " << beta/M_PI*180. << ", gamma = " << gamma/M_PI*180. << "." << endl; 188 189 if (fabs(M_PI - alpha - beta - gamma) > HULLEPSILON) 189 cerr<< "GetCenterofCircumcircle: Sum of angles " << (alpha+beta+gamma)/M_PI*180. << " > 180 degrees by " << fabs(M_PI - alpha - beta - gamma)/M_PI*180. << "!" << endl;190 eLog() << Verbose(0) << "GetCenterofCircumcircle: Sum of angles " << (alpha+beta+gamma)/M_PI*180. << " > 180 degrees by " << fabs(M_PI - alpha - beta - gamma)/M_PI*180. << "!" << endl; 190 191 191 192 Center->Zero(); … … 223 224 // test whether new center is on the parameter circle's plane 224 225 if (fabs(helper.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) { 225 cerr<< "ERROR: Something's very wrong here: NewSphereCenter is not on the band's plane as desired by " <<fabs(helper.ScalarProduct(&CirclePlaneNormal)) << "!" << endl;226 eLog() << Verbose(0) << "ERROR: Something's very wrong here: NewSphereCenter is not on the band's plane as desired by " <<fabs(helper.ScalarProduct(&CirclePlaneNormal)) << "!" << endl; 226 227 helper.ProjectOntoPlane(&CirclePlaneNormal); 227 228 } … … 229 230 // test whether the new center vector has length of CircleRadius 230 231 if (fabs(radius - CircleRadius) > HULLEPSILON) 231 cerr<< Verbose(1) << "ERROR: The projected center of the new sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;232 eLog() << Verbose(1) << "ERROR: The projected center of the new sphere has radius " << radius << " instead of " << CircleRadius << "." << endl; 232 233 alpha = helper.Angle(&OldSphereCenter); 233 234 // make the angle unique by checking the halfplanes/search direction 234 235 if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON) // acos is not unique on [0, 2.*M_PI), hence extra check to decide between two half intervals 235 236 alpha = 2.*M_PI - alpha; 236 // cout<< Verbose(2) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << OldSphereCenter << " and resulting angle is " << alpha << "." << endl;237 //Log() << Verbose(2) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << OldSphereCenter << " and resulting angle is " << alpha << "." << endl; 237 238 radius = helper.Distance(&OldSphereCenter); 238 239 helper.ProjectOntoPlane(&NormalVector); 239 240 // check whether new center is somewhat away or at least right over the current baseline to prevent intersecting triangles 240 241 if ((radius > HULLEPSILON) || (helper.Norm() < HULLEPSILON)) { 241 // cout<< Verbose(2) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl;242 //Log() << Verbose(2) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl; 242 243 return alpha; 243 244 } else { 244 // cout<< Verbose(1) << "INFO: NewSphereCenter " << helper << " is too close to OldSphereCenter" << OldSphereCenter << "." << endl;245 //Log() << Verbose(1) << "INFO: NewSphereCenter " << helper << " is too close to OldSphereCenter" << OldSphereCenter << "." << endl; 245 246 return 2.*M_PI; 246 247 } … … 282 283 283 284 retval = HeightA.ScalarProduct(&HeightA) + HeightB.ScalarProduct(&HeightB); 284 // cout<< Verbose(2) << "MinIntersectDistance called, result: " << retval << endl;285 //Log() << Verbose(2) << "MinIntersectDistance called, result: " << retval << endl; 285 286 286 287 return retval; … … 349 350 350 351 if (status == GSL_SUCCESS) { 351 cout<< Verbose(2) << "converged to minimum" << endl;352 Log() << Verbose(2) << "converged to minimum" << endl; 352 353 } 353 354 } while (status == GSL_CONTINUE && iter < 100); … … 374 375 t2 = HeightB.ScalarProduct(&SideB)/SideB.ScalarProduct(&SideB); 375 376 376 cout<< Verbose(2) << "Intersection " << intersection << " is at "377 Log() << Verbose(2) << "Intersection " << intersection << " is at " 377 378 << t1 << " for (" << point1 << "," << point2 << ") and at " 378 379 << t2 << " for (" << point3 << "," << point4 << "): "; 379 380 380 381 if (((t1 >= 0) && (t1 <= 1)) && ((t2 >= 0) && (t2 <= 1))) { 381 cout<< "true intersection." << endl;382 Log() << Verbose(0) << "true intersection." << endl; 382 383 result = true; 383 384 } else { 384 cout<< "intersection out of region of interest." << endl;385 Log() << Verbose(0) << "intersection out of region of interest." << endl; 385 386 result = false; 386 387 } … … 416 417 } 417 418 418 cout<< Verbose(4) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl;419 Log() << Verbose(4) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl; 419 420 420 421 return phi; … … 472 473 } 473 474 } else { // no line 474 cout<< Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl;475 Log() << Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl; 475 476 result = true; 476 477 } 477 478 } 478 479 if ((!result) && (counter > 1)) { 479 cout<< Verbose(2) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl;480 Log() << Verbose(2) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl; 480 481 result = true; 481 482 } … … 490 491 Vector BaseLineVector, OrthogonalVector, helper; 491 492 if (candidate1->BaseLine != candidate2->BaseLine) { // sanity check 492 cout<< Verbose(0) << "ERROR: sortCandidates was called for two different baselines: " << candidate1->BaseLine << " and " << candidate2->BaseLine << "." << endl;493 Log() << Verbose(0) << "ERROR: sortCandidates was called for two different baselines: " << candidate1->BaseLine << " and " << candidate2->BaseLine << "." << endl; 493 494 //return false; 494 495 exit(1); … … 521 522 } 522 523 523 cout<< Verbose(2) << *candidate1->point << " has angle " << phi << endl;524 cout<< Verbose(2) << *candidate2->point << " has angle " << psi << endl;524 Log() << Verbose(2) << *candidate1->point << " has angle " << phi << endl; 525 Log() << Verbose(2) << *candidate2->point << " has angle " << psi << endl; 525 526 526 527 // return comparison … … 548 549 for(int i=0;i<NDIM;i++) // store indices of this cell 549 550 N[i] = LC->n[i]; 550 cout<< Verbose(2) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;551 Log() << Verbose(2) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl; 551 552 552 553 LC->GetNeighbourBounds(Nlower, Nupper); 553 // cout<< endl;554 //Log() << Verbose(0) << endl; 554 555 for (LC->n[0] = Nlower[0]; LC->n[0] <= Nupper[0]; LC->n[0]++) 555 556 for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++) 556 557 for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) { 557 558 const LinkedNodes *List = LC->GetCurrentCell(); 558 // cout<< Verbose(3) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;559 //Log() << Verbose(3) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl; 559 560 if (List != NULL) { 560 561 for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { … … 569 570 distance = currentNorm; 570 571 closestPoint = (*Runner); 571 // cout<< Verbose(2) << "INFO: New Second Nearest Neighbour is " << *secondClosestPoint << "." << endl;572 //Log() << Verbose(2) << "INFO: New Second Nearest Neighbour is " << *secondClosestPoint << "." << endl; 572 573 } 573 574 } 574 575 } else { 575 cerr<< "ERROR: The current cell " << LC->n[0] << "," << LC->n[1] << ","576 eLog() << Verbose(0) << "ERROR: The current cell " << LC->n[0] << "," << LC->n[1] << "," 576 577 << LC->n[2] << " is invalid!" << endl; 577 578 } … … 602 603 for(int i=0;i<NDIM;i++) // store indices of this cell 603 604 N[i] = LC->n[i]; 604 cout<< Verbose(3) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;605 Log() << Verbose(3) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl; 605 606 606 607 LC->GetNeighbourBounds(Nlower, Nupper); 607 // cout<< endl;608 //Log() << Verbose(0) << endl; 608 609 for (LC->n[0] = Nlower[0]; LC->n[0] <= Nupper[0]; LC->n[0]++) 609 610 for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++) 610 611 for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) { 611 612 const LinkedNodes *List = LC->GetCurrentCell(); 612 // cout<< Verbose(3) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;613 //Log() << Verbose(3) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl; 613 614 if (List != NULL) { 614 615 for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { … … 621 622 distance = currentNorm; 622 623 closestPoint = (*Runner); 623 // cout<< Verbose(2) << "INFO: New Nearest Neighbour is " << *closestPoint << "." << endl;624 //Log() << Verbose(2) << "INFO: New Nearest Neighbour is " << *closestPoint << "." << endl; 624 625 } else if (currentNorm < secondDistance) { 625 626 secondDistance = currentNorm; 626 627 SecondPoint = (*Runner); 627 // cout<< Verbose(2) << "INFO: New Second Nearest Neighbour is " << *SecondPoint << "." << endl;628 //Log() << Verbose(2) << "INFO: New Second Nearest Neighbour is " << *SecondPoint << "." << endl; 628 629 } 629 630 } 630 631 } else { 631 cerr<< "ERROR: The current cell " << LC->n[0] << "," << LC->n[1] << ","632 eLog() << Verbose(0) << "ERROR: The current cell " << LC->n[0] << "," << LC->n[1] << "," 632 633 << LC->n[2] << " is invalid!" << endl; 633 634 } … … 635 636 // output 636 637 if (closestPoint != NULL) { 637 cout<< Verbose(2) << "Closest point is " << *closestPoint;638 Log() << Verbose(2) << "Closest point is " << *closestPoint; 638 639 if (SecondPoint != NULL) 639 cout<< " and second closest is " << *SecondPoint;640 cout<< "." << endl;640 Log() << Verbose(0) << " and second closest is " << *SecondPoint; 641 Log() << Verbose(0) << "." << endl; 641 642 } 642 643 return closestPoint; … … 649 650 * \return Vector on reference line that has closest distance 650 651 */ 651 Vector * GetClosestPointBetweenLine( ofstream *out,const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase)652 Vector * GetClosestPointBetweenLine(const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase) 652 653 { 653 654 // construct the plane of the two baselines (i.e. take both their directional vectors) … … 661 662 Normal.VectorProduct(&OtherBaseline); 662 663 Normal.Normalize(); 663 *out<< Verbose(4) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl;664 Log() << Verbose(4) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl; 664 665 665 666 // project one offset point of OtherBase onto this plane (and add plane offset vector) … … 675 676 // calculate the intersection between this projected baseline and Base 676 677 Vector *Intersection = new Vector; 677 Intersection->GetIntersectionOfTwoLinesOnPlane( out,Base->endpoints[0]->node->node, Base->endpoints[1]->node->node, &NewOffset, &NewDirection, &Normal);678 Intersection->GetIntersectionOfTwoLinesOnPlane(Base->endpoints[0]->node->node, Base->endpoints[1]->node->node, &NewOffset, &NewDirection, &Normal); 678 679 Normal.CopyVector(Intersection); 679 680 Normal.SubtractVector(Base->endpoints[0]->node->node); 680 *out<< Verbose(3) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl;681 Log() << Verbose(3) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl; 681 682 682 683 return Intersection; … … 689 690 * \return distance between \a *x and plane defined by \a *triangle, -1 - if something went wrong 690 691 */ 691 double DistanceToTrianglePlane( ofstream * const out,const Vector *x, const BoundaryTriangleSet * const triangle)692 double DistanceToTrianglePlane(const Vector *x, const BoundaryTriangleSet * const triangle) 692 693 { 693 694 double distance = 0.; … … 695 696 return -1; 696 697 } 697 distance = x->DistanceToPlane( out,&triangle->NormalVector, triangle->endpoints[0]->node->node);698 distance = x->DistanceToPlane(&triangle->NormalVector, triangle->endpoints[0]->node->node); 698 699 return distance; 699 700 }; … … 705 706 * \param *mol molecule structure with atom positions 706 707 */ 707 void WriteVrmlFile(ofstream * const out, ofstream * constvrmlfile, const Tesselation * const Tess, const PointCloud * const cloud)708 void WriteVrmlFile(ofstream * const vrmlfile, const Tesselation * const Tess, const PointCloud * const cloud) 708 709 { 709 710 TesselPoint *Walker = NULL; 710 711 int i; 711 Vector *center = cloud->GetCenter( out);712 Vector *center = cloud->GetCenter(); 712 713 if (vrmlfile != NULL) { 713 // cout<< Verbose(1) << "Writing Raster3D file ... ";714 //Log() << Verbose(1) << "Writing Raster3D file ... "; 714 715 *vrmlfile << "#VRML V2.0 utf8" << endl; 715 716 *vrmlfile << "#Created by molecuilder" << endl; … … 737 738 } 738 739 } else { 739 cerr<< "ERROR: Given vrmlfile is " << vrmlfile << "." << endl;740 eLog() << Verbose(0) << "ERROR: Given vrmlfile is " << vrmlfile << "." << endl; 740 741 } 741 742 delete(center); … … 748 749 * \param *mol molecule structure with atom positions 749 750 */ 750 void IncludeSphereinRaster3D(ofstream * const out, ofstream * constrasterfile, const Tesselation * const Tess, const PointCloud * const cloud)751 void IncludeSphereinRaster3D(ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud) 751 752 { 752 753 Vector helper; 753 754 // include the current position of the virtual sphere in the temporary raster3d file 754 Vector *center = cloud->GetCenter( out);755 Vector *center = cloud->GetCenter(); 755 756 // make the circumsphere's center absolute again 756 757 helper.CopyVector(Tess->LastTriangle->endpoints[0]->node->node); … … 773 774 * \param *mol molecule structure with atom positions 774 775 */ 775 void WriteRaster3dFile(ofstream * const out, ofstream * constrasterfile, const Tesselation * const Tess, const PointCloud * const cloud)776 void WriteRaster3dFile(ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud) 776 777 { 777 778 TesselPoint *Walker = NULL; 778 779 int i; 779 Vector *center = cloud->GetCenter( out);780 Vector *center = cloud->GetCenter(); 780 781 if (rasterfile != NULL) { 781 // cout<< Verbose(1) << "Writing Raster3D file ... ";782 //Log() << Verbose(1) << "Writing Raster3D file ... "; 782 783 *rasterfile << "# Raster3D object description, created by MoleCuilder" << endl; 783 784 *rasterfile << "@header.r3d" << endl; … … 807 808 *rasterfile << "9\n# terminating special property\n"; 808 809 } else { 809 cerr<< "ERROR: Given rasterfile is " << rasterfile << "." << endl;810 } 811 IncludeSphereinRaster3D( out,rasterfile, Tess, cloud);810 eLog() << Verbose(0) << "ERROR: Given rasterfile is " << rasterfile << "." << endl; 811 } 812 IncludeSphereinRaster3D(rasterfile, Tess, cloud); 812 813 delete(center); 813 814 }; … … 818 819 * \param N arbitrary number to differentiate various zones in the tecplot format 819 820 */ 820 void WriteTecplotFile(ofstream * const out, ofstream * consttecplot, const Tesselation * const TesselStruct, const PointCloud * const cloud, const int N)821 void WriteTecplotFile(ofstream * const tecplot, const Tesselation * const TesselStruct, const PointCloud * const cloud, const int N) 821 822 { 822 823 if ((tecplot != NULL) && (TesselStruct != NULL)) { … … 835 836 836 837 // print atom coordinates 837 *out<< Verbose(2) << "The following triangles were created:";838 Log() << Verbose(2) << "The following triangles were created:"; 838 839 int Counter = 1; 839 840 TesselPoint *Walker = NULL; … … 846 847 // print connectivity 847 848 for (TriangleMap::const_iterator runner = TesselStruct->TrianglesOnBoundary.begin(); runner != TesselStruct->TrianglesOnBoundary.end(); runner++) { 848 *out<< " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name;849 Log() << Verbose(0) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name; 849 850 *tecplot << LookupList[runner->second->endpoints[0]->node->nr] << " " << LookupList[runner->second->endpoints[1]->node->nr] << " " << LookupList[runner->second->endpoints[2]->node->nr] << endl; 850 851 } 851 852 delete[] (LookupList); 852 *out<< endl;853 Log() << Verbose(0) << endl; 853 854 } 854 855 }; … … 859 860 * \param *TesselStruct pointer to Tesselation structure 860 861 */ 861 void CalculateConcavityPerBoundaryPoint( ofstream * const out,const Tesselation * const TesselStruct)862 void CalculateConcavityPerBoundaryPoint(const Tesselation * const TesselStruct) 862 863 { 863 864 class BoundaryPointSet *point = NULL; 864 865 class BoundaryLineSet *line = NULL; 865 866 866 // *out<< Verbose(2) << "Begin of CalculateConcavityPerBoundaryPoint" << endl;867 //Log() << Verbose(2) << "Begin of CalculateConcavityPerBoundaryPoint" << endl; 867 868 // calculate remaining concavity 868 869 for (PointMap::const_iterator PointRunner = TesselStruct->PointsOnBoundary.begin(); PointRunner != TesselStruct->PointsOnBoundary.end(); PointRunner++) { 869 870 point = PointRunner->second; 870 *out<< Verbose(1) << "INFO: Current point is " << *point << "." << endl;871 Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl; 871 872 point->value = 0; 872 873 for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) { 873 874 line = LineRunner->second; 874 // *out<< Verbose(2) << "INFO: Current line of point " << *point << " is " << *line << "." << endl;875 if (!line->CheckConvexityCriterion( out))875 //Log() << Verbose(2) << "INFO: Current line of point " << *point << " is " << *line << "." << endl; 876 if (!line->CheckConvexityCriterion()) 876 877 point->value += 1; 877 878 } 878 879 } 879 // *out<< Verbose(2) << "End of CalculateConcavityPerBoundaryPoint" << endl;880 //Log() << Verbose(2) << "End of CalculateConcavityPerBoundaryPoint" << endl; 880 881 }; 881 882 … … 886 887 * \return true - all have exactly two triangles, false - some not, list is printed to screen 887 888 */ 888 bool CheckListOfBaselines( ofstream * const out,const Tesselation * const TesselStruct)889 bool CheckListOfBaselines(const Tesselation * const TesselStruct) 889 890 { 890 891 LineMap::const_iterator testline; … … 892 893 int counter = 0; 893 894 894 *out<< Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl;895 Log() << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl; 895 896 for (testline = TesselStruct->LinesOnBoundary.begin(); testline != TesselStruct->LinesOnBoundary.end(); testline++) { 896 897 if (testline->second->triangles.size() != 2) { 897 *out<< Verbose(1) << *testline->second << "\t" << testline->second->triangles.size() << endl;898 Log() << Verbose(1) << *testline->second << "\t" << testline->second->triangles.size() << endl; 898 899 counter++; 899 900 } 900 901 } 901 902 if (counter == 0) { 902 *out<< Verbose(1) << "None." << endl;903 Log() << Verbose(1) << "None." << endl; 903 904 result = true; 904 905 }
Note:
See TracChangeset
for help on using the changeset viewer.
