Changeset a9b2a0a for molecuilder/src/tesselation.cpp
- Timestamp:
- Oct 27, 2009, 4:11:22 PM (16 years ago)
- Children:
- 069034
- Parents:
- 55a71b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/tesselation.cpp
r55a71b ra9b2a0a 31 31 * \param *Walker TesselPoint this boundary point represents 32 32 */ 33 BoundaryPointSet::BoundaryPointSet(TesselPoint * Walker)33 BoundaryPointSet::BoundaryPointSet(TesselPoint * Walker) 34 34 { 35 35 node = Walker; … … 73 73 * \param &a boundary point 74 74 */ 75 ostream & operator <<(ostream &ost, BoundaryPointSet &a)75 ostream & operator <<(ostream &ost, const BoundaryPointSet &a) 76 76 { 77 77 ost << "[" << a.Nr << "|" << a.node->Name << " at " << *a.node->node << "]"; … … 96 96 * \param number number of the list 97 97 */ 98 BoundaryLineSet::BoundaryLineSet(class BoundaryPointSet *Point[2], int number)98 BoundaryLineSet::BoundaryLineSet(class BoundaryPointSet *Point[2], const int number) 99 99 { 100 100 // set number … … 275 275 * \param &a boundary line 276 276 */ 277 ostream & operator <<(ostream &ost, BoundaryLineSet &a)277 ostream & operator <<(ostream &ost, const BoundaryLineSet &a) 278 278 { 279 279 ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << " at " << *a.endpoints[0]->node->node << "," << a.endpoints[1]->node->Name << " at " << *a.endpoints[1]->node->node << "]"; … … 532 532 * \param &a boundary triangle 533 533 */ 534 ostream &operator <<(ostream &ost, BoundaryTriangleSet &a)534 ostream &operator <<(ostream &ost, const BoundaryTriangleSet &a) 535 535 { 536 536 ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << " at " << *a.endpoints[0]->node->node << "," … … 642 642 * Uses PointsOnBoundary and STL stuff. 643 643 */ 644 Vector * Tesselation::GetCenter(ofstream *out) 644 Vector * Tesselation::GetCenter(ofstream *out) const 645 645 { 646 646 Vector *Center = new Vector(0.,0.,0.); … … 657 657 * Uses PointsOnBoundary and STL stuff. 658 658 */ 659 TesselPoint * Tesselation::GetPoint() 659 TesselPoint * Tesselation::GetPoint() const 660 660 { 661 661 return (InternalPointer->second->node); … … 665 665 * Uses PointsOnBoundary and STL stuff. 666 666 */ 667 TesselPoint * Tesselation::GetTerminalPoint() 668 { 669 PointMap:: iterator Runner = PointsOnBoundary.end();667 TesselPoint * Tesselation::GetTerminalPoint() const 668 { 669 PointMap::const_iterator Runner = PointsOnBoundary.end(); 670 670 Runner--; 671 671 return (Runner->second->node); … … 675 675 * Uses PointsOnBoundary and STL stuff. 676 676 */ 677 void Tesselation::GoToNext() 677 void Tesselation::GoToNext() const 678 678 { 679 679 if (InternalPointer != PointsOnBoundary.end()) … … 684 684 * Uses PointsOnBoundary and STL stuff. 685 685 */ 686 void Tesselation::GoToPrevious() 686 void Tesselation::GoToPrevious() const 687 687 { 688 688 if (InternalPointer != PointsOnBoundary.begin()) … … 693 693 * Uses PointsOnBoundary and STL stuff. 694 694 */ 695 void Tesselation::GoToFirst() 695 void Tesselation::GoToFirst() const 696 696 { 697 697 InternalPointer = PointsOnBoundary.begin(); … … 700 700 /** PointCloud implementation of GoToLast. 701 701 * Uses PointsOnBoundary and STL stuff. 702 */ 703 void Tesselation::GoToLast() 702 */ 703 void Tesselation::GoToLast() const 704 704 { 705 705 InternalPointer = PointsOnBoundary.end(); … … 710 710 * Uses PointsOnBoundary and STL stuff. 711 711 */ 712 bool Tesselation::IsEmpty() 712 bool Tesselation::IsEmpty() const 713 713 { 714 714 return (PointsOnBoundary.empty()); … … 718 718 * Uses PointsOnBoundary and STL stuff. 719 719 */ 720 bool Tesselation::IsEnd() 720 bool Tesselation::IsEnd() const 721 721 { 722 722 return (InternalPointer == PointsOnBoundary.end()); … … 899 899 * \param *cloud cluster of points 900 900 */ 901 void Tesselation::TesselateOnBoundary(ofstream *out, PointCloud *cloud)901 void Tesselation::TesselateOnBoundary(ofstream *out, const PointCloud * const cloud) 902 902 { 903 903 bool flag; … … 1097 1097 * \return true - all straddling points insert, false - something went wrong 1098 1098 */ 1099 bool Tesselation::InsertStraddlingPoints(ofstream *out, PointCloud *cloud,LinkedCell *LC)1099 bool Tesselation::InsertStraddlingPoints(ofstream *out, const PointCloud *cloud, const LinkedCell *LC) 1100 1100 { 1101 1101 Vector Intersection, Normal; … … 1207 1207 * \return true - new point was added, false - point already present 1208 1208 */ 1209 bool 1210 Tesselation::AddBoundaryPoint(TesselPoint *Walker, int n) 1209 bool Tesselation::AddBoundaryPoint(TesselPoint * Walker, const int n) 1211 1210 { 1212 1211 PointTestPair InsertUnique; … … 1229 1228 * @param n index for this point in Tesselation::TPS array 1230 1229 */ 1231 void 1232 Tesselation::AddTesselationPoint(TesselPoint* Candidate, int n) 1230 void Tesselation::AddTesselationPoint(TesselPoint* Candidate, const int n) 1233 1231 { 1234 1232 PointTestPair InsertUnique; … … 1252 1250 * @param n index of Tesselation::BLS giving the line with both endpoints 1253 1251 */ 1254 void Tesselation::AddTesselationLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n) {1252 void Tesselation::AddTesselationLine(class BoundaryPointSet *a, class BoundaryPointSet *b, const int n) { 1255 1253 bool insertNewLine = true; 1256 1254 … … 1290 1288 * @param n index of Tesselation::BLS giving the line with both endpoints 1291 1289 */ 1292 void Tesselation::AlwaysAddTesselationTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n)1290 void Tesselation::AlwaysAddTesselationTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, const int n) 1293 1291 { 1294 1292 cout << Verbose(4) << "Adding line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << "." << endl; … … 1323 1321 * \param nr triangle number 1324 1322 */ 1325 void Tesselation::AddTesselationTriangle( int nr)1323 void Tesselation::AddTesselationTriangle(const int nr) 1326 1324 { 1327 1325 cout << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl; … … 1554 1552 * \param *LC LinkedCell structure with neighbouring TesselPoint's 1555 1553 */ 1556 void Tesselation::FindStartingTriangle(ofstream *out, const double RADIUS, LinkedCell *LC)1554 void Tesselation::FindStartingTriangle(ofstream *out, const double RADIUS, const LinkedCell *LC) 1557 1555 { 1558 1556 cout << Verbose(1) << "Begin of FindStartingTriangle\n"; 1559 1557 int i = 0; 1560 LinkedNodes *List = NULL;1561 1558 TesselPoint* FirstPoint = NULL; 1562 1559 TesselPoint* SecondPoint = NULL; … … 1580 1577 for (LC->n[(i+1)%NDIM]=0;LC->n[(i+1)%NDIM]<LC->N[(i+1)%NDIM];LC->n[(i+1)%NDIM]++) 1581 1578 for (LC->n[(i+2)%NDIM]=0;LC->n[(i+2)%NDIM]<LC->N[(i+2)%NDIM];LC->n[(i+2)%NDIM]++) { 1582 List = LC->GetCurrentCell();1579 const LinkedNodes *List = LC->GetCurrentCell(); 1583 1580 //cout << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl; 1584 1581 if (List != NULL) { 1585 for (LinkedNodes:: iterator Runner = List->begin();Runner != List->end();Runner++) {1582 for (LinkedNodes::const_iterator Runner = List->begin();Runner != List->end();Runner++) { 1586 1583 if ((*Runner)->node->x[i] > maxCoordinate[i]) { 1587 1584 cout << Verbose(2) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl; … … 1645 1642 1646 1643 //cout << Verbose(2) << "INFO: OldSphereCenter is at " << helper << ".\n"; 1647 FindThirdPointForTesselation( 1648 Oben, SearchDirection, helper, BLS[0], NULL, *&OptCandidates, &ShortestAngle, RADIUS, LC 1649 ); 1644 FindThirdPointForTesselation(Oben, SearchDirection, helper, BLS[0], NULL, *&OptCandidates, &ShortestAngle, RADIUS, LC); 1650 1645 cout << Verbose(1) << "List of third Points is "; 1651 1646 for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) { … … 1713 1708 * @param *LC LinkedCell structure with neighbouring points 1714 1709 */ 1715 bool Tesselation::FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, LinkedCell *LC)1710 bool Tesselation::FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, const LinkedCell *LC) 1716 1711 { 1717 1712 cout << Verbose(0) << "Begin of FindNextSuitableTriangle\n"; … … 1774 1769 1775 1770 // add third point 1776 FindThirdPointForTesselation( 1777 T.NormalVector, SearchDirection, OldSphereCenter, &Line, ThirdNode, OptCandidates, 1778 &ShortestAngle, RADIUS, LC 1779 ); 1771 FindThirdPointForTesselation(T.NormalVector, SearchDirection, OldSphereCenter, &Line, ThirdNode, OptCandidates, &ShortestAngle, RADIUS, LC); 1780 1772 1781 1773 } else { … … 1813 1805 AddTesselationPoint(BaseRay->endpoints[1]->node, 2); 1814 1806 1815 if (CheckLineCriteriaForDegeneratedTriangle( TPS)) {1807 if (CheckLineCriteriaForDegeneratedTriangle((const BoundaryPointSet **)TPS)) { 1816 1808 AddTesselationLine(TPS[0], TPS[1], 0); 1817 1809 AddTesselationLine(TPS[0], TPS[2], 1); … … 1842 1834 // We demand that at most one new degenerate line is created and that this line also already exists (which has to be the case due to existentTrianglesCount == 1) 1843 1835 // i.e. at least one of the three lines must be present with TriangleCount <= 1 1844 if (CheckLineCriteriaForDegeneratedTriangle( TPS)) {1836 if (CheckLineCriteriaForDegeneratedTriangle((const BoundaryPointSet **)TPS)) { 1845 1837 AddTesselationLine(TPS[0], TPS[1], 0); 1846 1838 AddTesselationLine(TPS[0], TPS[2], 1); … … 1949 1941 }; 1950 1942 1951 void Tesselation::PrintAllBoundaryPoints(ofstream *out) 1943 void Tesselation::PrintAllBoundaryPoints(ofstream *out) const 1952 1944 { 1953 1945 // print all lines 1954 1946 *out << Verbose(1) << "Printing all boundary points for debugging:" << endl; 1955 for (PointMap:: iterator PointRunner = PointsOnBoundary.begin();PointRunner != PointsOnBoundary.end(); PointRunner++)1947 for (PointMap::const_iterator PointRunner = PointsOnBoundary.begin();PointRunner != PointsOnBoundary.end(); PointRunner++) 1956 1948 *out << Verbose(2) << *(PointRunner->second) << endl; 1957 1949 }; 1958 1950 1959 void Tesselation::PrintAllBoundaryLines(ofstream *out) 1951 void Tesselation::PrintAllBoundaryLines(ofstream *out) const 1960 1952 { 1961 1953 // print all lines 1962 1954 *out << Verbose(1) << "Printing all boundary lines for debugging:" << endl; 1963 for (LineMap:: iterator LineRunner = LinesOnBoundary.begin(); LineRunner != LinesOnBoundary.end(); LineRunner++)1955 for (LineMap::const_iterator LineRunner = LinesOnBoundary.begin(); LineRunner != LinesOnBoundary.end(); LineRunner++) 1964 1956 *out << Verbose(2) << *(LineRunner->second) << endl; 1965 1957 }; 1966 1958 1967 void Tesselation::PrintAllBoundaryTriangles(ofstream *out) 1959 void Tesselation::PrintAllBoundaryTriangles(ofstream *out) const 1968 1960 { 1969 1961 // print all triangles 1970 1962 *out << Verbose(1) << "Printing all boundary triangles for debugging:" << endl; 1971 for (TriangleMap:: iterator TriangleRunner = TrianglesOnBoundary.begin(); TriangleRunner != TrianglesOnBoundary.end(); TriangleRunner++)1963 for (TriangleMap::const_iterator TriangleRunner = TrianglesOnBoundary.begin(); TriangleRunner != TrianglesOnBoundary.end(); TriangleRunner++) 1972 1964 *out << Verbose(2) << *(TriangleRunner->second) << endl; 1973 1965 }; … … 2165 2157 * \param *LC LinkedCell structure with neighbouring points 2166 2158 */ 2167 void Tesselation::FindSecondPointForTesselation(TesselPoint* a, Vector Oben, TesselPoint*& OptCandidate, double Storage[3], double RADIUS, LinkedCell *LC)2159 void Tesselation::FindSecondPointForTesselation(TesselPoint* a, Vector Oben, TesselPoint*& OptCandidate, double Storage[3], double RADIUS, const LinkedCell *LC) 2168 2160 { 2169 2161 cout << Verbose(2) << "Begin of FindSecondPointForTesselation" << endl; 2170 2162 Vector AngleCheck; 2171 2163 class TesselPoint* Candidate = NULL; 2172 double norm = -1., angle; 2173 LinkedNodes *List = NULL; 2174 int N[NDIM], Nlower[NDIM], Nupper[NDIM]; 2164 double norm = -1.; 2165 double angle = 0.; 2166 int N[NDIM]; 2167 int Nlower[NDIM]; 2168 int Nupper[NDIM]; 2175 2169 2176 2170 if (LC->SetIndexToNode(a)) { // get cell for the starting point … … 2198 2192 for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++) 2199 2193 for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) { 2200 List = LC->GetCurrentCell();2194 const LinkedNodes *List = LC->GetCurrentCell(); 2201 2195 //cout << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl; 2202 2196 if (List != NULL) { 2203 for (LinkedNodes:: iterator Runner = List->begin(); Runner != List->end(); Runner++) {2197 for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 2204 2198 Candidate = (*Runner); 2205 2199 // check if we only have one unique point yet ... … … 2285 2279 * @param *LC LinkedCell structure with neighbouring points 2286 2280 */ 2287 void Tesselation::FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, LinkedCell *LC)2281 void Tesselation::FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, const LinkedCell *LC) 2288 2282 { 2289 2283 Vector CircleCenter; // center of the circle, i.e. of the band of sphere's centers … … 2294 2288 Vector NewNormalVector; // normal vector of the Candidate's triangle 2295 2289 Vector helper, OptCandidateCenter, OtherOptCandidateCenter; 2296 LinkedNodes *List = NULL;2297 2290 double CircleRadius; // radius of this circle 2298 2291 double radius; … … 2357 2350 for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++) 2358 2351 for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) { 2359 List = LC->GetCurrentCell();2352 const LinkedNodes *List = LC->GetCurrentCell(); 2360 2353 //cout << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl; 2361 2354 if (List != NULL) { 2362 for (LinkedNodes:: iterator Runner = List->begin(); Runner != List->end(); Runner++) {2355 for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 2363 2356 Candidate = (*Runner); 2364 2357 … … 2471 2464 * \return point which is shared or NULL if none 2472 2465 */ 2473 class BoundaryPointSet *Tesselation::GetCommonEndpoint(class BoundaryLineSet * line1, class BoundaryLineSet * line2) 2474 { 2475 class BoundaryLineSet * lines[2] = 2476 { line1, line2 }; 2466 class BoundaryPointSet *Tesselation::GetCommonEndpoint(const BoundaryLineSet * line1, const BoundaryLineSet * line2) const 2467 { 2468 const BoundaryLineSet * lines[2] = { line1, line2 }; 2477 2469 class BoundaryPointSet *node = NULL; 2478 2470 map<int, class BoundaryPointSet *> OrderMap; … … 2502 2494 * \return list of BoundaryTriangleSet of nearest triangles or NULL in degenerate case. 2503 2495 */ 2504 list<BoundaryTriangleSet*> * Tesselation::FindClosestTrianglesToPoint(ofstream *out, Vector *x, LinkedCell* LC)2496 list<BoundaryTriangleSet*> * Tesselation::FindClosestTrianglesToPoint(ofstream *out, const Vector *x, const LinkedCell* LC) const 2505 2497 { 2506 2498 TesselPoint *trianglePoints[3]; … … 2522 2514 if (trianglePoints[0]->node->DistanceSquared(x) < MYEPSILON) { 2523 2515 *out << Verbose(3) << "Point is right on a tesselation point, no nearest triangle." << endl; 2524 PointMap:: iterator PointRunner = PointsOnBoundary.find(trianglePoints[0]->nr);2516 PointMap::const_iterator PointRunner = PointsOnBoundary.find(trianglePoints[0]->nr); 2525 2517 triangles = new list<BoundaryTriangleSet*>; 2526 2518 if (PointRunner != PointsOnBoundary.end()) { … … 2578 2570 * \return list of BoundaryTriangleSet of nearest triangles or NULL. 2579 2571 */ 2580 class BoundaryTriangleSet * Tesselation::FindClosestTriangleToPoint(ofstream *out, Vector *x, LinkedCell* LC)2572 class BoundaryTriangleSet * Tesselation::FindClosestTriangleToPoint(ofstream *out, const Vector *x, const LinkedCell* LC) const 2581 2573 { 2582 2574 class BoundaryTriangleSet *result = NULL; … … 2614 2606 * @return true if the point is inside the tesselation structure, false otherwise 2615 2607 */ 2616 bool Tesselation::IsInnerPoint(ofstream *out, Vector Point, LinkedCell* LC)2608 bool Tesselation::IsInnerPoint(ofstream *out, const Vector &Point, const LinkedCell* const LC) const 2617 2609 { 2618 2610 class BoundaryTriangleSet *result = FindClosestTriangleToPoint(out, &Point, LC); … … 2644 2636 * @return true if the point is inside the tesselation structure, false otherwise 2645 2637 */ 2646 bool Tesselation::IsInnerPoint(ofstream *out, TesselPoint *Point, LinkedCell* LC)2638 bool Tesselation::IsInnerPoint(ofstream *out, const TesselPoint * const Point, const LinkedCell* const LC) const 2647 2639 { 2648 2640 return IsInnerPoint(out, *(Point->node), LC); … … 2655 2647 * @return set of the all points linked to the provided one 2656 2648 */ 2657 set<TesselPoint*> * Tesselation::GetAllConnectedPoints(ofstream *out, TesselPoint* Point)2649 set<TesselPoint*> * Tesselation::GetAllConnectedPoints(ofstream *out, const TesselPoint* const Point) const 2658 2650 { 2659 2651 set<TesselPoint*> *connectedPoints = new set<TesselPoint*>; … … 2665 2657 2666 2658 // find the respective boundary point 2667 PointMap:: iterator PointRunner = PointsOnBoundary.find(Point->nr);2659 PointMap::const_iterator PointRunner = PointsOnBoundary.find(Point->nr); 2668 2660 if (PointRunner != PointsOnBoundary.end()) { 2669 2661 ReferencePoint = PointRunner->second; … … 2675 2667 // little trick so that we look just through lines connect to the BoundaryPoint 2676 2668 // OR fall-back to look through all lines if there is no such BoundaryPoint 2677 LineMap *Lines = &LinesOnBoundary;2669 const LineMap *Lines;; 2678 2670 if (ReferencePoint != NULL) 2679 2671 Lines = &(ReferencePoint->lines); 2680 LineMap::iterator findLines = Lines->begin(); 2672 else 2673 Lines = &LinesOnBoundary; 2674 LineMap::const_iterator findLines = Lines->begin(); 2681 2675 while (findLines != Lines->end()) { 2682 2676 takePoint = false; … … 2719 2713 * @return list of the all points linked to the provided one 2720 2714 */ 2721 list<TesselPoint*> * Tesselation::GetCircleOfConnectedPoints(ofstream *out, TesselPoint* Point, Vector *Reference)2715 list<TesselPoint*> * Tesselation::GetCircleOfConnectedPoints(ofstream *out, const TesselPoint* const Point, const Vector * const Reference) const 2722 2716 { 2723 2717 map<double, TesselPoint*> anglesOfPoints; … … 2733 2727 2734 2728 // calculate central point 2735 for (set<TesselPoint*>:: iterator TesselRunner = connectedPoints->begin(); TesselRunner != connectedPoints->end(); TesselRunner++)2729 for (set<TesselPoint*>::const_iterator TesselRunner = connectedPoints->begin(); TesselRunner != connectedPoints->end(); TesselRunner++) 2736 2730 center.AddVector((*TesselRunner)->node); 2737 2731 //*out << "Summed vectors " << center << "; number of points " << connectedPoints.size() … … 2796 2790 * @return list of the all points linked to the provided one 2797 2791 */ 2798 list<list<TesselPoint*> *> * Tesselation::GetPathsOfConnectedPoints(ofstream *out, TesselPoint* Point)2792 list<list<TesselPoint*> *> * Tesselation::GetPathsOfConnectedPoints(ofstream *out, const TesselPoint* const Point) const 2799 2793 { 2800 2794 map<double, TesselPoint*> anglesOfPoints; … … 2813 2807 2814 2808 // find the respective boundary point 2815 PointMap:: iterator PointRunner = PointsOnBoundary.find(Point->nr);2809 PointMap::const_iterator PointRunner = PointsOnBoundary.find(Point->nr); 2816 2810 if (PointRunner != PointsOnBoundary.end()) { 2817 2811 ReferencePoint = PointRunner->second; … … 2911 2905 * @return list of the closed paths 2912 2906 */ 2913 list<list<TesselPoint*> *> * Tesselation::GetClosedPathsOfConnectedPoints(ofstream *out, TesselPoint* Point)2907 list<list<TesselPoint*> *> * Tesselation::GetClosedPathsOfConnectedPoints(ofstream *out, const TesselPoint* const Point) const 2914 2908 { 2915 2909 list<list<TesselPoint*> *> *ListofPaths = GetPathsOfConnectedPoints(out, Point); … … 2972 2966 * \return pointer to allocated list of triangles 2973 2967 */ 2974 set<BoundaryTriangleSet*> *Tesselation::GetAllTriangles(ofstream *out, c lass BoundaryPointSet *Point)2968 set<BoundaryTriangleSet*> *Tesselation::GetAllTriangles(ofstream *out, const BoundaryPointSet * const Point) const 2975 2969 { 2976 2970 set<BoundaryTriangleSet*> *connectedTriangles = new set<BoundaryTriangleSet*>; … … 2980 2974 } else { 2981 2975 // go through its lines and insert all triangles 2982 for (LineMap:: iterator LineRunner = Point->lines.begin(); LineRunner != Point->lines.end(); LineRunner++)2976 for (LineMap::const_iterator LineRunner = Point->lines.begin(); LineRunner != Point->lines.end(); LineRunner++) 2983 2977 for (TriangleMap::iterator TriangleRunner = (LineRunner->second)->triangles.begin(); TriangleRunner != (LineRunner->second)->triangles.end(); TriangleRunner++) { 2984 2978 connectedTriangles->insert(TriangleRunner->second); … … 3224 3218 * will usually be one, in case of degeneration, there will be two 3225 3219 */ 3226 list<BoundaryTriangleSet*> *Tesselation::FindTriangles( TesselPoint* Points[3])3220 list<BoundaryTriangleSet*> *Tesselation::FindTriangles(const TesselPoint* const Points[3]) const 3227 3221 { 3228 3222 list<BoundaryTriangleSet*> *result = new list<BoundaryTriangleSet*>; 3229 LineMap::iterator FindLine; 3230 PointMap::iterator FindPoint; 3231 TriangleMap::iterator FindTriangle; 3223 LineMap::const_iterator FindLine; 3224 TriangleMap::const_iterator FindTriangle; 3232 3225 class BoundaryPointSet *TrianglePoints[3]; 3233 3226 3234 3227 for (int i = 0; i < 3; i++) { 3235 FindPoint = PointsOnBoundary.find(Points[i]->nr);3228 PointMap::const_iterator FindPoint = PointsOnBoundary.find(Points[i]->nr); 3236 3229 if (FindPoint != PointsOnBoundary.end()) { 3237 3230 TrianglePoints[i] = FindPoint->second; … … 3544 3537 * \param *cloud PointCloud structure with all nodes 3545 3538 */ 3546 void Tesselation::Output(ofstream *out, const char *filename, PointCloud *cloud)3539 void Tesselation::Output(ofstream *out, const char *filename, const PointCloud * const cloud) 3547 3540 { 3548 3541 ofstream *tempstream = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.