Changeset 47d041 for src/Tesselation/BoundaryLineSet.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/BoundaryLineSet.cpp
r50e4e5 r47d041 66 66 skipped = false; 67 67 // clear triangles list 68 DoLog(0) && (Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl);68 LOG(0, "New Line with endpoints " << *this << "."); 69 69 } 70 70 ; … … 87 87 Point2->AddLine(this); // 88 88 // clear triangles list 89 DoLog(0) && (Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl);89 LOG(0, "New Line with endpoints " << *this << "."); 90 90 } 91 91 ; … … 116 116 for (LineMap::iterator Runner = erasor.first; Runner != erasor.second; Runner++) 117 117 if ((*Runner).second == this) { 118 //L og() << Verbose(0) << "Removing Line Nr. " << Nr << " in boundary point " << *endpoints[i] << "." << endl;118 //LOG(0, "Removing Line Nr. " << Nr << " in boundary point " << *endpoints[i] << "."); 119 119 endpoints[i]->lines.erase(Runner); 120 120 break; … … 122 122 } else { // there's just a single line left 123 123 if (endpoints[i]->lines.erase(Nr)) { 124 //L og() << Verbose(0) << "Removing Line Nr. " << Nr << " in boundary point " << *endpoints[i] << "." << endl;124 //LOG(0, "Removing Line Nr. " << Nr << " in boundary point " << *endpoints[i] << "."); 125 125 } 126 126 } 127 127 if (endpoints[i]->lines.empty()) { 128 //L og() << Verbose(0) << *endpoints[i] << " has no more lines it's attached to, erasing." << endl;128 //LOG(0, *endpoints[i] << " has no more lines it's attached to, erasing."); 129 129 if (endpoints[i] != NULL) { 130 130 delete (endpoints[i]); … … 135 135 } 136 136 if (!triangles.empty()) 137 DoeLog(2) && (eLog() << Verbose(2) << "Memory Leak! I " << *this << " am still connected to some triangles." << endl);137 ELOG(2, "Memory Leak! I " << *this << " am still connected to some triangles."); 138 138 } 139 139 ; … … 145 145 { 146 146 Info FunctionInfo(__func__); 147 DoLog(0) && (Log() << Verbose(0) << "Add " << triangle->Nr << " to line " << *this << "." << endl);147 LOG(0, "Add " << triangle->Nr << " to line " << *this << "."); 148 148 triangles.insert(TrianglePair(triangle->Nr, triangle)); 149 149 } … … 175 175 double angle = CalculateConvexity(); 176 176 if (angle > -MYEPSILON) { 177 DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Angle is greater than pi: convex." << endl);177 LOG(0, "ACCEPT: Angle is greater than pi: convex."); 178 178 return true; 179 179 } else { 180 DoLog(0) && (Log() << Verbose(0) << "REJECT: Angle is less than pi: concave." << endl);180 LOG(0, "REJECT: Angle is less than pi: concave."); 181 181 return false; 182 182 } … … 194 194 // get the two triangles 195 195 if (triangles.size() != 2) { 196 DoeLog(0) && (eLog() << Verbose(0) << "Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!" << endl);196 ELOG(0, "Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!"); 197 197 return true; 198 198 } 199 199 // check normal vectors 200 200 // have a normal vector on the base line pointing outwards 201 //L og() << Verbose(0) << "INFO: " << *this << " has vectors at " << *(endpoints[0]->node->node) << " and at " << *(endpoints[1]->node->node) << "." << endl;201 //LOG(0, "INFO: " << *this << " has vectors at " << *(endpoints[0]->node->node) << " and at " << *(endpoints[1]->node->node) << "."); 202 202 BaseLineCenter = (1./2.)*((endpoints[0]->node->getPosition()) + (endpoints[1]->node->getPosition())); 203 203 BaseLine = (endpoints[0]->node->getPosition()) - (endpoints[1]->node->getPosition()); 204 204 205 //L og() << Verbose(0) << "INFO: Baseline is " << BaseLine << " and its center is at " << BaseLineCenter << "." << endl;205 //LOG(0, "INFO: Baseline is " << BaseLine << " and its center is at " << BaseLineCenter << "."); 206 206 207 207 BaseLineNormal.Zero(); … … 211 211 class BoundaryPointSet *node = NULL; 212 212 for (TriangleMap::const_iterator runner = triangles.begin(); runner != triangles.end(); runner++) { 213 //L og() << Verbose(0) << "INFO: NormalVector of " << *(runner->second) << " is " << runner->second->NormalVector << "." << endl;213 //LOG(0, "INFO: NormalVector of " << *(runner->second) << " is " << runner->second->NormalVector << "."); 214 214 NormalCheck += runner->second->NormalVector; 215 215 NormalCheck *= sign; … … 218 218 BaseLineNormal = runner->second->NormalVector; // yes, copy second on top of first 219 219 else { 220 DoeLog(0) && (eLog() << Verbose(0) << "Triangle " << *runner->second << " has zero normal vector!" << endl);220 ELOG(0, "Triangle " << *runner->second << " has zero normal vector!"); 221 221 } 222 222 node = runner->second->GetThirdEndpoint(this); 223 223 if (node != NULL) { 224 //L og() << Verbose(0) << "INFO: Third node for triangle " << *(runner->second) << " is " << *node << " at " << *(node->node->node) << "." << endl;224 //LOG(0, "INFO: Third node for triangle " << *(runner->second) << " is " << *node << " at " << *(node->node->node) << "."); 225 225 helper[i] = (node->node->getPosition()) - BaseLineCenter; 226 226 helper[i].MakeNormalTo(BaseLine); // we want to compare the triangle's heights' angles! 227 //L og() << Verbose(0) << "INFO: Height vector with respect to baseline is " << helper[i] << "." << endl;227 //LOG(0, "INFO: Height vector with respect to baseline is " << helper[i] << "."); 228 228 i++; 229 229 } else { 230 DoeLog(1) && (eLog() << Verbose(1) << "I cannot find third node in triangle, something's wrong." << endl);230 ELOG(1, "I cannot find third node in triangle, something's wrong."); 231 231 return true; 232 232 } 233 233 } 234 //L og() << Verbose(0) << "INFO: BaselineNormal is " << BaseLineNormal << "." << endl;234 //LOG(0, "INFO: BaselineNormal is " << BaseLineNormal << "."); 235 235 if (NormalCheck.NormSquared() < MYEPSILON) { 236 DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Normalvectors of both triangles are the same: convex." << endl);236 LOG(0, "ACCEPT: Normalvectors of both triangles are the same: convex."); 237 237 return true; 238 238 }
Note:
See TracChangeset
for help on using the changeset viewer.