Changeset 1d9b7aa for src/boundary.cpp
- Timestamp:
- Aug 19, 2009, 2:31:29 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:
- 34e0592
- Parents:
- 99c484
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
r99c484 r1d9b7aa 624 624 625 625 // First step: RemovePointFromTesselatedSurface 626 PointRunner = TesselStruct->PointsOnBoundary.begin(); 627 PointAdvance = PointRunner; // we need an advanced point, as the PointRunner might get removed 628 while (PointRunner != TesselStruct->PointsOnBoundary.end()) { 629 PointAdvance++; 630 point = PointRunner->second; 631 *out << Verbose(1) << "INFO: Current point is " << *point << "." << endl; 632 Concavity = true; 633 for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) { 626 do { 627 Concavity = false; 628 PointRunner = TesselStruct->PointsOnBoundary.begin(); 629 PointAdvance = PointRunner; // we need an advanced point, as the PointRunner might get removed 630 while (PointRunner != TesselStruct->PointsOnBoundary.end()) { 631 PointAdvance++; 632 point = PointRunner->second; 633 *out << Verbose(1) << "INFO: Current point is " << *point << "." << endl; 634 for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) { 635 line = LineRunner->second; 636 *out << Verbose(2) << "INFO: Current line of point " << *point << " is " << *line << "." << endl; 637 } 638 if (!line->CheckConvexityCriterion(out)) { 639 *out << Verbose(1) << "... point " << *point << " cannot be on convex envelope." << endl; 640 // remove the point 641 Concavity = true; 642 TesselStruct->RemovePointFromTesselatedSurface(out, point); 643 } 644 PointRunner = PointAdvance; 645 } 646 647 //CalculateConcavityPerBoundaryPoint(out, TesselStruct); 648 //StoreTrianglesinFile(out, mol, filename, "-second"); 649 650 // second step: PickFarthestofTwoBaselines 651 LineRunner = TesselStruct->LinesOnBoundary.begin(); 652 LineAdvance = LineRunner; // we need an advanced line, as the LineRunner might get removed 653 while (LineRunner != TesselStruct->LinesOnBoundary.end()) { 654 LineAdvance++; 634 655 line = LineRunner->second; 635 *out << Verbose(2) << "INFO: Current line of point " << *point << " is " << *line << "." << endl; 636 Concavity = Concavity && (!line->CheckConvexityCriterion(out)); 637 } 638 if (Concavity) { 639 *out << Verbose(1) << "... point " << *point << " cannot be on convex envelope." << endl; 640 // remove the point 641 TesselStruct->RemovePointFromTesselatedSurface(out, point); 642 } 643 PointRunner = PointAdvance; 644 } 645 646 //CalculateConcavityPerBoundaryPoint(out, TesselStruct); 647 StoreTrianglesinFile(out, mol, filename, "-second"); 648 649 // second step: PickFarthestofTwoBaselines 650 LineRunner = TesselStruct->LinesOnBoundary.begin(); 651 LineAdvance = LineRunner; // we need an advanced line, as the LineRunner might get removed 652 while (LineRunner != TesselStruct->LinesOnBoundary.end()) { 653 LineAdvance++; 654 line = LineRunner->second; 655 *out << Verbose(1) << "INFO: Picking farthest baseline for line is " << *line << "." << endl; 656 // take highest of both lines 657 if (TesselStruct->IsConvexRectangle(out, line) == NULL) 658 TesselStruct->PickFarthestofTwoBaselines(out, line); 659 LineRunner = LineAdvance; 660 } 661 662 //CalculateConcavityPerBoundaryPoint(out, TesselStruct); 656 *out << Verbose(1) << "INFO: Picking farthest baseline for line is " << *line << "." << endl; 657 // take highest of both lines 658 if (TesselStruct->IsConvexRectangle(out, line) == NULL) { 659 TesselStruct->PickFarthestofTwoBaselines(out, line); 660 Concavity = true; 661 } 662 LineRunner = LineAdvance; 663 } 664 } while (Concavity); 665 CalculateConcavityPerBoundaryPoint(out, TesselStruct); 663 666 StoreTrianglesinFile(out, mol, filename, "-third"); 664 667 … … 670 673 line = LineRunner->second; 671 674 *out << Verbose(1) << "INFO: Current line is " << *line << "." << endl; 672 if (LineAdvance != TesselStruct->LinesOnBoundary.end())673 *out << Verbose(1) << "INFO: Next line will be " << *(LineAdvance->second) << "." << endl;675 //if (LineAdvance != TesselStruct->LinesOnBoundary.end()) 676 //*out << Verbose(1) << "INFO: Next line will be " << *(LineAdvance->second) << "." << endl; 674 677 if (!line->CheckConvexityCriterion(out)) { 675 678 *out << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl; … … 684 687 685 688 CalculateConcavityPerBoundaryPoint(out, TesselStruct); 689 StoreTrianglesinFile(out, mol, filename, "-fourth"); 686 690 687 691 // end
Note:
See TracChangeset
for help on using the changeset viewer.