Changes in src/tesselation.cpp [bdc91e:36166d]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tesselation.cpp
rbdc91e r36166d 9 9 10 10 #include <fstream> 11 #include <iomanip> 11 12 12 13 #include "helpers.hpp" … … 1648 1649 bool AddFlag = false; 1649 1650 LinkedCell *BoundaryPoints = NULL; 1650 bool SuccessFlag = true;1651 1651 1652 1652 cloud->GoToFirst(); … … 1662 1662 // get the next triangle 1663 1663 triangles = FindClosestTrianglesToVector(Walker->node, BoundaryPoints); 1664 if (triangles != NULL) 1665 BTS = triangles->front(); 1666 else 1667 BTS = NULL; 1668 delete triangles; 1669 if ((BTS == NULL) || (BTS->ContainsBoundaryPoint(Walker))) { 1664 BTS = triangles->front(); 1665 if ((triangles == NULL) || (BTS->ContainsBoundaryPoint(Walker))) { 1670 1666 DoLog(0) && (Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl); 1671 1667 cloud->GoToNext(); … … 1737 1733 } else { // something is wrong with FindClosestTriangleToPoint! 1738 1734 DoeLog(1) && (eLog() << Verbose(1) << "The closest triangle did not produce an intersection!" << endl); 1739 SuccessFlag = false; 1740 break; 1735 return false; 1741 1736 } 1742 1737 cloud->GoToNext(); … … 1745 1740 // exit 1746 1741 delete (Center); 1747 delete (BoundaryPoints); 1748 return SuccessFlag; 1742 return true; 1749 1743 } 1750 1744 ; … … 2249 2243 for (int i = 0; i < NDIM; i++) { // each axis 2250 2244 LC->n[i] = LC->N[i] - 1; // current axis is topmost cell 2251 const int map[NDIM] = {i, (i + 1) % NDIM, (i + 2) % NDIM}; 2252 for (LC->n[map[1]] = 0; LC->n[map[1]] < LC->N[map[1]]; LC->n[map[1]]++) 2253 for (LC->n[map[2]] = 0; LC->n[map[2]] < LC->N[map[2]]; LC->n[map[2]]++) { 2245 for (LC->n[(i + 1) % NDIM] = 0; LC->n[(i + 1) % NDIM] < LC->N[(i + 1) % NDIM]; LC->n[(i + 1) % NDIM]++) 2246 for (LC->n[(i + 2) % NDIM] = 0; LC->n[(i + 2) % NDIM] < LC->N[(i + 2) % NDIM]; LC->n[(i + 2) % NDIM]++) { 2254 2247 const LinkedCell::LinkedNodes *List = LC->GetCurrentCell(); 2255 2248 //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl; 2256 2249 if (List != NULL) { 2257 2250 for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 2258 if ((*Runner)->node->at( map[0]) > maxCoordinate[map[0]]) {2259 DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << map[0]<< " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl);2260 maxCoordinate[ map[0]] = (*Runner)->node->at(map[0]);2261 MaxPoint[ map[0]] = (*Runner);2251 if ((*Runner)->node->at(i) > maxCoordinate[i]) { 2252 DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl); 2253 maxCoordinate[i] = (*Runner)->node->at(i); 2254 MaxPoint[i] = (*Runner); 2262 2255 } 2263 2256 }
Note:
See TracChangeset
for help on using the changeset viewer.