Changeset c419f2
- Timestamp:
- Oct 14, 2009, 11:10:47 AM (16 years ago)
- Children:
- a2db10
- Parents:
- 6f9d14
- Location:
- molecuilder/src
- Files:
-
- 2 edited
-
tesselation.cpp (modified) (8 diffs)
-
tesselationhelpers.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/tesselation.cpp
r6f9d14 rc419f2 8 8 #include <fstream> 9 9 10 #include "helpers.hpp" 10 11 #include "linkedcell.hpp" 11 12 #include "tesselation.hpp" … … 2511 2512 return NULL; 2512 2513 } 2513 2514 *out << Verbose(1) << "Finding closest Tesselpoint to " << *x << " ... " << endl; 2514 2515 trianglePoints[0] = FindClosestPoint(x, SecondPoint, LC); 2515 2516 … … 2661 2662 bool takePoint = false; 2662 2663 2664 *out << Verbose(3) << "Begin of GetAllConnectedPoints" << endl; 2665 2663 2666 // find the respective boundary point 2664 2667 PointMap::iterator PointRunner = PointsOnBoundary.find(Point->nr); … … 2700 2703 } 2701 2704 2705 *out << Verbose(3) << "End of GetAllConnectedPoints" << endl; 2702 2706 return connectedPoints; 2703 2707 }; … … 2726 2730 Vector helper; 2727 2731 2732 *out << Verbose(2) << "Begin of GetCircleOfConnectedPoints" << endl; 2733 2728 2734 // calculate central point 2729 2735 for (set<TesselPoint*>::iterator TesselRunner = connectedPoints->begin(); TesselRunner != connectedPoints->end(); TesselRunner++) … … 2741 2747 2742 2748 // construct one orthogonal vector 2743 if (Reference != NULL) 2749 if (Reference != NULL) { 2744 2750 AngleZero.CopyVector(Reference); 2751 AngleZero.SubtractVector(Point->node); 2752 AngleZero.ProjectOntoPlane(&PlaneNormal); 2753 } 2754 if ((Reference == NULL) || (AngleZero.NormSquared() < MYEPSILON )) { 2755 *out << Verbose(4) << "Using alternatively " << *(*connectedPoints->begin())->node << " as angle 0 referencer." << endl; 2756 AngleZero.CopyVector((*connectedPoints->begin())->node); 2757 AngleZero.SubtractVector(Point->node); 2758 AngleZero.ProjectOntoPlane(&PlaneNormal); 2759 if (AngleZero.NormSquared() < MYEPSILON) { 2760 cerr << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl; 2761 performCriticalExit(); 2762 } 2763 } 2764 *out << Verbose(4) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl; 2765 if (AngleZero.NormSquared() > MYEPSILON) 2766 OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero); 2745 2767 else 2746 AngleZero.CopyVector((*connectedPoints->begin())->node); 2747 AngleZero.SubtractVector(Point->node); 2748 AngleZero.ProjectOntoPlane(&PlaneNormal); 2749 *out << Verbose(4) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl; 2750 OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero); 2768 OrthogonalVector.MakeNormalVector(&PlaneNormal); 2751 2769 *out << Verbose(4) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl; 2752 2770 … … 2766 2784 2767 2785 delete(connectedPoints); 2786 2787 *out << Verbose(2) << "End of GetCircleOfConnectedPoints" << endl; 2788 2768 2789 return connectedCircle; 2769 2790 } … … 3223 3244 for (int i = 0; i < 3; i++) { 3224 3245 if (TrianglePoints[i] != NULL) { 3225 for (int j = i ; j < 3; j++) {3246 for (int j = i+1; j < 3; j++) { 3226 3247 if (TrianglePoints[j] != NULL) { 3227 FindLine = TrianglePoints[i]->lines.find(TrianglePoints[j]->node->nr);3228 if (FindLine != TrianglePoints[i]->lines.end()) {3229 for (; FindLine->first == TrianglePoints[j]->node->nr;FindLine++) {3230 FindTriangle = FindLine->second->triangles.begin();3231 for (; FindTriangle != FindLine->second->triangles.end(); FindTriangle++) {3232 if (FindTriangle->second->IsPresentTupel(TrianglePoints)) {3233 result->push_back(FindTriangle->second);3234 }3248 for (FindLine = TrianglePoints[i]->lines.find(TrianglePoints[j]->node->nr); // is a multimap! 3249 (FindLine != TrianglePoints[i]->lines.end()) && (FindLine->first == TrianglePoints[j]->node->nr); 3250 FindLine++) { 3251 for (FindTriangle = FindLine->second->triangles.begin(); 3252 FindTriangle != FindLine->second->triangles.end(); 3253 FindTriangle++) { 3254 if (FindTriangle->second->IsPresentTupel(TrianglePoints)) { 3255 result->push_back(FindTriangle->second); 3235 3256 } 3236 3257 } 3237 // Is it sufficient to consider one of the triangle lines for this.3238 return result;3239 3240 3258 } 3259 // Is it sufficient to consider one of the triangle lines for this. 3260 return result; 3241 3261 } 3242 3262 } -
molecuilder/src/tesselationhelpers.cpp
r6f9d14 rc419f2 635 635 } 636 636 } 637 637 // output 638 if (closestPoint != NULL) { 639 cout << Verbose(2) << "Closest point is " << *closestPoint; 640 if (SecondPoint != NULL) 641 cout << " and second closest is " << *SecondPoint; 642 cout << "." << endl; 643 } 638 644 return closestPoint; 639 645 };
Note:
See TracChangeset
for help on using the changeset viewer.
