Ignore:
Timestamp:
Apr 15, 2010, 10:54:26 AM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
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:
753f02
Parents:
273382
Message:

Changed implementation of Vector to forward operations to contained objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/tesselation_boundarytriangleunittest.cpp

    r273382 r1bd79e  
    8686
    8787  // simple test on y line
    88   Point.Init(-1.,0.5,0.);
    89   CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    90   Point.Init(0.,0.5,0.);
    91   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    92   Point.Init(-4.,0.5,0.);
     88  Point = Vector(-1.,0.5,0.);
     89  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     90  Point = Vector(0.,0.5,0.);
     91  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     92  Point = Vector(-4.,0.5,0.);
    9393  CPPUNIT_ASSERT_EQUAL( 16., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    94   Point.Init(0.,0.5,0.);
     94  Point = Vector(0.,0.5,0.);
    9595  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    9696
    9797  // simple test on x line
    98   Point.Init(0.5,-1.,0.);
    99   CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    100   Point.Init(0.5,0.,0.);
    101   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    102   Point.Init(0.5,-6.,0.);
     98  Point = Vector(0.5,-1.,0.);
     99  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     100  Point = Vector(0.5,0.,0.);
     101  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     102  Point = Vector(0.5,-6.,0.);
    103103  CPPUNIT_ASSERT_EQUAL( 36., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    104   Point.Init(0.5,0.,0.);
     104  Point = Vector(0.5,0.,0.);
    105105  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    106106
    107107  // simple test on slanted line
    108   Point.Init(1.,1.,0.);
     108  Point = Vector(1.,1.,0.);
    109109  CPPUNIT_ASSERT_EQUAL( 0.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    110   Point.Init(0.5,0.5,0.);
    111   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    112   Point.Init(5.,5.,0.);
     110  Point = Vector(0.5,0.5,0.);
     111  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     112  Point = Vector(5.,5.,0.);
    113113  CPPUNIT_ASSERT_EQUAL( 40.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    114   Point.Init(0.5,0.5,0.);
     114  Point = Vector(0.5,0.5,0.);
    115115  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    116116
    117117  // simple test on first node
    118   Point.Init(-1.,-1.,0.);
     118  Point = Vector(-1.,-1.,0.);
    119119  CPPUNIT_ASSERT_EQUAL( 2., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    120   Point.Init(0.,0.,0.);
     120  Point = Vector(0.,0.,0.);
    121121  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    122122
    123123  // simple test on second node
    124   Point.Init(0.,2.,0.);
    125   CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    126   Point.Init(0.,1.,0.);
     124  Point = Vector(0.,2.,0.);
     125  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     126  Point = Vector(0.,1.,0.);
    127127  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    128128
    129129  // simple test on third node
    130   Point.Init(2.,0.,0.);
    131   CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    132   Point.Init(1.,0.,0.);
     130  Point = Vector(2.,0.,0.);
     131  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     132  Point = Vector(1.,0.,0.);
    133133  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    134134};
     
    142142
    143143  // straight down/up
    144   Point.Init(1./3.,1./3.,+5.);
     144  Point = Vector(1./3.,1./3.,+5.);
    145145  CPPUNIT_ASSERT_EQUAL( 25. , triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    146   Point.Init(1./3.,1./3.,0.);
    147   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    148   Point.Init(1./3.,1./3.,-5.);
     146  Point = Vector(1./3.,1./3.,0.);
     147  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     148  Point = Vector(1./3.,1./3.,-5.);
    149149  CPPUNIT_ASSERT_EQUAL( 25. , triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    150   Point.Init(1./3.,1./3.,0.);
     150  Point = Vector(1./3.,1./3.,0.);
    151151  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    152152
    153153  // simple test on y line
    154   Point.Init(-1.,0.5,+2.);
     154  Point = Vector(-1.,0.5,+2.);
    155155  CPPUNIT_ASSERT_EQUAL( 5., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    156   Point.Init(0.,0.5,0.);
    157   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    158   Point.Init(-1.,0.5,-3.);
     156  Point = Vector(0.,0.5,0.);
     157  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     158  Point = Vector(-1.,0.5,-3.);
    159159  CPPUNIT_ASSERT_EQUAL( 10., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    160   Point.Init(0.,0.5,0.);
     160  Point = Vector(0.,0.5,0.);
    161161  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    162162
    163163  // simple test on x line
    164   Point.Init(0.5,-1.,+1.);
     164  Point = Vector(0.5,-1.,+1.);
    165165  CPPUNIT_ASSERT_EQUAL( 2., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    166   Point.Init(0.5,0.,0.);
    167   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    168   Point.Init(0.5,-1.,-2.);
     166  Point = Vector(0.5,0.,0.);
     167  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     168  Point = Vector(0.5,-1.,-2.);
    169169  CPPUNIT_ASSERT_EQUAL( 5., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    170   Point.Init(0.5,0.,0.);
     170  Point = Vector(0.5,0.,0.);
    171171  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    172172
    173173  // simple test on slanted line
    174   Point.Init(1.,1.,+3.);
     174  Point = Vector(1.,1.,+3.);
    175175  CPPUNIT_ASSERT_EQUAL( 9.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    176   Point.Init(0.5,0.5,0.);
    177   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    178   Point.Init(1.,1.,-4.);
     176  Point = Vector(0.5,0.5,0.);
     177  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     178  Point = Vector(1.,1.,-4.);
    179179  CPPUNIT_ASSERT_EQUAL( 16.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    180   Point.Init(0.5,0.5,0.);
     180  Point = Vector(0.5,0.5,0.);
    181181  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    182182
    183183  // simple test on first node
    184   Point.Init(-1.,-1.,5.);
     184  Point = Vector(-1.,-1.,5.);
    185185  CPPUNIT_ASSERT_EQUAL( 27., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    186   Point.Init(0.,0.,0.);
     186  Point = Vector(0.,0.,0.);
    187187  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    188188
    189189  // simple test on second node
    190   Point.Init(0.,2.,5.);
     190  Point = Vector(0.,2.,5.);
    191191  CPPUNIT_ASSERT_EQUAL( 26., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    192   Point.Init(0.,1.,0.);
     192  Point = Vector(0.,1.,0.);
    193193  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    194194
    195195  // simple test on third node
    196   Point.Init(2.,0.,5.);
     196  Point = Vector(2.,0.,5.);
    197197  CPPUNIT_ASSERT_EQUAL( 26., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
    198   Point.Init(1.,0.,0.);
    199   CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    200 };
     198  Point = Vector(1.,0.,0.);
     199  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     200};
Note: See TracChangeset for help on using the changeset viewer.