Changes in / [34e0592:1d9b7aa]


Ignore:
Location:
src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • src/boundary.cpp

    r34e0592 r1d9b7aa  
    118118 * \param *mol molecule structure with atom positions
    119119 */
    120 void WriteVrmlFile(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, class molecule *mol)
     120void write_vrml_file(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, class molecule *mol)
    121121{
    122122  atom *Walker = mol->start;
     
    172172 * \param *mol molecule structure with atom positions
    173173 */
    174 void WriteRaster3dFile(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, class molecule *mol)
     174void write_raster3d_file(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, class molecule *mol)
    175175{
    176176  atom *Walker = mol->start;
     
    227227 * \param N arbitrary number to differentiate various zones in the tecplot format
    228228 */
    229 void WriteTecplotFile(ofstream *out, ofstream *tecplot, class Tesselation *TesselStruct, class molecule *mol, int N)
     229void write_tecplot_file(ofstream *out, ofstream *tecplot, class Tesselation *TesselStruct, class molecule *mol, int N)
    230230{
    231231  if ((tecplot != NULL) && (TesselStruct != NULL)) {
     
    440440 * \return *TesselStruct is filled with convex boundary and tesselation is stored under \a *filename.
    441441 */
    442 void FindConvexBorder(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename)
     442void Find_convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename)
    443443{
    444444  bool BoundaryFreeFlag = false;
    445445  Boundaries *BoundaryPoints = NULL;
    446446
    447   cout << Verbose(1) << "Begin of FindConvexBorder" << endl;
     447  cout << Verbose(1) << "Begin of find_convex_border" << endl;
    448448
    449449  if (mol->TesselStruct != NULL) // free if allocated
     
    509509      OutputName.append(TecplotSuffix);
    510510      ofstream *tecplot = new ofstream(OutputName.c_str());
    511       WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0);
     511      write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);
    512512      tecplot->close();
    513513      delete(tecplot);
     
    518518      OutputName.append(Raster3DSuffix);
    519519      ofstream *rasterplot = new ofstream(OutputName.c_str());
    520       WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol);
     520      write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);
    521521      rasterplot->close();
    522522      delete(rasterplot);
     
    556556      OutputName.append(TecplotSuffix);
    557557      ofstream *tecplot = new ofstream(OutputName.c_str());
    558       WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0);
     558      write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);
    559559      tecplot->close();
    560560      delete(tecplot);
     
    564564      OutputName.append(Raster3DSuffix);
    565565      ofstream *rasterplot = new ofstream(OutputName.c_str());
    566       WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol);
     566      write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);
    567567      rasterplot->close();
    568568      delete(rasterplot);
     
    575575    delete[] (BoundaryPoints);
    576576
    577   cout << Verbose(1) << "End of FindConvexBorder" << endl;
     577  cout << Verbose(1) << "End of find_convex_border" << endl;
    578578};
    579579
     
    732732      OutputName.append(TecplotSuffix);
    733733      ofstream *tecplot = new ofstream(OutputName.c_str());
    734       WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0);
     734      write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);
    735735      tecplot->close();
    736736      delete(tecplot);
     
    741741      OutputName.append(Raster3DSuffix);
    742742      ofstream *rasterplot = new ofstream(OutputName.c_str());
    743       WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol);
     743      write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);
    744744      rasterplot->close();
    745745      delete(rasterplot);
     
    816816  class Tesselation *TesselStruct = NULL;
    817817  LinkedCell LCList(mol, 10.);
    818   FindConvexBorder(out, mol, &LCList, NULL);
     818  Find_convex_border(out, mol, &LCList, NULL);
    819819  double clustervolume;
    820820  if (ClusterVolume == 0)
     
    957957    if ((*ListRunner)->TesselStruct == NULL) {
    958958      *out << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl;
    959       FindNonConvexBorder((ofstream *)&cout, (*ListRunner), LCList[i], NULL, 5.);
     959      Find_non_convex_border((ofstream *)&cout, (*ListRunner), LCList[i], NULL, 5.);
    960960    }
    961961    i++;
     
    10821082 * \para RADIUS radius of the virtual sphere
    10831083 */
    1084 void FindNonConvexBorder(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename, const double RADIUS)
     1084void Find_non_convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename, const double RADIUS)
    10851085{
    10861086  int N = 0;
     
    11011101  LineMap::iterator baseline;
    11021102  LineMap::iterator testline;
    1103   *out << Verbose(0) << "Begin of FindNonConvexBorder\n";
     1103  *out << Verbose(0) << "Begin of Find_non_convex_border\n";
    11041104  bool flag = false;  // marks whether we went once through all baselines without finding any without two triangles
    11051105  bool failflag = false;
     
    11101110  }
    11111111
    1112   mol->TesselStruct->FindStartingTriangle(out, RADIUS, LCList);
     1112  mol->TesselStruct->Find_starting_triangle(out, RADIUS, LCList);
    11131113
    11141114  baseline = mol->TesselStruct->LinesOnBoundary.begin();
     
    11191119  while ((baseline != mol->TesselStruct->LinesOnBoundary.end()) || (flag)) {
    11201120    if (baseline->second->triangles.size() == 1) {
    1121       failflag = mol->TesselStruct->FindNextSuitableTriangle(out, *(baseline->second), *(((baseline->second->triangles.begin()))->second), RADIUS, N, LCList); //the line is there, so there is a triangle, but only one.
     1121      failflag = mol->TesselStruct->Find_next_suitable_triangle(out, *(baseline->second), *(((baseline->second->triangles.begin()))->second), RADIUS, N, LCList); //the line is there, so there is a triangle, but only one.
    11221122      flag = flag || failflag;
    11231123      if (!failflag)
    1124         cerr << "WARNING: FindNextSuitableTriangle failed." << endl;
     1124        cerr << "WARNING: Find_next_suitable_triangle failed." << endl;
    11251125      // write temporary envelope
    11261126      if ((DoSingleStepOutput && (mol->TesselStruct->TrianglesOnBoundaryCount % SingleStepWidth == 0))) { // if we have a new triangle and want to output each new triangle configuration
     
    11381138            *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
    11391139            tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    1140             WriteTecplotFile(out, tempstream, mol->TesselStruct, mol, TriangleFilesWritten);
     1140            write_tecplot_file(out, tempstream, mol->TesselStruct, mol, TriangleFilesWritten);
    11411141            tempstream->close();
    11421142            tempstream->flush();
     
    11521152            *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";
    11531153            tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc);
    1154             WriteRaster3dFile(out, tempstream, mol->TesselStruct, mol);
     1154            write_raster3d_file(out, tempstream, mol->TesselStruct, mol);
    11551155    //        // include the current position of the virtual sphere in the temporary raster3d file
    11561156    //        // make the circumsphere's center absolute again
     
    11911191  }
    11921192
    1193   // Purges surplus triangles.
    1194   mol->TesselStruct->RemoveDegeneratedTriangles();
    1195 
    11961193  // write final envelope
    11971194  if (filename != 0) {
     
    12011198      OutputName.append(TecplotSuffix);
    12021199      ofstream *tecplot = new ofstream(OutputName.c_str());
    1203       WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, -1);
     1200      write_tecplot_file(out, tecplot, mol->TesselStruct, mol, -1);
    12041201      tecplot->close();
    12051202      delete(tecplot);
     
    12091206      OutputName.append(Raster3DSuffix);
    12101207      ofstream *raster = new ofstream(OutputName.c_str());
    1211       WriteRaster3dFile(out, raster, mol->TesselStruct, mol);
     1208      write_raster3d_file(out, raster, mol->TesselStruct, mol);
    12121209      raster->close();
    12131210      delete(raster);
     
    12601257//    << "for atom " << a << " (inside)." << endl;
    12611258
     1259
    12621260  if (freeLC)
    12631261    delete(LCList);
    1264   *out << Verbose(0) << "End of FindNonConvexBorder\n";
     1262  *out << Verbose(0) << "End of Find_non_convex_border\n";
    12651263};
    12661264
  • src/boundary.hpp

    r34e0592 r1d9b7aa  
    3737void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity);
    3838molecule * FillBoxWithMolecule(ofstream *out, MoleculeListClass *List, molecule *filler, config &configuration, double distance[NDIM], double RandAtomDisplacement, double RandMolDisplacement, bool DoRandomRotation);
    39 void FindConvexBorder(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename);
    40 void FindNonConvexBorder(ofstream *out, molecule* mol, class LinkedCell *LC, const char *tempbasename, const double RADIUS);
     39void Find_convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename);
     40void Find_non_convex_border(ofstream *out, molecule* mol, class LinkedCell *LC, const char *tempbasename, const double RADIUS);
    4141double ConvexizeNonconvexEnvelope(ofstream *out, class Tesselation *TesselStruct, molecule *mol, char *filename);
    42 void FindNextSuitablePoint(class BoundaryTriangleSet *BaseTriangle, class BoundaryLineSet *BaseLine, atom*& OptCandidate, Vector *OptCandidateCenter, double *ShortestAngle, const double RADIUS, LinkedCell *LC);
     42void Find_next_suitable_point(class BoundaryTriangleSet *BaseTriangle, class BoundaryLineSet *BaseLine, atom*& OptCandidate, Vector *OptCandidateCenter, double *ShortestAngle, const double RADIUS, LinkedCell *LC);
    4343Boundaries *GetBoundaryPoints(ofstream *out, molecule *mol);
    4444void CalculateConcavityPerBoundaryPoint(ofstream *out, class Tesselation *TesselStruct);
  • src/builder.cpp

    r34e0592 r1d9b7aa  
    584584        LinkedCell LCList(mol, 10.);
    585585        class Tesselation *TesselStruct = NULL;
    586         FindConvexBorder((ofstream *)&cout, mol, &LCList, NULL);
     586        Find_convex_border((ofstream *)&cout, mol, &LCList, NULL);
    587587        double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, TesselStruct, configuration);
    588588        cout << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl;
     
    644644  Vector x,y,z,n; // coordinates for absolute point in cell volume
    645645  double *factor; // unit factor if desired
    646   double bond, minBond;
     646  double bond, min_bond;
    647647  char choice;  // menu choice char
    648648  bool valid;
     
    683683        first = mol->AskAtom("Enter first (fixed) atom: ");
    684684        second = mol->AskAtom("Enter second (shifting) atom: ");
    685         minBond = 0.;
     685        min_bond = 0.;
    686686        for (int i=NDIM;i--;)
    687           minBond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]);
    688         minBond = sqrt(minBond);
    689         cout << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl;
     687          min_bond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]);
     688        min_bond = sqrt(min_bond);
     689        cout << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << min_bond << " a.u." << endl;
    690690        cout << Verbose(0) << "Enter new bond length [a.u.]: ";
    691691        cin >> bond;
    692692        for (int i=NDIM;i--;) {
    693           second->x.x[i] -= (second->x.x[i]-first->x.x[i])/minBond*(minBond-bond);
     693          second->x.x[i] -= (second->x.x[i]-first->x.x[i])/min_bond*(min_bond-bond);
    694694        }
    695695        //cout << Verbose(0) << "New coordinates of Atom " << second->nr << " are: ";
     
    13251325  int j;
    13261326  double volume = 0.;
    1327   enum ConfigStatus configPresent = absent;
     1327  enum ConfigStatus config_present = absent;
    13281328  clock_t start,end;
    13291329  int argptr;
     
    14251425        if (output == NULL) {
    14261426          cout << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl;
    1427           configPresent = absent;
     1427          config_present = absent;
    14281428        } else {
    14291429          cout << "Empty configuration file." << endl;
    14301430          ConfigFileName = argv[1];
    1431           configPresent = empty;
     1431          config_present = empty;
    14321432          output.close();
    14331433        }
     
    14401440            cout << "new syntax." << endl;
    14411441            configuration.Load(ConfigFileName, periode, mol);
    1442             configPresent = present;
     1442            config_present = present;
    14431443            break;
    14441444          case 0:
    14451445            cout << "old syntax." << endl;
    14461446            configuration.LoadOld(ConfigFileName, periode, mol);
    1447             configPresent = present;
     1447            config_present = present;
    14481448            break;
    14491449          default:
    14501450            cout << "Unknown syntax or empty, yet present file." << endl;
    1451             configPresent = empty;
     1451            config_present = empty;
    14521452       }
    14531453      }
    14541454    } else
    1455       configPresent = absent;
     1455      config_present = absent;
    14561456    // 4. parse again through options, now for those depending on elements db and config presence
    14571457    argptr = 1;
     
    14601460      if (argv[argptr][0] == '-') {
    14611461        argptr++;
    1462         if ((configPresent == present) || (configPresent == empty)) {
     1462        if ((config_present == present) || (config_present == empty)) {
    14631463          switch(argv[argptr-1][1]) {
    14641464            case 'p':
     
    14741474                else {
    14751475                  cout << Verbose(2) << "File found and parsed." << endl;
    1476                   configPresent = present;
     1476                  config_present = present;
    14771477                }
    14781478              }
     
    14941494                if (first->type != NULL) {
    14951495                  mol->AddAtom(first);  // add to molecule
    1496                   if ((configPresent == empty) && (mol->AtomCount != 0))
    1497                     configPresent = present;
     1496                  if ((config_present == empty) && (mol->AtomCount != 0))
     1497                    config_present = present;
    14981498                } else
    14991499                  cerr << Verbose(1) << "Could not find the specified element." << endl;
     
    15051505          }
    15061506        }
    1507         if (configPresent == present) {
     1507        if (config_present == present) {
    15081508          switch(argv[argptr-1][1]) {
    15091509            case 'M':
     
    16271627                start = clock();
    16281628                LinkedCell LCList(mol, atof(argv[argptr])*2.);
    1629                 FindNonConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr+1], atof(argv[argptr]));
     1629                Find_non_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr+1], atof(argv[argptr]));
    16301630                //FindDistributionOfEllipsoids((ofstream *)&cout, &T, &LCList, N, number, filename.c_str());
    16311631                end = clock();
     
    18711871                cout << Verbose(1) << "Storing tecplot data in " << argv[argptr] << "." << endl;
    18721872                LinkedCell LCList(mol, 10.);
    1873                 //FindConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr]);
    1874                 FindNonConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr], 10.);
     1873                //Find_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr]);
     1874                Find_non_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr], 10.);
    18751875
    18761876                double volumedifference = ConvexizeNonconvexEnvelope((ofstream *)&cout, mol->TesselStruct, mol, argv[argptr]);
  • src/config.hpp

    r34e0592 r1d9b7aa  
    1818#include "molecules.hpp"
    1919#include "periodentafel.hpp"
    20 
    21 class ConfigFileBuffer {
    22   public:
    23     char **buffer;
    24     int *LineMapping;
    25     int CurrentLine;
    26     int NoLines;
    27 
    28     ConfigFileBuffer();
    29     ConfigFileBuffer(char *filename);
    30     ~ConfigFileBuffer();
    31 
    32     void InitMapping();
    33     void MapIonTypesInBuffer(int NoAtoms);
    34 };
    3520
    3621/** The config file.
  • src/molecules.hpp

    r34e0592 r1d9b7aa  
    303303};
    304304
     305class ConfigFileBuffer {
     306  public:
     307    char **buffer;
     308    int *LineMapping;
     309    int CurrentLine;
     310    int NoLines;
     311
     312    ConfigFileBuffer();
     313    ConfigFileBuffer(char *filename);
     314    ~ConfigFileBuffer();
     315
     316    void InitMapping();
     317    void MapIonTypesInBuffer(int NoAtoms);
     318};
     319
    305320
    306321#endif /*MOLECULES_HPP_*/
  • src/tesselation.cpp

    r34e0592 r1d9b7aa  
    219219    return true;
    220220  }
    221   double angle = GetAngle(helper[0], helper[1], BaseLineNormal);
     221  double angle = getAngle(helper[0], helper[1], BaseLineNormal);
    222222  if ((angle - M_PI) > -MYEPSILON) {
    223223    *out << Verbose(2) << "ACCEPT: Angle is greater than pi: convex." << endl;
     
    14021402
    14031403
    1404 /** Finds the starting triangle for FindNonConvexBorder().
    1405  * Looks at the outermost point per axis, then FindSecondPointForTesselation()
    1406  * for the second and FindNextSuitablePointViaAngleOfSphere() for the third
     1404/** Finds the starting triangle for find_non_convex_border().
     1405 * Looks at the outermost point per axis, then Find_second_point_for_Tesselation()
     1406 * for the second and Find_next_suitable_point_via_Angle_of_Sphere() for the third
    14071407 * point are called.
    14081408 * \param *out output stream for debugging
     
    14101410 * \param *LC LinkedCell structure with neighbouring TesselPoint's
    14111411 */
    1412 void Tesselation::FindStartingTriangle(ofstream *out, const double RADIUS, LinkedCell *LC)
    1413 {
    1414   cout << Verbose(1) << "Begin of FindStartingTriangle\n";
     1412void Tesselation::Find_starting_triangle(ofstream *out, const double RADIUS, LinkedCell *LC)
     1413{
     1414  cout << Verbose(1) << "Begin of Find_starting_triangle\n";
    14151415  int i = 0;
    14161416  LinkedNodes *List = NULL;
     
    14181418  TesselPoint* SecondPoint = NULL;
    14191419  TesselPoint* MaxPoint[NDIM];
    1420   double maxCoordinate[NDIM];
     1420  double max_coordinate[NDIM];
    14211421  Vector Oben;
    14221422  Vector helper;
     
    14281428  for (i = 0; i < 3; i++) {
    14291429    MaxPoint[i] = NULL;
    1430     maxCoordinate[i] = -1;
     1430    max_coordinate[i] = -1;
    14311431  }
    14321432
     
    14401440        if (List != NULL) {
    14411441          for (LinkedNodes::iterator Runner = List->begin();Runner != List->end();Runner++) {
    1442             if ((*Runner)->node->x[i] > maxCoordinate[i]) {
     1442            if ((*Runner)->node->x[i] > max_coordinate[i]) {
    14431443              cout << Verbose(2) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl;
    1444               maxCoordinate[i] = (*Runner)->node->x[i];
     1444              max_coordinate[i] = (*Runner)->node->x[i];
    14451445              MaxPoint[i] = (*Runner);
    14461446            }
     
    14581458
    14591459  BTS = NULL;
    1460   CandidateList *OptCandidates = new CandidateList();
     1460  CandidateList *Opt_Candidates = new CandidateList();
    14611461  for (int k=0;k<NDIM;k++) {
    14621462    Oben.x[k] = 1.;
     
    14651465
    14661466    double ShortestAngle;
    1467     TesselPoint* OptCandidate = NULL;
     1467    TesselPoint* Opt_Candidate = NULL;
    14681468    ShortestAngle = 999999.; // This will contain the angle, which will be always positive (when looking for second point), when looking for third point this will be the quadrant.
    14691469
    1470     FindSecondPointForTesselation(FirstPoint, NULL, Oben, OptCandidate, &ShortestAngle, RADIUS, LC); // we give same point as next candidate as its bonds are looked into in find_second_...
    1471     SecondPoint = OptCandidate;
     1470    Find_second_point_for_Tesselation(FirstPoint, NULL, Oben, Opt_Candidate, &ShortestAngle, RADIUS, LC); // we give same point as next candidate as its bonds are looked into in find_second_...
     1471    SecondPoint = Opt_Candidate;
    14721472    if (SecondPoint == NULL)  // have we found a second point?
    14731473      continue;
     
    15001500
    15011501    //cout << Verbose(2) << "INFO: OldSphereCenter is at " << helper << ".\n";
    1502     FindThirdPointForTesselation(
    1503       Oben, SearchDirection, helper, BLS[0], NULL, *&OptCandidates, &ShortestAngle, RADIUS, LC
     1502    Find_third_point_for_Tesselation(
     1503      Oben, SearchDirection, helper, BLS[0], NULL, *&Opt_Candidates, &ShortestAngle, RADIUS, LC
    15041504    );
    15051505    cout << Verbose(1) << "List of third Points is ";
    1506     for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) {
     1506    for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
    15071507        cout << " " << *(*it)->point;
    15081508    }
    15091509    cout << endl;
    15101510
    1511     for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) {
     1511    for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
    15121512      // add third triangle point
    15131513      AddTesselationPoint((*it)->point, 2);
     
    15261526
    15271527      // if we do not reach the end with the next step of iteration, we need to setup a new first line
    1528       if (it != OptCandidates->end()--) {
     1528      if (it != Opt_Candidates->end()--) {
    15291529        FirstPoint = (*it)->BaseLine->endpoints[0]->node;
    15301530        SecondPoint = (*it)->point;
     
    15411541      // remove all candidates from the list and then the list itself
    15421542      class CandidateForTesselation *remover = NULL;
    1543       for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) {
     1543      for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
    15441544        remover = *it;
    15451545        delete(remover);
    15461546      }
    1547       OptCandidates->clear();
     1547      Opt_Candidates->clear();
    15481548    }
    15491549  }
     
    15511551  // remove all candidates from the list and then the list itself
    15521552  class CandidateForTesselation *remover = NULL;
    1553   for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) {
     1553  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
    15541554    remover = *it;
    15551555    delete(remover);
    15561556  }
    1557   delete(OptCandidates);
    1558   cout << Verbose(1) << "End of FindStartingTriangle\n";
     1557  delete(Opt_Candidates);
     1558  cout << Verbose(1) << "End of Find_starting_triangle\n";
    15591559};
    15601560
     
    15681568 * @param *LC LinkedCell structure with neighbouring points
    15691569 */
    1570 bool Tesselation::FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC)
    1571 {
    1572   cout << Verbose(0) << "Begin of FindNextSuitableTriangle\n";
     1570bool Tesselation::Find_next_suitable_triangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC)
     1571{
     1572  cout << Verbose(0) << "Begin of Find_next_suitable_triangle\n";
    15731573  bool result = true;
    1574   CandidateList *OptCandidates = new CandidateList();
     1574  CandidateList *Opt_Candidates = new CandidateList();
    15751575
    15761576  Vector CircleCenter;
     
    16291629
    16301630    // add third point
    1631     FindThirdPointForTesselation(
    1632       T.NormalVector, SearchDirection, OldSphereCenter, &Line, ThirdNode, OptCandidates,
     1631    Find_third_point_for_Tesselation(
     1632      T.NormalVector, SearchDirection, OldSphereCenter, &Line, ThirdNode, Opt_Candidates,
    16331633      &ShortestAngle, RADIUS, LC
    16341634    );
     
    16381638  }
    16391639
    1640   if (OptCandidates->begin() == OptCandidates->end()) {
     1640  if (Opt_Candidates->begin() == Opt_Candidates->end()) {
    16411641    cerr << "WARNING: Could not find a suitable candidate." << endl;
    16421642    return false;
    16431643  }
    16441644  cout << Verbose(1) << "Third Points are ";
    1645   for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) {
     1645  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
    16461646    cout << " " << *(*it)->point;
    16471647  }
     
    16491649
    16501650  BoundaryLineSet *BaseRay = &Line;
    1651   for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) {
     1651  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
    16521652    cout << Verbose(1) << " Third point candidate is " << *(*it)->point
    16531653    << " with circumsphere's center at " << (*it)->OptCenter << "." << endl;
     
    16681668      AddTesselationPoint(BaseRay->endpoints[1]->node, 2);
    16691669
    1670       if (CheckLineCriteriaForDegeneratedTriangle(TPS)) {
     1670      if (CheckLineCriteriaforDegeneratedTriangle(TPS)) {
    16711671        AddTesselationLine(TPS[0], TPS[1], 0);
    16721672        AddTesselationLine(TPS[0], TPS[2], 1);
     
    16971697        // 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)
    16981698        // i.e. at least one of the three lines must be present with TriangleCount <= 1
    1699         if (CheckLineCriteriaForDegeneratedTriangle(TPS)) {
     1699        if (CheckLineCriteriaforDegeneratedTriangle(TPS)) {
    17001700          AddTesselationLine(TPS[0], TPS[1], 0);
    17011701          AddTesselationLine(TPS[0], TPS[2], 1);
     
    17351735  // remove all candidates from the list and then the list itself
    17361736  class CandidateForTesselation *remover = NULL;
    1737   for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) {
     1737  for (CandidateList::iterator it = Opt_Candidates->begin(); it != Opt_Candidates->end(); ++it) {
    17381738    remover = *it;
    17391739    delete(remover);
    17401740  }
    1741   delete(OptCandidates);
    1742   cout << Verbose(0) << "End of FindNextSuitableTriangle\n";
     1741  delete(Opt_Candidates);
     1742  cout << Verbose(0) << "End of Find_next_suitable_triangle\n";
    17431743  return result;
    17441744};
     
    20472047 * \param *Candidate pointer to candidate node on return
    20482048 * \param Oben vector indicating the outside
    2049  * \param OptCandidate reference to recommended candidate on return
     2049 * \param Opt_Candidate reference to recommended candidate on return
    20502050 * \param Storage[3] array storing angles and other candidate information
    20512051 * \param RADIUS radius of virtual sphere
    20522052 * \param *LC LinkedCell structure with neighbouring points
    20532053 */
    2054 void Tesselation::FindSecondPointForTesselation(TesselPoint* a, TesselPoint* Candidate, Vector Oben, TesselPoint*& OptCandidate, double Storage[3], double RADIUS, LinkedCell *LC)
    2055 {
    2056   cout << Verbose(2) << "Begin of FindSecondPointForTesselation" << endl;
     2054void Tesselation::Find_second_point_for_Tesselation(TesselPoint* a, TesselPoint* Candidate, Vector Oben, TesselPoint*& Opt_Candidate, double Storage[3], double RADIUS, LinkedCell *LC)
     2055{
     2056  cout << Verbose(2) << "Begin of Find_second_point_for_Tesselation" << endl;
    20572057  Vector AngleCheck;
    20582058  double norm = -1., angle;
     
    20922092            if (a != Candidate) {
    20932093              // Calculate center of the circle with radius RADIUS through points a and Candidate
    2094               Vector OrthogonalizedOben, aCandidate, Center;
     2094              Vector OrthogonalizedOben, a_Candidate, Center;
    20952095              double distance, scaleFactor;
    20962096
    20972097              OrthogonalizedOben.CopyVector(&Oben);
    2098               aCandidate.CopyVector(a->node);
    2099               aCandidate.SubtractVector(Candidate->node);
    2100               OrthogonalizedOben.ProjectOntoPlane(&aCandidate);
     2098              a_Candidate.CopyVector(a->node);
     2099              a_Candidate.SubtractVector(Candidate->node);
     2100              OrthogonalizedOben.ProjectOntoPlane(&a_Candidate);
    21012101              OrthogonalizedOben.Normalize();
    2102               distance = 0.5 * aCandidate.Norm();
     2102              distance = 0.5 * a_Candidate.Norm();
    21032103              scaleFactor = sqrt(((RADIUS * RADIUS) - (distance * distance)));
    21042104              OrthogonalizedOben.Scale(scaleFactor);
     
    21112111              AngleCheck.CopyVector(&Center);
    21122112              AngleCheck.SubtractVector(a->node);
    2113               norm = aCandidate.Norm();
     2113              norm = a_Candidate.Norm();
    21142114              // second point shall have smallest angle with respect to Oben vector
    21152115              if (norm < RADIUS*2.) {
     
    21182118                  //cout << Verbose(3) << "Old values of Storage: %lf %lf \n", Storage[0], Storage[1]);
    21192119                  cout << Verbose(3) << "Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".\n";
    2120                   OptCandidate = Candidate;
     2120                  Opt_Candidate = Candidate;
    21212121                  Storage[0] = angle;
    21222122                  //cout << Verbose(3) << "Changing something in Storage: %lf %lf. \n", Storage[0], Storage[2]);
    21232123                } else {
    2124                   //cout << Verbose(3) << "Current candidate is " << *Candidate << ": Looses with angle " << angle << " to a better candidate " << *OptCandidate << endl;
     2124                  //cout << Verbose(3) << "Current candidate is " << *Candidate << ": Looses with angle " << angle << " to a better candidate " << *Opt_Candidate << endl;
    21252125                }
    21262126              } else {
     
    21352135        }
    21362136      }
    2137   cout << Verbose(2) << "End of FindSecondPointForTesselation" << endl;
     2137  cout << Verbose(2) << "End of Find_second_point_for_Tesselation" << endl;
    21382138};
    21392139
     
    21612161 * holds. Then, the normalized projection onto the SearchDirection is either +1 or -1 and thus states whether
    21622162 * the angle is uniquely in either (0,M_PI] or [M_PI, 2.*M_PI).
    2163  * @param NormalVector normal direction of the base triangle (here the unit axis vector, \sa FindStartingTriangle())
     2163 * @param NormalVector normal direction of the base triangle (here the unit axis vector, \sa Find_starting_triangle())
    21642164 * @param SearchDirection general direction where to search for the next point, relative to center of BaseLine
    21652165 * @param OldSphereCenter center of sphere for base triangle, relative to center of BaseLine, giving null angle for the parameter circle
     
    21672167 * @param ThirdNode third point to avoid in search
    21682168 * @param candidates list of equally good candidates to return
    2169  * @param ShortestAngle the current path length on this circle band for the current OptCandidate
     2169 * @param ShortestAngle the current path length on this circle band for the current Opt_Candidate
    21702170 * @param RADIUS radius of sphere
    21712171 * @param *LC LinkedCell structure with neighbouring points
    21722172 */
    2173 void Tesselation::FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint  *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, LinkedCell *LC)
     2173void Tesselation::Find_third_point_for_Tesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint  *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, LinkedCell *LC)
    21742174{
    21752175  Vector CircleCenter;  // center of the circle, i.e. of the band of sphere's centers
     
    21882188  CandidateForTesselation *optCandidate = NULL;
    21892189
    2190   cout << Verbose(1) << "Begin of FindThirdPointForTesselation" << endl;
     2190  cout << Verbose(1) << "Begin of Find_third_point_for_Tesselation" << endl;
    21912191
    21922192  //cout << Verbose(2) << "INFO: NormalVector of BaseTriangle is " << NormalVector << "." << endl;
     
    23452345  if (candidates->size() > 1) {
    23462346    candidates->unique();
    2347     candidates->sort(SortCandidates);
    2348   }
    2349 
    2350   cout << Verbose(1) << "End of FindThirdPointForTesselation" << endl;
     2347    candidates->sort(sortCandidates);
     2348  }
     2349
     2350  cout << Verbose(1) << "End of Find_third_point_for_Tesselation" << endl;
    23512351};
    23522352
     
    23972397  }
    23982398
    2399   trianglePoints[0] = FindClosestPoint(x, SecondPoint, LC);
     2399  trianglePoints[0] = findClosestPoint(x, SecondPoint, LC);
    24002400 
    24012401  // check whether closest point is "too close" :), then it's inside
     
    24082408    return NULL;
    24092409  }
    2410   list<TesselPoint*> *connectedPoints = GetCircleOfConnectedPoints(out, trianglePoints[0]);
    2411   list<TesselPoint*> *connectedClosestPoints = GetNeighboursOnCircleOfConnectedPoints(out, connectedPoints, trianglePoints[0], x);
     2410  list<TesselPoint*> *connectedPoints = getCircleOfConnectedPoints(out, trianglePoints[0]);
     2411  list<TesselPoint*> *connectedClosestPoints = getNeighboursonCircleofConnectedPoints(out, connectedPoints, trianglePoints[0], x);
    24122412  delete(connectedPoints);
    24132413  trianglePoints[1] = connectedClosestPoints->front();
     
    24972497 * @return list of the all points linked to the provided one
    24982498 */
    2499 list<TesselPoint*> * Tesselation::GetCircleOfConnectedPoints(ofstream *out, TesselPoint* Point)
     2499list<TesselPoint*> * Tesselation::getCircleOfConnectedPoints(ofstream *out, TesselPoint* Point)
    25002500{
    25012501  list<TesselPoint*> *connectedPoints = new list<TesselPoint*>;
     
    25582558 * @return list of the two points linked to the provided one and closest to the point to be checked,
    25592559 */
    2560 list<TesselPoint*> * Tesselation::GetNeighboursOnCircleOfConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference)
     2560list<TesselPoint*> * Tesselation::getNeighboursonCircleofConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference)
    25612561{
    25622562  map<double, TesselPoint*> anglesOfPoints;
     
    25972597    helper.SubtractVector(Point->node);
    25982598    helper.ProjectOntoPlane(&PlaneNormal);
    2599     double angle = GetAngle(helper, AngleZero, OrthogonalVector);
     2599    double angle = getAngle(helper, AngleZero, OrthogonalVector);
    26002600    *out << Verbose(2) << "INFO: Calculated angle is " << angle << " for point " << **listRunner << "." << endl;
    26012601    anglesOfPoints.insert(pair<double, TesselPoint*>(angle, (*listRunner)));
     
    26442644    return 0.;
    26452645  }
    2646   list<TesselPoint*> *CircleofPoints = GetCircleOfConnectedPoints(out, point->node);
     2646  list<TesselPoint*> *CircleofPoints = getCircleOfConnectedPoints(out, point->node);
    26472647
    26482648  // remove all triangles
     
    27162716 * \return true - there is such a line (i.e. creation of degenerated triangle is valid), false - no such line (don't create)
    27172717 */
    2718 bool CheckLineCriteriaForDegeneratedTriangle(class BoundaryPointSet *nodes[3])
     2718bool CheckLineCriteriaforDegeneratedTriangle(class BoundaryPointSet *nodes[3])
    27192719{
    27202720  bool result = false;
     
    27502750/** Sort function for the candidate list.
    27512751 */
    2752 bool SortCandidates(CandidateForTesselation* candidate1, CandidateForTesselation* candidate2)
     2752bool sortCandidates(CandidateForTesselation* candidate1, CandidateForTesselation* candidate2)
    27532753{
    27542754  Vector BaseLineVector, OrthogonalVector, helper;
     
    28002800 * @return point which is second closest to the provided one
    28012801 */
    2802 TesselPoint* FindSecondClosestPoint(const Vector* Point, LinkedCell* LC)
     2802TesselPoint* findSecondClosestPoint(const Vector* Point, LinkedCell* LC)
    28032803{
    28042804  LinkedNodes *List = NULL;
     
    28462846};
    28472847
     2848
     2849
    28482850/**
    28492851 * Finds the point which is closest to the provided one.
     
    28552857 * @return point which is closest to the provided one, NULL if none found
    28562858 */
    2857 TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC)
     2859TesselPoint* findClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC)
    28582860{
    28592861  LinkedNodes *List = NULL;
     
    29022904  return closestPoint;
    29032905};
     2906
    29042907
    29052908/**
     
    29682971}
    29692972
    2970 /**
    2971  * Finds all degenerated triangles within the tesselation structure.
    2972  *
    2973  * @return map of keys of degenerated triangle pairs, each triangle occurs twice
    2974  *         in the list, once as key and once as value
    2975  */
    2976 map<int, int> Tesselation::FindAllDegeneratedTriangles()
    2977 {
    2978   map<int, int> DegeneratedTriangles;
    2979 
    2980   // sanity check
    2981   if (LinesOnBoundary.empty()) {
    2982     cout << Verbose(1) << "Warning: FindAllDegeneratedTriangles() was called without any tesselation structure.";
    2983     return DegeneratedTriangles;
    2984   }
    2985 
    2986   LineMap::iterator LineRunner1, LineRunner2;
    2987 
    2988   for (LineRunner1 = LinesOnBoundary.begin(); LineRunner1 != LinesOnBoundary.end(); ++LineRunner1) {
    2989     for (LineRunner2 = LinesOnBoundary.begin(); LineRunner2 != LinesOnBoundary.end(); ++LineRunner2) {
    2990       if ((LineRunner1->second != LineRunner2->second)
    2991         && (LineRunner1->second->endpoints[0] == LineRunner2->second->endpoints[0])
    2992         && (LineRunner1->second->endpoints[1] == LineRunner2->second->endpoints[1])
    2993       ) {
    2994         TriangleMap::iterator TriangleRunner1 = LineRunner1->second->triangles.begin(),
    2995           TriangleRunner2 = LineRunner2->second->triangles.begin();
    2996 
    2997         for (; TriangleRunner1 != LineRunner1->second->triangles.end(); ++TriangleRunner1) {
    2998           for (; TriangleRunner2 != LineRunner2->second->triangles.end(); ++TriangleRunner2) {
    2999             if ((TriangleRunner1->second != TriangleRunner2->second)
    3000               && (TriangleRunner1->second->endpoints[0] == TriangleRunner2->second->endpoints[0])
    3001               && (TriangleRunner1->second->endpoints[1] == TriangleRunner2->second->endpoints[1])
    3002               && (TriangleRunner1->second->endpoints[2] == TriangleRunner2->second->endpoints[2])
    3003             ) {
    3004               DegeneratedTriangles[TriangleRunner1->second->Nr] = TriangleRunner2->second->Nr;
    3005               DegeneratedTriangles[TriangleRunner2->second->Nr] = TriangleRunner1->second->Nr;
    3006             }
    3007           }
    3008         }
    3009       }
    3010     }
    3011   }
    3012 
    3013   cout << Verbose(1) << "FindAllDegeneratedTriangles() found " << DegeneratedTriangles.size() << " triangles." << endl;
    3014   map<int,int>::iterator it;
    3015   for (it = DegeneratedTriangles.begin(); it != DegeneratedTriangles.end(); it++)
    3016       cout << Verbose(2) << (*it).first << " => " << (*it).second << endl;
    3017 
    3018   return DegeneratedTriangles;
    3019 }
    3020 
    3021 /**
    3022  * Purges degenerated triangles from the tesselation structure if they are not
    3023  * necessary to keep a single point within the structure.
    3024  */
    3025 void Tesselation::RemoveDegeneratedTriangles()
    3026 {
    3027   map<int, int> DegeneratedTriangles = FindAllDegeneratedTriangles();
    3028 
    3029   for (map<int, int>::iterator TriangleKeyRunner = DegeneratedTriangles.begin();
    3030     TriangleKeyRunner != DegeneratedTriangles.end(); ++TriangleKeyRunner
    3031   ) {
    3032     BoundaryTriangleSet *triangle = TrianglesOnBoundary.find(TriangleKeyRunner->first)->second,
    3033       *partnerTriangle = TrianglesOnBoundary.find(TriangleKeyRunner->second)->second;
    3034 
    3035     bool trianglesShareLine = false;
    3036     for (int i = 0; i < 3; ++i)
    3037       for (int j = 0; j < 3; ++j)
    3038         trianglesShareLine = trianglesShareLine || triangle->lines[i] == partnerTriangle->lines[j];
    3039 
    3040     if (trianglesShareLine
    3041       && (triangle->endpoints[1]->LinesCount > 2)
    3042       && (triangle->endpoints[2]->LinesCount > 2)
    3043       && (triangle->endpoints[0]->LinesCount > 2)
    3044     ) {
    3045       cout << Verbose(1) << "RemoveDegeneratedTriangles() removes triangle " << *triangle << "." << endl;
    3046       RemoveTesselationTriangle(triangle);
    3047       cout << Verbose(1) << "RemoveDegeneratedTriangles() removes triangle " << *partnerTriangle << "." << endl;
    3048       RemoveTesselationTriangle(partnerTriangle);
    3049       DegeneratedTriangles.erase(DegeneratedTriangles.find(partnerTriangle->Nr));
    3050     } else {
    3051       cout << Verbose(1) << "RemoveDegeneratedTriangles() does not remove triangle " << *triangle
    3052         << " and its partner " << *partnerTriangle << " because it is essential for at"
    3053         << " least one of the endpoints to be kept in the tesselation structure." << endl;
    3054     }
    3055   }
    3056 }
    3057 
    30582973/** Gets the angle between a point and a reference relative to the provided center.
    30592974 * We have two shanks point and reference between which the angle is calculated
     
    30652980 * @return angle between point and reference
    30662981 */
    3067 double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector)
     2982double getAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector)
    30682983{
    30692984  if (reference.IsZero())
  • src/tesselation.hpp

    r34e0592 r1d9b7aa  
    2020#include <map>
    2121#include <list>
    22 #include <set>
    2322
    2423
     
    204203
    205204    // concave envelope
    206     void FindStartingTriangle(ofstream *out, const double RADIUS, class LinkedCell *LC);
    207     void FindSecondPointForTesselation(class TesselPoint* a, class TesselPoint* Candidate, Vector Oben, class TesselPoint*& OptCandidate, double Storage[3], double RADIUS, class LinkedCell *LC);
    208     void FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, class LinkedCell *LC);
    209     bool FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC);
     205    void Find_starting_triangle(ofstream *out, const double RADIUS, class LinkedCell *LC);
     206    void Find_second_point_for_Tesselation(class TesselPoint* a, class TesselPoint* Candidate, Vector Oben, class TesselPoint*& Opt_Candidate, double Storage[3], double RADIUS, class LinkedCell *LC);
     207    void Find_third_point_for_Tesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, class LinkedCell *LC);
     208    bool Find_next_suitable_triangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC);
    210209    int CheckPresenceOfTriangle(ofstream *out, class TesselPoint *Candidates[3]);
    211210
     
    218217    bool PickFarthestofTwoBaselines(ofstream *out, class BoundaryLineSet *Base);
    219218    class BoundaryPointSet *IsConvexRectangle(ofstream *out, class BoundaryLineSet *Base);
    220     map<int, int> FindAllDegeneratedTriangles();
    221     void RemoveDegeneratedTriangles();
    222 
    223     list<TesselPoint*> * GetCircleOfConnectedPoints(ofstream *out, TesselPoint* Point);
    224     list<TesselPoint*> * GetNeighboursOnCircleOfConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference);
     219
     220
     221    list<TesselPoint*> * getCircleOfConnectedPoints(ofstream *out, TesselPoint* Point);
     222    list<TesselPoint*> * getNeighboursonCircleofConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference);
    225223    list<BoundaryTriangleSet*> *FindTriangles(TesselPoint* Points[3]);
    226224    list<BoundaryTriangleSet*> * FindClosestTrianglesToPoint(ofstream *out, Vector *x, LinkedCell* LC);
     
    264262};
    265263
    266 bool CheckLineCriteriaForDegeneratedTriangle(class BoundaryPointSet *nodes[3]);
    267 bool SortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2);
    268 TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC);
    269 TesselPoint* FindSecondClosestPoint(const Vector*, LinkedCell*);
    270 double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector);
     264bool CheckLineCriteriaforDegeneratedTriangle(class BoundaryPointSet *nodes[3]);
     265bool sortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2);
     266TesselPoint* findClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC);
     267TesselPoint* findSecondClosestPoint(const Vector*, LinkedCell*);
     268double getAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector);
    271269Vector * GetClosestPointBetweenLine(ofstream *out, class BoundaryLineSet *Base, class BoundaryLineSet *OtherBase);
    272270
  • src/tesselationhelpers.cpp

    r34e0592 r1d9b7aa  
    88#include "tesselationhelpers.hpp"
    99
    10 double DetGet(gsl_matrix *A, int inPlace) {
     10double det_get(gsl_matrix *A, int inPlace) {
    1111  /*
    1212  inPlace = 1 => A is replaced with the LU decomposed copy.
     
    3636};
    3737
    38 void GetSphere(Vector *center, Vector &a, Vector &b, Vector &c, double RADIUS)
     38void get_sphere(Vector *center, Vector &a, Vector &b, Vector &c, double RADIUS)
    3939{
    4040  gsl_matrix *A = gsl_matrix_calloc(3,3);
     
    4646    gsl_matrix_set(A, i, 2, c.x[i]);
    4747  }
    48   m11 = DetGet(A, 1);
     48  m11 = det_get(A, 1);
    4949
    5050  for(int i=0;i<3;i++) {
     
    5353    gsl_matrix_set(A, i, 2, c.x[i]);
    5454  }
    55   m12 = DetGet(A, 1);
     55  m12 = det_get(A, 1);
    5656
    5757  for(int i=0;i<3;i++) {
     
    6060    gsl_matrix_set(A, i, 2, c.x[i]);
    6161  }
    62   m13 = DetGet(A, 1);
     62  m13 = det_get(A, 1);
    6363
    6464  for(int i=0;i<3;i++) {
     
    6767    gsl_matrix_set(A, i, 2, b.x[i]);
    6868  }
    69   m14 = DetGet(A, 1);
     69  m14 = det_get(A, 1);
    7070
    7171  if (fabs(m11) < MYEPSILON)
     
    101101 * @param Umkreisradius double radius of circumscribing circle
    102102 */
    103 void GetCenterOfSphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector* AlternativeDirection,
     103void Get_center_of_sphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector* AlternativeDirection,
    104104    double HalfplaneIndicator, double AlternativeIndicator, double alpha, double beta, double gamma, double RADIUS, double Umkreisradius)
    105105{
     
    107107  double Restradius;
    108108  Vector OtherCenter;
    109   cout << Verbose(3) << "Begin of GetCenterOfSphere.\n";
     109  cout << Verbose(3) << "Begin of Get_center_of_sphere.\n";
    110110  Center->Zero();
    111111  helper.CopyVector(&a);
     
    153153  Center->AddVector(&TempNormal);
    154154  cout << Verbose(0) << "Center of sphere of circumference is " << *Center << ".\n";
    155   GetSphere(&OtherCenter, a, b, c, RADIUS);
     155  get_sphere(&OtherCenter, a, b, c, RADIUS);
    156156  cout << Verbose(0) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n";
    157   cout << Verbose(3) << "End of GetCenterOfSphere.\n";
     157  cout << Verbose(3) << "End of Get_center_of_sphere.\n";
    158158};
    159159
     
    307307    gsl_multimin_fminimizer *s = NULL;
    308308    gsl_vector *ss, *x;
    309     gsl_multimin_function minexFunction;
     309    gsl_multimin_function minex_func;
    310310
    311311    size_t iter = 0;
     
    324324
    325325    /* Initialize method and iterate */
    326     minexFunction.n = NDIM;
    327     minexFunction.f = &MinIntersectDistance;
    328     minexFunction.params = (void *)&par;
     326    minex_func.n = NDIM;
     327    minex_func.f = &MinIntersectDistance;
     328    minex_func.params = (void *)&par;
    329329
    330330    s = gsl_multimin_fminimizer_alloc(T, NDIM);
    331     gsl_multimin_fminimizer_set(s, &minexFunction, x, ss);
     331    gsl_multimin_fminimizer_set(s, &minex_func, x, ss);
    332332
    333333    do {
  • src/tesselationhelpers.hpp

    r34e0592 r1d9b7aa  
    2828#include "vector.hpp"
    2929
    30 double DetGet(gsl_matrix *A, int inPlace);
    31 void GetSphere(Vector *center, Vector &a, Vector &b, Vector &c, double RADIUS);
    32 void GetCenterOfSphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector* AlternativeDirection, double HalfplaneIndicator, double AlternativeIndicator, double alpha, double beta, double gamma, double RADIUS, double Umkreisradius);
     30double det_get(gsl_matrix *A, int inPlace);
     31void get_sphere(Vector *center, Vector &a, Vector &b, Vector &c, double RADIUS);
     32void Get_center_of_sphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector* AlternativeDirection, double HalfplaneIndicator, double AlternativeIndicator, double alpha, double beta, double gamma, double RADIUS, double Umkreisradius);
    3333void GetCenterofCircumcircle(Vector *Center, Vector *a, Vector *b, Vector *c);
    3434double GetPathLengthonCircumCircle(Vector &CircleCenter, Vector &CirclePlaneNormal, double CircleRadius, Vector &NewSphereCenter, Vector &OldSphereCenter, Vector &NormalVector, Vector &SearchDirection);
     
    3636bool existsIntersection(Vector point1, Vector point2, Vector point3, Vector point4);
    3737
     38//bool Choose_preferable_third_point(atom *Candidate, atom *OptCandidate, class BoundaryLineSet *BaseLine, atom *ThirdNode, Tesselation *Tess);
     39
     40
    3841#endif /* TESSELATIONHELPERS_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.