Changeset 7b36fe for src/vector.cpp


Ignore:
Timestamp:
Jan 14, 2010, 5:32:47 PM (15 years ago)
Author:
Frederik Heber <heber@…>
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:
9473f6
Parents:
48b47a
Message:

Changed verbosity for Vector::GetIntersectionWithPlane().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/vector.cpp

    r48b47a r7b36fe  
    222222 * \param *Origin first vector of line
    223223 * \param *LineVector second vector of line
    224  * \return true -  \a this contains intersection point on return, false - line is parallel to plane
     224 * \return true -  \a this contains intersection point on return, false - line is parallel to plane (even if in-plane)
    225225 */
    226226bool Vector::GetIntersectionWithPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset, const Vector * const Origin, const Vector * const LineVector)
     
    235235  Direction.Normalize();
    236236  Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl;
     237  //Log() << Verbose(1) << "INFO: PlaneNormal is " << *PlaneNormal << " and PlaneOffset is " << *PlaneOffset << "." << endl;
    237238  factor = Direction.ScalarProduct(PlaneNormal);
    238   if (factor < MYEPSILON) { // Uniqueness: line parallel to plane?
    239     eLog() << Verbose(2) << "Line is parallel to plane, no intersection." << endl;
     239  if (fabs(factor) < MYEPSILON) { // Uniqueness: line parallel to plane?
     240    Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl;
    240241    return false;
    241242  }
     
    243244  helper.SubtractVector(Origin);
    244245  factor = helper.ScalarProduct(PlaneNormal)/factor;
    245   if (factor < MYEPSILON) { // Origin is in-plane
    246     Log() << Verbose(1) << "Origin of line is in-plane, simple." << endl;
     246  if (fabs(factor) < MYEPSILON) { // Origin is in-plane
     247    Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl;
    247248    CopyVector(Origin);
    248249    return true;
     
    258259  helper.SubtractVector(PlaneOffset);
    259260  if (helper.ScalarProduct(PlaneNormal) < MYEPSILON) {
    260     Log() << Verbose(1) << "INFO: Intersection at " << *this << " is good." << endl;
     261    Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl;
    261262    return true;
    262263  } else {
     
    353354  Vector parallel;
    354355  double factor = 0.;
    355   double pfactor = 0.;
    356356  if (fabs(a.ScalarProduct(&b)*a.ScalarProduct(&b)/a.NormSquared()/b.NormSquared() - 1.) < MYEPSILON) {
    357357    parallel.CopyVector(Line1a);
Note: See TracChangeset for help on using the changeset viewer.