- Timestamp:
- Aug 17, 2009, 1:20:16 PM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 7c14ec
- Parents:
- 093645
- Location:
- src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
r093645 rf1cccd 118 118 * \param *mol molecule structure with atom positions 119 119 */ 120 void write_vrml_file(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, class molecule *mol)120 void WriteVrmlFile(ofstream *out, ofstream *vrmlfile, class Tesselation *Tess, class molecule *mol) 121 121 { 122 122 atom *Walker = mol->start; … … 172 172 * \param *mol molecule structure with atom positions 173 173 */ 174 void write_raster3d_file(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, class molecule *mol)174 void WriteRaster3dFile(ofstream *out, ofstream *rasterfile, class Tesselation *Tess, class molecule *mol) 175 175 { 176 176 atom *Walker = mol->start; … … 227 227 * \param N arbitrary number to differentiate various zones in the tecplot format 228 228 */ 229 void write_tecplot_file(ofstream *out, ofstream *tecplot, class Tesselation *TesselStruct, class molecule *mol, int N)229 void WriteTecplotFile(ofstream *out, ofstream *tecplot, class Tesselation *TesselStruct, class molecule *mol, int N) 230 230 { 231 231 if ((tecplot != NULL) && (TesselStruct != NULL)) { … … 440 440 * \return *TesselStruct is filled with convex boundary and tesselation is stored under \a *filename. 441 441 */ 442 void Find _convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename)442 void FindConvexBorder(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename) 443 443 { 444 444 bool BoundaryFreeFlag = false; 445 445 Boundaries *BoundaryPoints = NULL; 446 446 447 cout << Verbose(1) << "Begin of find_convex_border" << endl;447 cout << Verbose(1) << "Begin of FindConvexBorder" << endl; 448 448 449 449 if (mol->TesselStruct != NULL) // free if allocated … … 509 509 OutputName.append(TecplotSuffix); 510 510 ofstream *tecplot = new ofstream(OutputName.c_str()); 511 write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);511 WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0); 512 512 tecplot->close(); 513 513 delete(tecplot); … … 518 518 OutputName.append(Raster3DSuffix); 519 519 ofstream *rasterplot = new ofstream(OutputName.c_str()); 520 write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);520 WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol); 521 521 rasterplot->close(); 522 522 delete(rasterplot); … … 556 556 OutputName.append(TecplotSuffix); 557 557 ofstream *tecplot = new ofstream(OutputName.c_str()); 558 write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);558 WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0); 559 559 tecplot->close(); 560 560 delete(tecplot); … … 564 564 OutputName.append(Raster3DSuffix); 565 565 ofstream *rasterplot = new ofstream(OutputName.c_str()); 566 write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);566 WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol); 567 567 rasterplot->close(); 568 568 delete(rasterplot); … … 575 575 delete[] (BoundaryPoints); 576 576 577 cout << Verbose(1) << "End of find_convex_border" << endl;577 cout << Verbose(1) << "End of FindConvexBorder" << endl; 578 578 }; 579 579 … … 700 700 OutputName.append(TecplotSuffix); 701 701 ofstream *tecplot = new ofstream(OutputName.c_str()); 702 write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);702 WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0); 703 703 tecplot->close(); 704 704 delete(tecplot); … … 709 709 OutputName.append(Raster3DSuffix); 710 710 ofstream *rasterplot = new ofstream(OutputName.c_str()); 711 write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);711 WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol); 712 712 rasterplot->close(); 713 713 delete(rasterplot); … … 754 754 OutputName.append(TecplotSuffix); 755 755 ofstream *tecplot = new ofstream(OutputName.c_str()); 756 write_tecplot_file(out, tecplot, mol->TesselStruct, mol, 0);756 WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, 0); 757 757 tecplot->close(); 758 758 delete(tecplot); … … 762 762 OutputName.append(Raster3DSuffix); 763 763 ofstream *rasterplot = new ofstream(OutputName.c_str()); 764 write_raster3d_file(out, rasterplot, mol->TesselStruct, mol);764 WriteRaster3dFile(out, rasterplot, mol->TesselStruct, mol); 765 765 rasterplot->close(); 766 766 delete(rasterplot); … … 841 841 class Tesselation *TesselStruct = NULL; 842 842 LinkedCell LCList(mol, 10.); 843 Find _convex_border(out, mol, &LCList, NULL);843 FindConvexBorder(out, mol, &LCList, NULL); 844 844 double clustervolume; 845 845 if (ClusterVolume == 0) … … 982 982 if ((*ListRunner)->TesselStruct == NULL) { 983 983 *out << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl; 984 Find _non_convex_border((ofstream *)&cout, (*ListRunner), LCList[i], NULL, 5.);984 FindNonConvexBorder((ofstream *)&cout, (*ListRunner), LCList[i], NULL, 5.); 985 985 } 986 986 i++; … … 1107 1107 * \para RADIUS radius of the virtual sphere 1108 1108 */ 1109 void Find _non_convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename, const double RADIUS)1109 void FindNonConvexBorder(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename, const double RADIUS) 1110 1110 { 1111 1111 int N = 0; … … 1126 1126 LineMap::iterator baseline; 1127 1127 LineMap::iterator testline; 1128 *out << Verbose(0) << "Begin of Find _non_convex_border\n";1128 *out << Verbose(0) << "Begin of FindNonConvexBorder\n"; 1129 1129 bool flag = false; // marks whether we went once through all baselines without finding any without two triangles 1130 1130 bool failflag = false; … … 1135 1135 } 1136 1136 1137 mol->TesselStruct->Find _starting_triangle(out, RADIUS, LCList);1137 mol->TesselStruct->FindStartingTriangle(out, RADIUS, LCList); 1138 1138 1139 1139 baseline = mol->TesselStruct->LinesOnBoundary.begin(); … … 1144 1144 while ((baseline != mol->TesselStruct->LinesOnBoundary.end()) || (flag)) { 1145 1145 if (baseline->second->triangles.size() == 1) { 1146 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.1146 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. 1147 1147 flag = flag || failflag; 1148 1148 if (!failflag) 1149 cerr << "WARNING: Find _next_suitable_triangle failed." << endl;1149 cerr << "WARNING: FindNextSuitableTriangle failed." << endl; 1150 1150 // write temporary envelope 1151 1151 if ((DoSingleStepOutput && (mol->TesselStruct->TrianglesOnBoundaryCount % SingleStepWidth == 0))) { // if we have a new triangle and want to output each new triangle configuration … … 1163 1163 *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n"; 1164 1164 tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc); 1165 write_tecplot_file(out, tempstream, mol->TesselStruct, mol, TriangleFilesWritten);1165 WriteTecplotFile(out, tempstream, mol->TesselStruct, mol, TriangleFilesWritten); 1166 1166 tempstream->close(); 1167 1167 tempstream->flush(); … … 1177 1177 *out << Verbose(1) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n"; 1178 1178 tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc); 1179 write_raster3d_file(out, tempstream, mol->TesselStruct, mol);1179 WriteRaster3dFile(out, tempstream, mol->TesselStruct, mol); 1180 1180 // // include the current position of the virtual sphere in the temporary raster3d file 1181 1181 // // make the circumsphere's center absolute again … … 1223 1223 OutputName.append(TecplotSuffix); 1224 1224 ofstream *tecplot = new ofstream(OutputName.c_str()); 1225 write_tecplot_file(out, tecplot, mol->TesselStruct, mol, -1);1225 WriteTecplotFile(out, tecplot, mol->TesselStruct, mol, -1); 1226 1226 tecplot->close(); 1227 1227 delete(tecplot); … … 1231 1231 OutputName.append(Raster3DSuffix); 1232 1232 ofstream *raster = new ofstream(OutputName.c_str()); 1233 write_raster3d_file(out, raster, mol->TesselStruct, mol);1233 WriteRaster3dFile(out, raster, mol->TesselStruct, mol); 1234 1234 raster->close(); 1235 1235 delete(raster); … … 1285 1285 if (freeLC) 1286 1286 delete(LCList); 1287 *out << Verbose(0) << "End of Find _non_convex_border\n";1287 *out << Verbose(0) << "End of FindNonConvexBorder\n"; 1288 1288 }; 1289 1289 -
src/boundary.hpp
r093645 rf1cccd 37 37 void PrepareClustersinWater(ofstream *out, config *configuration, molecule *mol, double ClusterVolume, double celldensity); 38 38 molecule * FillBoxWithMolecule(ofstream *out, MoleculeListClass *List, molecule *filler, config &configuration, double distance[NDIM], double RandAtomDisplacement, double RandMolDisplacement, bool DoRandomRotation); 39 void Find _convex_border(ofstream *out, molecule* mol, class LinkedCell *LCList, const char *filename);40 void Find _non_convex_border(ofstream *out, molecule* mol, class LinkedCell *LC, const char *tempbasename, const double RADIUS);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); 41 41 double ConvexizeNonconvexEnvelope(ofstream *out, class Tesselation *TesselStruct, molecule *mol, char *filename); 42 void Find _next_suitable_point(class BoundaryTriangleSet *BaseTriangle, class BoundaryLineSet *BaseLine, atom*& OptCandidate, Vector *OptCandidateCenter, double *ShortestAngle, const double RADIUS, LinkedCell *LC);42 void FindNextSuitablePoint(class BoundaryTriangleSet *BaseTriangle, class BoundaryLineSet *BaseLine, atom*& OptCandidate, Vector *OptCandidateCenter, double *ShortestAngle, const double RADIUS, LinkedCell *LC); 43 43 Boundaries *GetBoundaryPoints(ofstream *out, molecule *mol); 44 44 -
src/builder.cpp
r093645 rf1cccd 584 584 LinkedCell LCList(mol, 10.); 585 585 class Tesselation *TesselStruct = NULL; 586 Find _convex_border((ofstream *)&cout, mol, &LCList, NULL);586 FindConvexBorder((ofstream *)&cout, mol, &LCList, NULL); 587 587 double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, TesselStruct, configuration); 588 588 cout << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl; … … 644 644 Vector x,y,z,n; // coordinates for absolute point in cell volume 645 645 double *factor; // unit factor if desired 646 double bond, min _bond;646 double bond, minBond; 647 647 char choice; // menu choice char 648 648 bool valid; … … 683 683 first = mol->AskAtom("Enter first (fixed) atom: "); 684 684 second = mol->AskAtom("Enter second (shifting) atom: "); 685 min _bond = 0.;685 minBond = 0.; 686 686 for (int i=NDIM;i--;) 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;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; 690 690 cout << Verbose(0) << "Enter new bond length [a.u.]: "; 691 691 cin >> bond; 692 692 for (int i=NDIM;i--;) { 693 second->x.x[i] -= (second->x.x[i]-first->x.x[i])/min _bond*(min_bond-bond);693 second->x.x[i] -= (second->x.x[i]-first->x.x[i])/minBond*(minBond-bond); 694 694 } 695 695 //cout << Verbose(0) << "New coordinates of Atom " << second->nr << " are: "; … … 1325 1325 int j; 1326 1326 double volume = 0.; 1327 enum ConfigStatus config _present = absent;1327 enum ConfigStatus configPresent = absent; 1328 1328 clock_t start,end; 1329 1329 int argptr; … … 1425 1425 if (output == NULL) { 1426 1426 cout << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl; 1427 config _present = absent;1427 configPresent = absent; 1428 1428 } else { 1429 1429 cout << "Empty configuration file." << endl; 1430 1430 ConfigFileName = argv[1]; 1431 config _present = empty;1431 configPresent = empty; 1432 1432 output.close(); 1433 1433 } … … 1440 1440 cout << "new syntax." << endl; 1441 1441 configuration.Load(ConfigFileName, periode, mol); 1442 config _present = present;1442 configPresent = present; 1443 1443 break; 1444 1444 case 0: 1445 1445 cout << "old syntax." << endl; 1446 1446 configuration.LoadOld(ConfigFileName, periode, mol); 1447 config _present = present;1447 configPresent = present; 1448 1448 break; 1449 1449 default: 1450 1450 cout << "Unknown syntax or empty, yet present file." << endl; 1451 config _present = empty;1451 configPresent = empty; 1452 1452 } 1453 1453 } 1454 1454 } else 1455 config _present = absent;1455 configPresent = absent; 1456 1456 // 4. parse again through options, now for those depending on elements db and config presence 1457 1457 argptr = 1; … … 1460 1460 if (argv[argptr][0] == '-') { 1461 1461 argptr++; 1462 if ((config _present == present) || (config_present == empty)) {1462 if ((configPresent == present) || (configPresent == empty)) { 1463 1463 switch(argv[argptr-1][1]) { 1464 1464 case 'p': … … 1474 1474 else { 1475 1475 cout << Verbose(2) << "File found and parsed." << endl; 1476 config _present = present;1476 configPresent = present; 1477 1477 } 1478 1478 } … … 1494 1494 if (first->type != NULL) { 1495 1495 mol->AddAtom(first); // add to molecule 1496 if ((config _present == empty) && (mol->AtomCount != 0))1497 config _present = present;1496 if ((configPresent == empty) && (mol->AtomCount != 0)) 1497 configPresent = present; 1498 1498 } else 1499 1499 cerr << Verbose(1) << "Could not find the specified element." << endl; … … 1505 1505 } 1506 1506 } 1507 if (config _present == present) {1507 if (configPresent == present) { 1508 1508 switch(argv[argptr-1][1]) { 1509 1509 case 'M': … … 1627 1627 start = clock(); 1628 1628 LinkedCell LCList(mol, atof(argv[argptr])*2.); 1629 Find _non_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr+1], atof(argv[argptr]));1629 FindNonConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr+1], atof(argv[argptr])); 1630 1630 //FindDistributionOfEllipsoids((ofstream *)&cout, &T, &LCList, N, number, filename.c_str()); 1631 1631 end = clock(); … … 1871 1871 cout << Verbose(1) << "Storing tecplot data in " << argv[argptr] << "." << endl; 1872 1872 LinkedCell LCList(mol, 10.); 1873 //Find _convex_border((ofstream *)&cout, mol, &LCList, argv[argptr]);1874 Find _non_convex_border((ofstream *)&cout, mol, &LCList, argv[argptr], 10.);1873 //FindConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr]); 1874 FindNonConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr], 10.); 1875 1875 1876 1876 double volumedifference = ConvexizeNonconvexEnvelope((ofstream *)&cout, mol->TesselStruct, mol, argv[argptr]); -
src/tesselation.cpp
r093645 rf1cccd 218 218 return true; 219 219 } 220 double angle = getAngle(helper[0], helper[1], BaseLineNormal);220 double angle = GetAngle(helper[0], helper[1], BaseLineNormal); 221 221 if ((angle - M_PI) > -MYEPSILON) 222 222 return true; … … 1398 1398 1399 1399 1400 /** Finds the starting triangle for find_non_convex_border().1401 * Looks at the outermost point per axis, then Find _second_point_for_Tesselation()1402 * for the second and Find _next_suitable_point_via_Angle_of_Sphere() for the third1400 /** Finds the starting triangle for FindNonConvexBorder(). 1401 * Looks at the outermost point per axis, then FindSecondPointForTesselation() 1402 * for the second and FindNextSuitablePointViaAngleOfSphere() for the third 1403 1403 * point are called. 1404 1404 * \param *out output stream for debugging … … 1406 1406 * \param *LC LinkedCell structure with neighbouring TesselPoint's 1407 1407 */ 1408 void Tesselation::Find _starting_triangle(ofstream *out, const double RADIUS, LinkedCell *LC)1409 { 1410 cout << Verbose(1) << "Begin of Find _starting_triangle\n";1408 void Tesselation::FindStartingTriangle(ofstream *out, const double RADIUS, LinkedCell *LC) 1409 { 1410 cout << Verbose(1) << "Begin of FindStartingTriangle\n"; 1411 1411 int i = 0; 1412 1412 LinkedNodes *List = NULL; … … 1414 1414 TesselPoint* SecondPoint = NULL; 1415 1415 TesselPoint* MaxPoint[NDIM]; 1416 double max _coordinate[NDIM];1416 double maxCoordinate[NDIM]; 1417 1417 Vector Oben; 1418 1418 Vector helper; … … 1424 1424 for (i = 0; i < 3; i++) { 1425 1425 MaxPoint[i] = NULL; 1426 max _coordinate[i] = -1;1426 maxCoordinate[i] = -1; 1427 1427 } 1428 1428 … … 1436 1436 if (List != NULL) { 1437 1437 for (LinkedNodes::iterator Runner = List->begin();Runner != List->end();Runner++) { 1438 if ((*Runner)->node->x[i] > max _coordinate[i]) {1438 if ((*Runner)->node->x[i] > maxCoordinate[i]) { 1439 1439 cout << Verbose(2) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl; 1440 max _coordinate[i] = (*Runner)->node->x[i];1440 maxCoordinate[i] = (*Runner)->node->x[i]; 1441 1441 MaxPoint[i] = (*Runner); 1442 1442 } … … 1454 1454 1455 1455 BTS = NULL; 1456 CandidateList *Opt _Candidates = new CandidateList();1456 CandidateList *OptCandidates = new CandidateList(); 1457 1457 for (int k=0;k<NDIM;k++) { 1458 1458 Oben.x[k] = 1.; … … 1461 1461 1462 1462 double ShortestAngle; 1463 TesselPoint* Opt _Candidate = NULL;1463 TesselPoint* OptCandidate = NULL; 1464 1464 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. 1465 1465 1466 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_...1467 SecondPoint = Opt _Candidate;1466 FindSecondPointForTesselation(FirstPoint, NULL, Oben, OptCandidate, &ShortestAngle, RADIUS, LC); // we give same point as next candidate as its bonds are looked into in find_second_... 1467 SecondPoint = OptCandidate; 1468 1468 if (SecondPoint == NULL) // have we found a second point? 1469 1469 continue; … … 1496 1496 1497 1497 //cout << Verbose(2) << "INFO: OldSphereCenter is at " << helper << ".\n"; 1498 Find _third_point_for_Tesselation(1499 Oben, SearchDirection, helper, BLS[0], NULL, *&Opt _Candidates, &ShortestAngle, RADIUS, LC1498 FindThirdPointForTesselation( 1499 Oben, SearchDirection, helper, BLS[0], NULL, *&OptCandidates, &ShortestAngle, RADIUS, LC 1500 1500 ); 1501 1501 cout << Verbose(1) << "List of third Points is "; 1502 for (CandidateList::iterator it = Opt _Candidates->begin(); it != Opt_Candidates->end(); ++it) {1502 for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) { 1503 1503 cout << " " << *(*it)->point; 1504 1504 } 1505 1505 cout << endl; 1506 1506 1507 for (CandidateList::iterator it = Opt _Candidates->begin(); it != Opt_Candidates->end(); ++it) {1507 for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) { 1508 1508 // add third triangle point 1509 1509 AddTesselationPoint((*it)->point, 2); … … 1522 1522 1523 1523 // if we do not reach the end with the next step of iteration, we need to setup a new first line 1524 if (it != Opt _Candidates->end()--) {1524 if (it != OptCandidates->end()--) { 1525 1525 FirstPoint = (*it)->BaseLine->endpoints[0]->node; 1526 1526 SecondPoint = (*it)->point; … … 1537 1537 // remove all candidates from the list and then the list itself 1538 1538 class CandidateForTesselation *remover = NULL; 1539 for (CandidateList::iterator it = Opt _Candidates->begin(); it != Opt_Candidates->end(); ++it) {1539 for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) { 1540 1540 remover = *it; 1541 1541 delete(remover); 1542 1542 } 1543 Opt _Candidates->clear();1543 OptCandidates->clear(); 1544 1544 } 1545 1545 } … … 1547 1547 // remove all candidates from the list and then the list itself 1548 1548 class CandidateForTesselation *remover = NULL; 1549 for (CandidateList::iterator it = Opt _Candidates->begin(); it != Opt_Candidates->end(); ++it) {1549 for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) { 1550 1550 remover = *it; 1551 1551 delete(remover); 1552 1552 } 1553 delete(Opt _Candidates);1554 cout << Verbose(1) << "End of Find _starting_triangle\n";1553 delete(OptCandidates); 1554 cout << Verbose(1) << "End of FindStartingTriangle\n"; 1555 1555 }; 1556 1556 … … 1564 1564 * @param *LC LinkedCell structure with neighbouring points 1565 1565 */ 1566 bool Tesselation::Find _next_suitable_triangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC)1567 { 1568 cout << Verbose(0) << "Begin of Find _next_suitable_triangle\n";1566 bool Tesselation::FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC) 1567 { 1568 cout << Verbose(0) << "Begin of FindNextSuitableTriangle\n"; 1569 1569 bool result = true; 1570 CandidateList *Opt _Candidates = new CandidateList();1570 CandidateList *OptCandidates = new CandidateList(); 1571 1571 1572 1572 Vector CircleCenter; … … 1625 1625 1626 1626 // add third point 1627 Find _third_point_for_Tesselation(1628 T.NormalVector, SearchDirection, OldSphereCenter, &Line, ThirdNode, Opt _Candidates,1627 FindThirdPointForTesselation( 1628 T.NormalVector, SearchDirection, OldSphereCenter, &Line, ThirdNode, OptCandidates, 1629 1629 &ShortestAngle, RADIUS, LC 1630 1630 ); … … 1634 1634 } 1635 1635 1636 if (Opt _Candidates->begin() == Opt_Candidates->end()) {1636 if (OptCandidates->begin() == OptCandidates->end()) { 1637 1637 cerr << "WARNING: Could not find a suitable candidate." << endl; 1638 1638 return false; 1639 1639 } 1640 1640 cout << Verbose(1) << "Third Points are "; 1641 for (CandidateList::iterator it = Opt _Candidates->begin(); it != Opt_Candidates->end(); ++it) {1641 for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) { 1642 1642 cout << " " << *(*it)->point; 1643 1643 } … … 1645 1645 1646 1646 BoundaryLineSet *BaseRay = &Line; 1647 for (CandidateList::iterator it = Opt _Candidates->begin(); it != Opt_Candidates->end(); ++it) {1647 for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) { 1648 1648 cout << Verbose(1) << " Third point candidate is " << *(*it)->point 1649 1649 << " with circumsphere's center at " << (*it)->OptCenter << "." << endl; … … 1664 1664 AddTesselationPoint(BaseRay->endpoints[1]->node, 2); 1665 1665 1666 if (CheckLineCriteria forDegeneratedTriangle(TPS)) {1666 if (CheckLineCriteriaForDegeneratedTriangle(TPS)) { 1667 1667 AddTesselationLine(TPS[0], TPS[1], 0); 1668 1668 AddTesselationLine(TPS[0], TPS[2], 1); … … 1693 1693 // 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) 1694 1694 // i.e. at least one of the three lines must be present with TriangleCount <= 1 1695 if (CheckLineCriteria forDegeneratedTriangle(TPS)) {1695 if (CheckLineCriteriaForDegeneratedTriangle(TPS)) { 1696 1696 AddTesselationLine(TPS[0], TPS[1], 0); 1697 1697 AddTesselationLine(TPS[0], TPS[2], 1); … … 1731 1731 // remove all candidates from the list and then the list itself 1732 1732 class CandidateForTesselation *remover = NULL; 1733 for (CandidateList::iterator it = Opt _Candidates->begin(); it != Opt_Candidates->end(); ++it) {1733 for (CandidateList::iterator it = OptCandidates->begin(); it != OptCandidates->end(); ++it) { 1734 1734 remover = *it; 1735 1735 delete(remover); 1736 1736 } 1737 delete(Opt _Candidates);1738 cout << Verbose(0) << "End of Find _next_suitable_triangle\n";1737 delete(OptCandidates); 1738 cout << Verbose(0) << "End of FindNextSuitableTriangle\n"; 1739 1739 return result; 1740 1740 }; … … 2012 2012 * \param *Candidate pointer to candidate node on return 2013 2013 * \param Oben vector indicating the outside 2014 * \param Opt _Candidate reference to recommended candidate on return2014 * \param OptCandidate reference to recommended candidate on return 2015 2015 * \param Storage[3] array storing angles and other candidate information 2016 2016 * \param RADIUS radius of virtual sphere 2017 2017 * \param *LC LinkedCell structure with neighbouring points 2018 2018 */ 2019 void Tesselation::Find _second_point_for_Tesselation(TesselPoint* a, TesselPoint* Candidate, Vector Oben, TesselPoint*& Opt_Candidate, double Storage[3], double RADIUS, LinkedCell *LC)2020 { 2021 cout << Verbose(2) << "Begin of Find _second_point_for_Tesselation" << endl;2019 void Tesselation::FindSecondPointForTesselation(TesselPoint* a, TesselPoint* Candidate, Vector Oben, TesselPoint*& OptCandidate, double Storage[3], double RADIUS, LinkedCell *LC) 2020 { 2021 cout << Verbose(2) << "Begin of FindSecondPointForTesselation" << endl; 2022 2022 Vector AngleCheck; 2023 2023 double norm = -1., angle; … … 2057 2057 if (a != Candidate) { 2058 2058 // Calculate center of the circle with radius RADIUS through points a and Candidate 2059 Vector OrthogonalizedOben, a _Candidate, Center;2059 Vector OrthogonalizedOben, aCandidate, Center; 2060 2060 double distance, scaleFactor; 2061 2061 2062 2062 OrthogonalizedOben.CopyVector(&Oben); 2063 a _Candidate.CopyVector(a->node);2064 a _Candidate.SubtractVector(Candidate->node);2065 OrthogonalizedOben.ProjectOntoPlane(&a _Candidate);2063 aCandidate.CopyVector(a->node); 2064 aCandidate.SubtractVector(Candidate->node); 2065 OrthogonalizedOben.ProjectOntoPlane(&aCandidate); 2066 2066 OrthogonalizedOben.Normalize(); 2067 distance = 0.5 * a _Candidate.Norm();2067 distance = 0.5 * aCandidate.Norm(); 2068 2068 scaleFactor = sqrt(((RADIUS * RADIUS) - (distance * distance))); 2069 2069 OrthogonalizedOben.Scale(scaleFactor); … … 2076 2076 AngleCheck.CopyVector(&Center); 2077 2077 AngleCheck.SubtractVector(a->node); 2078 norm = a _Candidate.Norm();2078 norm = aCandidate.Norm(); 2079 2079 // second point shall have smallest angle with respect to Oben vector 2080 2080 if (norm < RADIUS*2.) { … … 2083 2083 //cout << Verbose(3) << "Old values of Storage: %lf %lf \n", Storage[0], Storage[1]); 2084 2084 cout << Verbose(3) << "Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".\n"; 2085 Opt _Candidate = Candidate;2085 OptCandidate = Candidate; 2086 2086 Storage[0] = angle; 2087 2087 //cout << Verbose(3) << "Changing something in Storage: %lf %lf. \n", Storage[0], Storage[2]); 2088 2088 } else { 2089 //cout << Verbose(3) << "Current candidate is " << *Candidate << ": Looses with angle " << angle << " to a better candidate " << *Opt _Candidate << endl;2089 //cout << Verbose(3) << "Current candidate is " << *Candidate << ": Looses with angle " << angle << " to a better candidate " << *OptCandidate << endl; 2090 2090 } 2091 2091 } else { … … 2100 2100 } 2101 2101 } 2102 cout << Verbose(2) << "End of Find _second_point_for_Tesselation" << endl;2102 cout << Verbose(2) << "End of FindSecondPointForTesselation" << endl; 2103 2103 }; 2104 2104 … … 2126 2126 * holds. Then, the normalized projection onto the SearchDirection is either +1 or -1 and thus states whether 2127 2127 * the angle is uniquely in either (0,M_PI] or [M_PI, 2.*M_PI). 2128 * @param NormalVector normal direction of the base triangle (here the unit axis vector, \sa Find _starting_triangle())2128 * @param NormalVector normal direction of the base triangle (here the unit axis vector, \sa FindStartingTriangle()) 2129 2129 * @param SearchDirection general direction where to search for the next point, relative to center of BaseLine 2130 2130 * @param OldSphereCenter center of sphere for base triangle, relative to center of BaseLine, giving null angle for the parameter circle … … 2132 2132 * @param ThirdNode third point to avoid in search 2133 2133 * @param candidates list of equally good candidates to return 2134 * @param ShortestAngle the current path length on this circle band for the current Opt _Candidate2134 * @param ShortestAngle the current path length on this circle band for the current OptCandidate 2135 2135 * @param RADIUS radius of sphere 2136 2136 * @param *LC LinkedCell structure with neighbouring points 2137 2137 */ 2138 void 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)2138 void Tesselation::FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, LinkedCell *LC) 2139 2139 { 2140 2140 Vector CircleCenter; // center of the circle, i.e. of the band of sphere's centers … … 2153 2153 CandidateForTesselation *optCandidate = NULL; 2154 2154 2155 cout << Verbose(1) << "Begin of Find _third_point_for_Tesselation" << endl;2155 cout << Verbose(1) << "Begin of FindThirdPointForTesselation" << endl; 2156 2156 2157 2157 //cout << Verbose(2) << "INFO: NormalVector of BaseTriangle is " << NormalVector << "." << endl; … … 2310 2310 if (candidates->size() > 1) { 2311 2311 candidates->unique(); 2312 candidates->sort( sortCandidates);2313 } 2314 2315 cout << Verbose(1) << "End of Find _third_point_for_Tesselation" << endl;2312 candidates->sort(SortCandidates); 2313 } 2314 2315 cout << Verbose(1) << "End of FindThirdPointForTesselation" << endl; 2316 2316 }; 2317 2317 … … 2362 2362 } 2363 2363 2364 trianglePoints[0] = findClosestPoint(x, SecondPoint, LC);2364 trianglePoints[0] = FindClosestPoint(x, SecondPoint, LC); 2365 2365 2366 2366 // check whether closest point is "too close" :), then it's inside … … 2373 2373 return NULL; 2374 2374 } 2375 list<TesselPoint*> *connectedPoints = getCircleOfConnectedPoints(out, trianglePoints[0]);2376 list<TesselPoint*> *connectedClosestPoints = getNeighboursonCircleofConnectedPoints(out, connectedPoints, trianglePoints[0], x);2375 list<TesselPoint*> *connectedPoints = GetCircleOfConnectedPoints(out, trianglePoints[0]); 2376 list<TesselPoint*> *connectedClosestPoints = GetNeighboursOnCircleOfConnectedPoints(out, connectedPoints, trianglePoints[0], x); 2377 2377 delete(connectedPoints); 2378 2378 trianglePoints[1] = connectedClosestPoints->front(); … … 2462 2462 * @return list of the all points linked to the provided one 2463 2463 */ 2464 list<TesselPoint*> * Tesselation:: getCircleOfConnectedPoints(ofstream *out, TesselPoint* Point)2464 list<TesselPoint*> * Tesselation::GetCircleOfConnectedPoints(ofstream *out, TesselPoint* Point) 2465 2465 { 2466 2466 list<TesselPoint*> *connectedPoints = new list<TesselPoint*>; … … 2523 2523 * @return list of the two points linked to the provided one and closest to the point to be checked, 2524 2524 */ 2525 list<TesselPoint*> * Tesselation:: getNeighboursonCircleofConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference)2525 list<TesselPoint*> * Tesselation::GetNeighboursOnCircleOfConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference) 2526 2526 { 2527 2527 map<double, TesselPoint*> anglesOfPoints; … … 2562 2562 helper.SubtractVector(Point->node); 2563 2563 helper.ProjectOntoPlane(&PlaneNormal); 2564 double angle = getAngle(helper, AngleZero, OrthogonalVector);2564 double angle = GetAngle(helper, AngleZero, OrthogonalVector); 2565 2565 *out << Verbose(2) << "INFO: Calculated angle is " << angle << " for point " << **listRunner << "." << endl; 2566 2566 anglesOfPoints.insert(pair<double, TesselPoint*>(angle, (*listRunner))); … … 2603 2603 return 0.; 2604 2604 } 2605 list<TesselPoint*> *CircleofPoints = getCircleOfConnectedPoints(out, point->node);2605 list<TesselPoint*> *CircleofPoints = GetCircleOfConnectedPoints(out, point->node); 2606 2606 2607 2607 // remove all triangles … … 2672 2672 * \return true - there is such a line (i.e. creation of degenerated triangle is valid), false - no such line (don't create) 2673 2673 */ 2674 bool CheckLineCriteria forDegeneratedTriangle(class BoundaryPointSet *nodes[3])2674 bool CheckLineCriteriaForDegeneratedTriangle(class BoundaryPointSet *nodes[3]) 2675 2675 { 2676 2676 bool result = false; … … 2706 2706 /** Sort function for the candidate list. 2707 2707 */ 2708 bool sortCandidates(CandidateForTesselation* candidate1, CandidateForTesselation* candidate2)2708 bool SortCandidates(CandidateForTesselation* candidate1, CandidateForTesselation* candidate2) 2709 2709 { 2710 2710 Vector BaseLineVector, OrthogonalVector, helper; … … 2756 2756 * @return point which is second closest to the provided one 2757 2757 */ 2758 TesselPoint* findSecondClosestPoint(const Vector* Point, LinkedCell* LC)2758 TesselPoint* FindSecondClosestPoint(const Vector* Point, LinkedCell* LC) 2759 2759 { 2760 2760 LinkedNodes *List = NULL; … … 2813 2813 * @return point which is closest to the provided one, NULL if none found 2814 2814 */ 2815 TesselPoint* findClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC)2815 TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC) 2816 2816 { 2817 2817 LinkedNodes *List = NULL; … … 2936 2936 * @return angle between point and reference 2937 2937 */ 2938 double getAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector)2938 double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector) 2939 2939 { 2940 2940 if (reference.IsNull()) -
src/tesselation.hpp
r093645 rf1cccd 203 203 204 204 // concave envelope 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);205 void FindStartingTriangle(ofstream *out, const double RADIUS, class LinkedCell *LC); 206 void FindSecondPointForTesselation(class TesselPoint* a, class TesselPoint* Candidate, Vector Oben, class TesselPoint*& OptCandidate, double Storage[3], double RADIUS, class LinkedCell *LC); 207 void FindThirdPointForTesselation(Vector NormalVector, Vector SearchDirection, Vector OldSphereCenter, class BoundaryLineSet *BaseLine, class TesselPoint *ThirdNode, CandidateList* &candidates, double *ShortestAngle, const double RADIUS, class LinkedCell *LC); 208 bool FindNextSuitableTriangle(ofstream *out, BoundaryLineSet &Line, BoundaryTriangleSet &T, const double& RADIUS, int N, LinkedCell *LC); 209 209 int CheckPresenceOfTriangle(ofstream *out, class TesselPoint *Candidates[3]); 210 210 … … 219 219 220 220 221 list<TesselPoint*> * getCircleOfConnectedPoints(ofstream *out, TesselPoint* Point);222 list<TesselPoint*> * getNeighboursonCircleofConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference);221 list<TesselPoint*> * GetCircleOfConnectedPoints(ofstream *out, TesselPoint* Point); 222 list<TesselPoint*> * GetNeighboursOnCircleOfConnectedPoints(ofstream *out, list<TesselPoint*> *connectedPoints, TesselPoint* Point, Vector* Reference); 223 223 list<BoundaryTriangleSet*> *FindTriangles(TesselPoint* Points[3]); 224 224 list<BoundaryTriangleSet*> * FindClosestTrianglesToPoint(ofstream *out, Vector *x, LinkedCell* LC); … … 256 256 }; 257 257 258 bool CheckLineCriteria forDegeneratedTriangle(class BoundaryPointSet *nodes[3]);259 bool sortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2);260 TesselPoint* findClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC);261 TesselPoint* findSecondClosestPoint(const Vector*, LinkedCell*);262 double getAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector);258 bool CheckLineCriteriaForDegeneratedTriangle(class BoundaryPointSet *nodes[3]); 259 bool SortCandidates(class CandidateForTesselation* candidate1, class CandidateForTesselation* candidate2); 260 TesselPoint* FindClosestPoint(const Vector* Point, TesselPoint *&SecondPoint, LinkedCell* LC); 261 TesselPoint* FindSecondClosestPoint(const Vector*, LinkedCell*); 262 double GetAngle(const Vector &point, const Vector &reference, const Vector OrthogonalVector); 263 263 Vector * GetClosestPointBetweenLine(ofstream *out, class BoundaryLineSet *Base, class BoundaryLineSet *OtherBase); 264 264 -
src/tesselationhelpers.cpp
r093645 rf1cccd 8 8 #include "tesselationhelpers.hpp" 9 9 10 double det_get(gsl_matrix *A, int inPlace) {10 double DetGet(gsl_matrix *A, int inPlace) { 11 11 /* 12 12 inPlace = 1 => A is replaced with the LU decomposed copy. … … 36 36 }; 37 37 38 void get_sphere(Vector *center, Vector &a, Vector &b, Vector &c, double RADIUS)38 void GetSphere(Vector *center, Vector &a, Vector &b, Vector &c, double RADIUS) 39 39 { 40 40 gsl_matrix *A = gsl_matrix_calloc(3,3); … … 46 46 gsl_matrix_set(A, i, 2, c.x[i]); 47 47 } 48 m11 = det_get(A, 1);48 m11 = DetGet(A, 1); 49 49 50 50 for(int i=0;i<3;i++) { … … 53 53 gsl_matrix_set(A, i, 2, c.x[i]); 54 54 } 55 m12 = det_get(A, 1);55 m12 = DetGet(A, 1); 56 56 57 57 for(int i=0;i<3;i++) { … … 60 60 gsl_matrix_set(A, i, 2, c.x[i]); 61 61 } 62 m13 = det_get(A, 1);62 m13 = DetGet(A, 1); 63 63 64 64 for(int i=0;i<3;i++) { … … 67 67 gsl_matrix_set(A, i, 2, b.x[i]); 68 68 } 69 m14 = det_get(A, 1);69 m14 = DetGet(A, 1); 70 70 71 71 if (fabs(m11) < MYEPSILON) … … 101 101 * @param Umkreisradius double radius of circumscribing circle 102 102 */ 103 void Get _center_of_sphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector* AlternativeDirection,103 void GetCenterOfSphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector* AlternativeDirection, 104 104 double HalfplaneIndicator, double AlternativeIndicator, double alpha, double beta, double gamma, double RADIUS, double Umkreisradius) 105 105 { … … 107 107 double Restradius; 108 108 Vector OtherCenter; 109 cout << Verbose(3) << "Begin of Get _center_of_sphere.\n";109 cout << Verbose(3) << "Begin of GetCenterOfSphere.\n"; 110 110 Center->Zero(); 111 111 helper.CopyVector(&a); … … 153 153 Center->AddVector(&TempNormal); 154 154 cout << Verbose(0) << "Center of sphere of circumference is " << *Center << ".\n"; 155 get_sphere(&OtherCenter, a, b, c, RADIUS);155 GetSphere(&OtherCenter, a, b, c, RADIUS); 156 156 cout << Verbose(0) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n"; 157 cout << Verbose(3) << "End of Get _center_of_sphere.\n";157 cout << Verbose(3) << "End of GetCenterOfSphere.\n"; 158 158 }; 159 159 … … 307 307 gsl_multimin_fminimizer *s = NULL; 308 308 gsl_vector *ss, *x; 309 gsl_multimin_function minex _func;309 gsl_multimin_function minexFunction; 310 310 311 311 size_t iter = 0; … … 324 324 325 325 /* Initialize method and iterate */ 326 minex _func.n = NDIM;327 minex _func.f = &MinIntersectDistance;328 minex _func.params = (void *)∥326 minexFunction.n = NDIM; 327 minexFunction.f = &MinIntersectDistance; 328 minexFunction.params = (void *)∥ 329 329 330 330 s = gsl_multimin_fminimizer_alloc(T, NDIM); 331 gsl_multimin_fminimizer_set(s, &minex _func, x, ss);331 gsl_multimin_fminimizer_set(s, &minexFunction, x, ss); 332 332 333 333 do { -
src/tesselationhelpers.hpp
r093645 rf1cccd 28 28 #include "vector.hpp" 29 29 30 double det_get(gsl_matrix *A, int inPlace);31 void get_sphere(Vector *center, Vector &a, Vector &b, Vector &c, double RADIUS);32 void 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);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); 33 33 void GetCenterofCircumcircle(Vector *Center, Vector *a, Vector *b, Vector *c); 34 34 double GetPathLengthonCircumCircle(Vector &CircleCenter, Vector &CirclePlaneNormal, double CircleRadius, Vector &NewSphereCenter, Vector &OldSphereCenter, Vector &NormalVector, Vector &SearchDirection); … … 36 36 bool existsIntersection(Vector point1, Vector point2, Vector point3, Vector point4); 37 37 38 //bool Choose_preferable_third_point(atom *Candidate, atom *OptCandidate, class BoundaryLineSet *BaseLine, atom *ThirdNode, Tesselation *Tess);39 40 41 38 #endif /* TESSELATIONHELPERS_HPP_ */
Note:
See TracChangeset
for help on using the changeset viewer.