Ignore:
Timestamp:
Oct 27, 2009, 4:11:22 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
069034
Parents:
55a71b
Message:

Huge refactoring to make const what is const (ticket #38), continued.

  • too many changes because of too many cross-references to be able to list them up here.
  • NOTE that "make check" runs fine and did catch several error.
  • note that we had to use const_iterator several times when the map, ... was declared const.
  • at times we changed an allocated LinkedCell LCList(...) into

const LinkedCell *LCList;
LCList = new LinkedCell(...);

  • also mutable (see ticket #5) was used, e.g. for molecule::InternalPointer (PointCloud changes are allowed, because they are just accounting).

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/tesselation.cpp

    r55a71b ra9b2a0a  
    3131 * \param *Walker TesselPoint this boundary point represents
    3232 */
    33 BoundaryPointSet::BoundaryPointSet(TesselPoint *Walker)
     33BoundaryPointSet::BoundaryPointSet(TesselPoint * Walker)
    3434{
    3535  node = Walker;
     
    7373 * \param &a boundary point
    7474 */
    75 ostream & operator <<(ostream &ost, BoundaryPointSet &a)
     75ostream & operator <<(ostream &ost, const BoundaryPointSet &a)
    7676{
    7777  ost << "[" << a.Nr << "|" << a.node->Name << " at " << *a.node->node << "]";
     
    9696 * \param number number of the list
    9797 */
    98 BoundaryLineSet::BoundaryLineSet(class BoundaryPointSet *Point[2], int number)
     98BoundaryLineSet::BoundaryLineSet(class BoundaryPointSet *Point[2], const int number)
    9999{
    100100  // set number
     
    275275 * \param &a boundary line
    276276 */
    277 ostream & operator <<(ostream &ost, BoundaryLineSet &a)
     277ostream & operator <<(ostream &ost, const  BoundaryLineSet &a)
    278278{
    279279  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 << "]";
     
    532532 * \param &a boundary triangle
    533533 */
    534 ostream &operator <<(ostream &ost, BoundaryTriangleSet &a)
     534ostream &operator <<(ostream &ost, const BoundaryTriangleSet &a)
    535535{
    536536  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << " at " << *a.endpoints[0]->node->node << ","
     
    642642 * Uses PointsOnBoundary and STL stuff.
    643643 */   
    644 Vector * Tesselation::GetCenter(ofstream *out)
     644Vector * Tesselation::GetCenter(ofstream *out) const
    645645{
    646646  Vector *Center = new Vector(0.,0.,0.);
     
    657657 * Uses PointsOnBoundary and STL stuff.
    658658 */   
    659 TesselPoint * Tesselation::GetPoint()
     659TesselPoint * Tesselation::GetPoint() const
    660660{
    661661  return (InternalPointer->second->node);
     
    665665 * Uses PointsOnBoundary and STL stuff.
    666666 */   
    667 TesselPoint * Tesselation::GetTerminalPoint()
    668 {
    669   PointMap::iterator Runner = PointsOnBoundary.end();
     667TesselPoint * Tesselation::GetTerminalPoint() const
     668{
     669  PointMap::const_iterator Runner = PointsOnBoundary.end();
    670670  Runner--;
    671671  return (Runner->second->node);
     
    675675 * Uses PointsOnBoundary and STL stuff.
    676676 */   
    677 void Tesselation::GoToNext()
     677void Tesselation::GoToNext() const
    678678{
    679679  if (InternalPointer != PointsOnBoundary.end())
     
    684684 * Uses PointsOnBoundary and STL stuff.
    685685 */   
    686 void Tesselation::GoToPrevious()
     686void Tesselation::GoToPrevious() const
    687687{
    688688  if (InternalPointer != PointsOnBoundary.begin())
     
    693693 * Uses PointsOnBoundary and STL stuff.
    694694 */   
    695 void Tesselation::GoToFirst()
     695void Tesselation::GoToFirst() const
    696696{
    697697  InternalPointer = PointsOnBoundary.begin();
     
    700700/** PointCloud implementation of GoToLast.
    701701 * Uses PointsOnBoundary and STL stuff.
    702  */   
    703 void Tesselation::GoToLast()
     702 */
     703void Tesselation::GoToLast() const
    704704{
    705705  InternalPointer = PointsOnBoundary.end();
     
    710710 * Uses PointsOnBoundary and STL stuff.
    711711 */   
    712 bool Tesselation::IsEmpty()
     712bool Tesselation::IsEmpty() const
    713713{
    714714  return (PointsOnBoundary.empty());
     
    718718 * Uses PointsOnBoundary and STL stuff.
    719719 */   
    720 bool Tesselation::IsEnd()
     720bool Tesselation::IsEnd() const
    721721{
    722722  return (InternalPointer == PointsOnBoundary.end());
     
    899899 * \param *cloud cluster of points
    900900 */
    901 void Tesselation::TesselateOnBoundary(ofstream *out, PointCloud *cloud)
     901void Tesselation::TesselateOnBoundary(ofstream *out, const PointCloud * const cloud)
    902902{
    903903  bool flag;
     
    10971097 * \return true - all straddling points insert, false - something went wrong
    10981098 */
    1099 bool Tesselation::InsertStraddlingPoints(ofstream *out, PointCloud *cloud, LinkedCell *LC)
     1099bool Tesselation::InsertStraddlingPoints(ofstream *out, const PointCloud *cloud, const LinkedCell *LC)
    11001100{
    11011101  Vector Intersection, Normal;
     
    12071207 * \return true - new point was added, false - point already present
    12081208 */
    1209 bool
    1210 Tesselation::AddBoundaryPoint(TesselPoint *Walker, int n)
     1209bool Tesselation::AddBoundaryPoint(TesselPoint * Walker, const int n)
    12111210{
    12121211  PointTestPair InsertUnique;
     
    12291228 * @param n index for this point in Tesselation::TPS array
    12301229 */
    1231 void
    1232 Tesselation::AddTesselationPoint(TesselPoint* Candidate, int n)
     1230void Tesselation::AddTesselationPoint(TesselPoint* Candidate, const int n)
    12331231{
    12341232  PointTestPair InsertUnique;
     
    12521250 * @param n index of Tesselation::BLS giving the line with both endpoints
    12531251 */
    1254 void Tesselation::AddTesselationLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n) {
     1252void Tesselation::AddTesselationLine(class BoundaryPointSet *a, class BoundaryPointSet *b, const int n) {
    12551253  bool insertNewLine = true;
    12561254
     
    12901288 * @param n index of Tesselation::BLS giving the line with both endpoints
    12911289 */
    1292 void Tesselation::AlwaysAddTesselationTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n)
     1290void Tesselation::AlwaysAddTesselationTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, const int n)
    12931291{
    12941292  cout << Verbose(4) << "Adding line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << "." << endl;
     
    13231321 * \param nr triangle number
    13241322 */
    1325 void Tesselation::AddTesselationTriangle(int nr)
     1323void Tesselation::AddTesselationTriangle(const int nr)
    13261324{
    13271325  cout << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl;
     
    15541552 * \param *LC LinkedCell structure with neighbouring TesselPoint's
    15551553 */
    1556 void Tesselation::FindStartingTriangle(ofstream *out, const double RADIUS, LinkedCell *LC)
     1554void Tesselation::FindStartingTriangle(ofstream *out, const double RADIUS, const LinkedCell *LC)
    15571555{
    15581556  cout << Verbose(1) << "Begin of FindStartingTriangle\n";
    15591557  int i = 0;
    1560   LinkedNodes *List = NULL;
    15611558  TesselPoint* FirstPoint = NULL;
    15621559  TesselPoint* SecondPoint = NULL;
     
    15801577    for (LC->n[(i+1)%NDIM]=0;LC->n[(i+1)%NDIM]<LC->N[(i+1)%NDIM];LC->n[(i+1)%NDIM]++)
    15811578      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();
    15831580        //cout << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    15841581        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++) {
    15861583            if ((*Runner)->node->x[i] > maxCoordinate[i]) {
    15871584              cout << Verbose(2) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl;
     
    16451642
    16461643    //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);
    16501645    cout << Verbose(1) << "List of third Points is ";
    16511646    for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) {
     
    17131708 * @param *LC LinkedCell structure with neighbouring points
    17141709 */
    1715 bool Tesselation::FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, LinkedCell *LC)
     1710bool Tesselation::FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, const LinkedCell *LC)
    17161711{
    17171712  cout << Verbose(0) << "Begin of FindNextSuitableTriangle\n";
     
    17741769
    17751770    // 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);
    17801772
    17811773  } else {
     
    18131805      AddTesselationPoint(BaseRay->endpoints[1]->node, 2);
    18141806
    1815       if (CheckLineCriteriaForDegeneratedTriangle(TPS)) {
     1807      if (CheckLineCriteriaForDegeneratedTriangle((const BoundaryPointSet **)TPS)) {
    18161808        AddTesselationLine(TPS[0], TPS[1], 0);
    18171809        AddTesselationLine(TPS[0], TPS[2], 1);
     
    18421834        // 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)
    18431835        // 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)) {
    18451837          AddTesselationLine(TPS[0], TPS[1], 0);
    18461838          AddTesselationLine(TPS[0], TPS[2], 1);
     
    19491941};
    19501942
    1951 void Tesselation::PrintAllBoundaryPoints(ofstream *out)
     1943void Tesselation::PrintAllBoundaryPoints(ofstream *out) const
    19521944{
    19531945  // print all lines
    19541946  *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++)
    19561948    *out << Verbose(2) << *(PointRunner->second) << endl;
    19571949};
    19581950
    1959 void Tesselation::PrintAllBoundaryLines(ofstream *out)
     1951void Tesselation::PrintAllBoundaryLines(ofstream *out) const
    19601952{
    19611953  // print all lines
    19621954  *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++)
    19641956    *out << Verbose(2) << *(LineRunner->second) << endl;
    19651957};
    19661958
    1967 void Tesselation::PrintAllBoundaryTriangles(ofstream *out)
     1959void Tesselation::PrintAllBoundaryTriangles(ofstream *out) const
    19681960{
    19691961  // print all triangles
    19701962  *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++)
    19721964    *out << Verbose(2) << *(TriangleRunner->second) << endl;
    19731965};
     
    21652157 * \param *LC LinkedCell structure with neighbouring points
    21662158 */
    2167 void Tesselation::FindSecondPointForTesselation(TesselPoint* a, Vector Oben, TesselPoint*& OptCandidate, double Storage[3], double RADIUS, LinkedCell *LC)
     2159void Tesselation::FindSecondPointForTesselation(TesselPoint* a, Vector Oben, TesselPoint*& OptCandidate, double Storage[3], double RADIUS, const LinkedCell *LC)
    21682160{
    21692161  cout << Verbose(2) << "Begin of FindSecondPointForTesselation" << endl;
    21702162  Vector AngleCheck;
    21712163  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];
    21752169
    21762170  if (LC->SetIndexToNode(a)) {  // get cell for the starting point
     
    21982192    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    21992193      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    2200         List = LC->GetCurrentCell();
     2194        const LinkedNodes *List = LC->GetCurrentCell();
    22012195        //cout << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    22022196        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++) {
    22042198            Candidate = (*Runner);
    22052199            // check if we only have one unique point yet ...
     
    22852279 * @param *LC LinkedCell structure with neighbouring points
    22862280 */
    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)
     2281void Tesselation::FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint  *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, const LinkedCell *LC)
    22882282{
    22892283  Vector CircleCenter;  // center of the circle, i.e. of the band of sphere's centers
     
    22942288  Vector NewNormalVector;   // normal vector of the Candidate's triangle
    22952289  Vector helper, OptCandidateCenter, OtherOptCandidateCenter;
    2296   LinkedNodes *List = NULL;
    22972290  double CircleRadius; // radius of this circle
    22982291  double radius;
     
    23572350        for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    23582351          for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    2359             List = LC->GetCurrentCell();
     2352            const LinkedNodes *List = LC->GetCurrentCell();
    23602353            //cout << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    23612354            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++) {
    23632356                Candidate = (*Runner);
    23642357
     
    24712464 * \return point which is shared or NULL if none
    24722465 */
    2473 class BoundaryPointSet *Tesselation::GetCommonEndpoint(class BoundaryLineSet * line1, class BoundaryLineSet * line2)
    2474 {
    2475   class BoundaryLineSet * lines[2] =
    2476     { line1, line2 };
     2466class BoundaryPointSet *Tesselation::GetCommonEndpoint(const BoundaryLineSet * line1, const BoundaryLineSet * line2) const
     2467{
     2468  const BoundaryLineSet * lines[2] = { line1, line2 };
    24772469  class BoundaryPointSet *node = NULL;
    24782470  map<int, class BoundaryPointSet *> OrderMap;
     
    25022494 * \return list of BoundaryTriangleSet of nearest triangles or NULL in degenerate case.
    25032495 */
    2504 list<BoundaryTriangleSet*> * Tesselation::FindClosestTrianglesToPoint(ofstream *out, Vector *x, LinkedCell* LC)
     2496list<BoundaryTriangleSet*> * Tesselation::FindClosestTrianglesToPoint(ofstream *out, const Vector *x, const LinkedCell* LC) const
    25052497{
    25062498  TesselPoint *trianglePoints[3];
     
    25222514  if (trianglePoints[0]->node->DistanceSquared(x) < MYEPSILON) {
    25232515    *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);
    25252517    triangles = new list<BoundaryTriangleSet*>;
    25262518    if (PointRunner != PointsOnBoundary.end()) {
     
    25782570 * \return list of BoundaryTriangleSet of nearest triangles or NULL.
    25792571 */
    2580 class BoundaryTriangleSet * Tesselation::FindClosestTriangleToPoint(ofstream *out, Vector *x, LinkedCell* LC)
     2572class BoundaryTriangleSet * Tesselation::FindClosestTriangleToPoint(ofstream *out, const Vector *x, const LinkedCell* LC) const
    25812573{
    25822574  class BoundaryTriangleSet *result = NULL;
     
    26142606 * @return true if the point is inside the tesselation structure, false otherwise
    26152607 */
    2616 bool Tesselation::IsInnerPoint(ofstream *out, Vector Point, LinkedCell* LC)
     2608bool Tesselation::IsInnerPoint(ofstream *out, const Vector &Point, const LinkedCell* const LC) const
    26172609{
    26182610  class BoundaryTriangleSet *result = FindClosestTriangleToPoint(out, &Point, LC);
     
    26442636 * @return true if the point is inside the tesselation structure, false otherwise
    26452637 */
    2646 bool Tesselation::IsInnerPoint(ofstream *out, TesselPoint *Point, LinkedCell* LC)
     2638bool Tesselation::IsInnerPoint(ofstream *out, const TesselPoint * const Point, const LinkedCell* const LC) const
    26472639{
    26482640  return IsInnerPoint(out, *(Point->node), LC);
     
    26552647 * @return set of the all points linked to the provided one
    26562648 */
    2657 set<TesselPoint*> * Tesselation::GetAllConnectedPoints(ofstream *out, TesselPoint* Point)
     2649set<TesselPoint*> * Tesselation::GetAllConnectedPoints(ofstream *out, const TesselPoint* const Point) const
    26582650{
    26592651  set<TesselPoint*> *connectedPoints = new set<TesselPoint*>;
     
    26652657
    26662658  // find the respective boundary point
    2667   PointMap::iterator PointRunner = PointsOnBoundary.find(Point->nr);
     2659  PointMap::const_iterator PointRunner = PointsOnBoundary.find(Point->nr);
    26682660  if (PointRunner != PointsOnBoundary.end()) {
    26692661    ReferencePoint = PointRunner->second;
     
    26752667  // little trick so that we look just through lines connect to the BoundaryPoint
    26762668  // OR fall-back to look through all lines if there is no such BoundaryPoint
    2677   LineMap *Lines = &LinesOnBoundary;
     2669  const LineMap *Lines;;
    26782670  if (ReferencePoint != NULL)
    26792671    Lines = &(ReferencePoint->lines);
    2680   LineMap::iterator findLines = Lines->begin();
     2672  else
     2673    Lines = &LinesOnBoundary;
     2674  LineMap::const_iterator findLines = Lines->begin();
    26812675  while (findLines != Lines->end()) {
    26822676   takePoint = false;
     
    27192713 * @return list of the all points linked to the provided one
    27202714 */
    2721 list<TesselPoint*> * Tesselation::GetCircleOfConnectedPoints(ofstream *out, TesselPoint* Point, Vector *Reference)
     2715list<TesselPoint*> * Tesselation::GetCircleOfConnectedPoints(ofstream *out, const TesselPoint* const Point, const Vector * const Reference) const
    27222716{
    27232717  map<double, TesselPoint*> anglesOfPoints;
     
    27332727
    27342728  // 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++)
    27362730    center.AddVector((*TesselRunner)->node);
    27372731  //*out << "Summed vectors " << center << "; number of points " << connectedPoints.size()
     
    27962790 * @return list of the all points linked to the provided one
    27972791 */
    2798 list<list<TesselPoint*> *> * Tesselation::GetPathsOfConnectedPoints(ofstream *out, TesselPoint* Point)
     2792list<list<TesselPoint*> *> * Tesselation::GetPathsOfConnectedPoints(ofstream *out, const TesselPoint* const Point) const
    27992793{
    28002794  map<double, TesselPoint*> anglesOfPoints;
     
    28132807
    28142808  // find the respective boundary point
    2815   PointMap::iterator PointRunner = PointsOnBoundary.find(Point->nr);
     2809  PointMap::const_iterator PointRunner = PointsOnBoundary.find(Point->nr);
    28162810  if (PointRunner != PointsOnBoundary.end()) {
    28172811    ReferencePoint = PointRunner->second;
     
    29112905 * @return list of the closed paths
    29122906 */
    2913 list<list<TesselPoint*> *> * Tesselation::GetClosedPathsOfConnectedPoints(ofstream *out, TesselPoint* Point)
     2907list<list<TesselPoint*> *> * Tesselation::GetClosedPathsOfConnectedPoints(ofstream *out, const TesselPoint* const Point) const
    29142908{
    29152909  list<list<TesselPoint*> *> *ListofPaths = GetPathsOfConnectedPoints(out, Point);
     
    29722966 * \return pointer to allocated list of triangles
    29732967 */
    2974 set<BoundaryTriangleSet*> *Tesselation::GetAllTriangles(ofstream *out, class BoundaryPointSet *Point)
     2968set<BoundaryTriangleSet*> *Tesselation::GetAllTriangles(ofstream *out, const BoundaryPointSet * const Point) const
    29752969{
    29762970  set<BoundaryTriangleSet*> *connectedTriangles = new set<BoundaryTriangleSet*>;
     
    29802974  } else {
    29812975    // 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++)
    29832977      for (TriangleMap::iterator TriangleRunner = (LineRunner->second)->triangles.begin(); TriangleRunner != (LineRunner->second)->triangles.end(); TriangleRunner++) {
    29842978      connectedTriangles->insert(TriangleRunner->second);
     
    32243218 *         will usually be one, in case of degeneration, there will be two
    32253219 */
    3226 list<BoundaryTriangleSet*> *Tesselation::FindTriangles(TesselPoint* Points[3])
     3220list<BoundaryTriangleSet*> *Tesselation::FindTriangles(const TesselPoint* const Points[3]) const
    32273221{
    32283222  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;
    32323225  class BoundaryPointSet *TrianglePoints[3];
    32333226
    32343227  for (int i = 0; i < 3; i++) {
    3235     FindPoint = PointsOnBoundary.find(Points[i]->nr);
     3228    PointMap::const_iterator FindPoint = PointsOnBoundary.find(Points[i]->nr);
    32363229    if (FindPoint != PointsOnBoundary.end()) {
    32373230      TrianglePoints[i] = FindPoint->second;
     
    35443537 * \param *cloud PointCloud structure with all nodes
    35453538 */
    3546 void Tesselation::Output(ofstream *out, const char *filename, PointCloud *cloud)
     3539void Tesselation::Output(ofstream *out, const char *filename, const PointCloud * const cloud)
    35473540{
    35483541  ofstream *tempstream = NULL;
Note: See TracChangeset for help on using the changeset viewer.