Changeset 47d041 for src/Tesselation/BoundaryTriangleSet.cpp
- Timestamp:
- Nov 3, 2011, 7:44:01 PM (13 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:
- 41a467
- Parents:
- 50e4e5
- git-author:
- Frederik Heber <heber@…> (10/27/11 11:53:58)
- git-committer:
- Frederik Heber <heber@…> (11/03/11 19:44:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tesselation/BoundaryTriangleSet.cpp
r50e4e5 r47d041 79 79 // set endpoints 80 80 int Counter = 0; 81 DoLog(0) && (Log() << Verbose(0) << "New triangle " << Nr << " with end points: " << endl);81 LOG(0, "New triangle " << Nr << " with end points: "); 82 82 for (PointMap::iterator runner = OrderMap.begin(); runner != OrderMap.end(); runner++) { 83 83 endpoints[Counter] = runner->second; 84 DoLog(0) && (Log() << Verbose(0) << " " << *endpoints[Counter] << endl);84 LOG(0, " " << *endpoints[Counter]); 85 85 Counter++; 86 86 } … … 99 99 if (lines[i] != NULL) { 100 100 if (lines[i]->triangles.erase(Nr)) { 101 //L og() << Verbose(0) << "Triangle Nr." << Nr << " erased in line " << *lines[i] << "." << endl;101 //LOG(0, "Triangle Nr." << Nr << " erased in line " << *lines[i] << "."); 102 102 } 103 103 if (lines[i]->triangles.empty()) { 104 //L og() << Verbose(0) << *lines[i] << " is no more attached to any triangle, erasing." << endl;104 //LOG(0, *lines[i] << " is no more attached to any triangle, erasing."); 105 105 delete (lines[i]); 106 106 lines[i] = NULL; … … 108 108 } 109 109 } 110 //L og() << Verbose(0) << "Erasing triangle Nr." << Nr << " itself." << endl;110 //LOG(0, "Erasing triangle Nr." << Nr << " itself."); 111 111 } 112 112 ; … … 127 127 if (NormalVector.ScalarProduct(OtherVector) > 0.) 128 128 NormalVector.Scale(-1.); 129 DoLog(1) && (Log() << Verbose(1) << "Normal Vector is " << NormalVector << "." << endl);129 LOG(1, "Normal Vector is " << NormalVector << "."); 130 130 } 131 131 ; … … 154 154 Intersection = Plane(NormalVector, (endpoints[0]->node->getPosition())).GetIntersection(centerLine); 155 155 156 DoLog(1) && (Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl);157 DoLog(1) && (Log() << Verbose(1) << "INFO: Line is from " << MolCenter << " to " << x << "." << endl);158 DoLog(1) && (Log() << Verbose(1) << "INFO: Intersection is " << Intersection << "." << endl);156 LOG(1, "INFO: Triangle is " << *this << "."); 157 LOG(1, "INFO: Line is from " << MolCenter << " to " << x << "."); 158 LOG(1, "INFO: Intersection is " << Intersection << "."); 159 159 160 160 if (Intersection.DistanceSquared(endpoints[0]->node->getPosition()) < MYEPSILON) { 161 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl);161 LOG(1, "Intersection coindices with first endpoint."); 162 162 return true; 163 163 } else if (Intersection.DistanceSquared(endpoints[1]->node->getPosition()) < MYEPSILON) { 164 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl);164 LOG(1, "Intersection coindices with second endpoint."); 165 165 return true; 166 166 } else if (Intersection.DistanceSquared(endpoints[2]->node->getPosition()) < MYEPSILON) { 167 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl);167 LOG(1, "Intersection coindices with third endpoint."); 168 168 return true; 169 169 } … … 177 177 CrossPoint -= (endpoints[i%3]->node->getPosition()); // cross point was returned as absolute vector 178 178 const double s = CrossPoint.ScalarProduct(helper)/helper.NormSquared(); 179 DoLog(1) && (Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl);179 LOG(1, "INFO: Factor s is " << s << "."); 180 180 if ((s < -MYEPSILON) || ((s-1.) > MYEPSILON)) { 181 DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl);181 LOG(1, "INFO: Crosspoint " << CrossPoint << "outside of triangle."); 182 182 return false; 183 183 } 184 184 i++; 185 185 } while (i < 3); 186 DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl);186 LOG(1, "INFO: Crosspoint " << CrossPoint << " inside of triangle."); 187 187 return true; 188 188 } 189 189 catch (LinearAlgebraException &excp) { 190 L og() << Verbose(1) << boost::diagnostic_information(excp);191 DoeLog(1) && (eLog() << Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl);190 LOG(1, boost::diagnostic_information(excp)); 191 ELOG(1, "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!"); 192 192 return false; 193 193 } … … 213 213 214 214 // 1. get intersection with plane 215 DoLog(1) && (Log() << Verbose(1) << "INFO: Looking for closest point of triangle " << *this << " to " << x << "." << endl);215 LOG(1, "INFO: Looking for closest point of triangle " << *this << " to " << x << "."); 216 216 GetCenter(Direction); 217 217 try { … … 228 228 InPlane += ClosestPoint; 229 229 230 DoLog(2) && (Log() << Verbose(2) << "INFO: Triangle is " << *this << "." << endl);231 DoLog(2) && (Log() << Verbose(2) << "INFO: Line is from " << Direction << " to " << x << "." << endl);232 DoLog(2) && (Log() << Verbose(2) << "INFO: In-plane part is " << InPlane << "." << endl);230 LOG(2, "INFO: Triangle is " << *this << "."); 231 LOG(2, "INFO: Line is from " << Direction << " to " << x << "."); 232 LOG(2, "INFO: In-plane part is " << InPlane << "."); 233 233 234 234 // Calculate cross point between one baseline and the desired point such that distance is shortest … … 247 247 CrossPoint[i] -= (endpoints[i%3]->node->getPosition()); // cross point was returned as absolute vector 248 248 const double s = CrossPoint[i].ScalarProduct(Direction)/Direction.NormSquared(); 249 DoLog(2) && (Log() << Verbose(2) << "INFO: Factor s is " << s << "." << endl);249 LOG(2, "INFO: Factor s is " << s << "."); 250 250 if ((s >= -MYEPSILON) && ((s-1.) <= MYEPSILON)) { 251 251 CrossPoint[i] += (endpoints[i%3]->node->getPosition()); // make cross point absolute again 252 DoLog(2) && (Log() << Verbose(2) << "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << endpoints[i % 3]->node->getPosition() << " and " << endpoints[(i + 1) % 3]->node->getPosition() << "." << endl);252 LOG(2, "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << endpoints[i % 3]->node->getPosition() << " and " << endpoints[(i + 1) % 3]->node->getPosition() << "."); 253 253 const double distance = CrossPoint[i].DistanceSquared(x); 254 254 if ((ShortestDistance < 0.) || (ShortestDistance > distance)) { … … 279 279 } 280 280 } 281 DoLog(1) && (Log() << Verbose(1) << "INFO: Closest Point is " << ClosestPoint << " with shortest squared distance is " << ShortestDistance << "." << endl);281 LOG(1, "INFO: Closest Point is " << ClosestPoint << " with shortest squared distance is " << ShortestDistance << "."); 282 282 return ShortestDistance; 283 283 } … … 333 333 { 334 334 Info FunctionInfo(__func__); 335 DoLog(1) && (Log() << Verbose(1) << "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "." << endl);335 LOG(1, "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "."); 336 336 return (((endpoints[0] == Points[0]) || (endpoints[0] == Points[1]) || (endpoints[0] == Points[2])) && ((endpoints[1] == Points[0]) || (endpoints[1] == Points[1]) || (endpoints[1] == Points[2])) && ((endpoints[2] == Points[0]) || (endpoints[2] == Points[1]) || (endpoints[2] == Points[2]) 337 337 … … 400 400 (center) += (endpoints[i]->node->getPosition()); 401 401 center.Scale(1. / 3.); 402 DoLog(1) && (Log() << Verbose(1) << "INFO: Center is at " << center << "." << endl);402 LOG(1, "INFO: Center is at " << center << "."); 403 403 } 404 404
Note:
See TracChangeset
for help on using the changeset viewer.