Ignore:
Timestamp:
Aug 7, 2010, 12:07:04 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, Candidate_v1.7.0, 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:
2d292d
Parents:
8d6d31 (diff), d74077 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'AtomicPositionEncapsulation' into stable

Conflicts:

src/Actions/AtomAction/ChangeElementAction.cpp
src/Actions/WorldAction/RemoveSphereOfAtomsAction.cpp
src/Makefile.am
src/UIElements/TextUI/TextDialog.cpp
src/analysis_correlation.hpp
src/atom.cpp
src/atom_atominfo.hpp
src/bond.cpp
src/boundary.cpp
src/molecule_geometry.cpp
src/tesselation.cpp
src/tesselationhelpers.cpp
src/triangleintersectionlist.cpp
src/unittests/Makefile.am

  • fixed #includes due to moves to Helpers and LinearAlgebra
  • moved VectorInterface.* and vector_ops.* to LinearAlgebra
  • no more direct access of atom::node, remapped to set/getPosition()
  • no more direct access to atom::type, remapped to set/getType() (also in atom due to derivation and atominfo::AtomicElement is private not protected).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/unittests/tesselation_boundarytriangleunittest.cpp

    r8d6d31 r8f4df1  
    1313
    1414#include <cstring>
     15#include <iostream>
    1516
    1617#include "defs.hpp"
    17 #include "tesselation.hpp"
     18#include "TesselPoint.hpp"
     19#include "BoundaryPointSet.hpp"
     20#include "BoundaryLineSet.hpp"
     21#include "BoundaryTriangleSet.hpp"
     22#include "CandidateForTesselation.hpp"
    1823#include "tesselation_boundarytriangleunittest.hpp"
    1924
     
    3641  // create nodes
    3742  tesselpoints[0] = new TesselPoint;
    38   tesselpoints[0]->node = new Vector(0., 0., 0.);
     43  tesselpoints[0]->setPosition(Vector(0., 0., 0.));
    3944  tesselpoints[0]->setName("1");
    4045  tesselpoints[0]->nr = 1;
    4146  points[0] = new BoundaryPointSet(tesselpoints[0]);
    4247  tesselpoints[1] = new TesselPoint;
    43   tesselpoints[1]->node = new Vector(0., 1., 0.);
     48  tesselpoints[1]->setPosition(Vector(0., 1., 0.));
    4449  tesselpoints[1]->setName("2");
    4550  tesselpoints[1]->nr = 2;
    4651  points[1] = new BoundaryPointSet(tesselpoints[1]);
    4752  tesselpoints[2] = new TesselPoint;
    48   tesselpoints[2]->node = new Vector(1., 0., 0.);
     53  tesselpoints[2]->setPosition(Vector(1., 0., 0.));
    4954  tesselpoints[2]->setName("3");
    5055  tesselpoints[2]->nr = 3;
     
    6772  for (int i=0;i<3;++i) {
    6873    // TesselPoint does not delete its vector as it only got a reference
    69     delete tesselpoints[i]->node;
    7074    delete tesselpoints[i];
    7175  }
     
    8387  // simple test on y line
    8488  Point = Vector(-1.,0.5,0.);
    85   CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     89  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    8690  Point = Vector(0.,0.5,0.);
    8791  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    8892  Point = Vector(-4.,0.5,0.);
    89   CPPUNIT_ASSERT_EQUAL( 16., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     93  CPPUNIT_ASSERT_EQUAL( 16., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    9094  Point = Vector(0.,0.5,0.);
    9195  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    9397  // simple test on x line
    9498  Point = Vector(0.5,-1.,0.);
    95   CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     99  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    96100  Point = Vector(0.5,0.,0.);
    97101  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    98102  Point = Vector(0.5,-6.,0.);
    99   CPPUNIT_ASSERT_EQUAL( 36., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     103  CPPUNIT_ASSERT_EQUAL( 36., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    100104  Point = Vector(0.5,0.,0.);
    101105  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    103107  // simple test on slanted line
    104108  Point = Vector(1.,1.,0.);
    105   CPPUNIT_ASSERT_EQUAL( 0.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     109  CPPUNIT_ASSERT_EQUAL( 0.5, triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    106110  Point = Vector(0.5,0.5,0.);
    107111  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    108112  Point = Vector(5.,5.,0.);
    109   CPPUNIT_ASSERT_EQUAL( 40.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     113  CPPUNIT_ASSERT_EQUAL( 40.5, triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    110114  Point = Vector(0.5,0.5,0.);
    111115  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    113117  // simple test on first node
    114118  Point = Vector(-1.,-1.,0.);
    115   CPPUNIT_ASSERT_EQUAL( 2., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     119  CPPUNIT_ASSERT_EQUAL( 2., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    116120  Point = Vector(0.,0.,0.);
    117121  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    119123  // simple test on second node
    120124  Point = Vector(0.,2.,0.);
    121   CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     125  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    122126  Point = Vector(0.,1.,0.);
    123127  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    125129  // simple test on third node
    126130  Point = Vector(2.,0.,0.);
    127   CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     131  CPPUNIT_ASSERT_EQUAL( 1., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    128132  Point = Vector(1.,0.,0.);
    129133  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    139143  // straight down/up
    140144  Point = Vector(1./3.,1./3.,+5.);
    141   CPPUNIT_ASSERT_EQUAL( 25. , triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     145  CPPUNIT_ASSERT_EQUAL( 25. , triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    142146  Point = Vector(1./3.,1./3.,0.);
    143147  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    144148  Point = Vector(1./3.,1./3.,-5.);
    145   CPPUNIT_ASSERT_EQUAL( 25. , triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     149  CPPUNIT_ASSERT_EQUAL( 25. , triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    146150  Point = Vector(1./3.,1./3.,0.);
    147151  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    149153  // simple test on y line
    150154  Point = Vector(-1.,0.5,+2.);
    151   CPPUNIT_ASSERT_EQUAL( 5., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     155  CPPUNIT_ASSERT_EQUAL( 5., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    152156  Point = Vector(0.,0.5,0.);
    153157  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    154158  Point = Vector(-1.,0.5,-3.);
    155   CPPUNIT_ASSERT_EQUAL( 10., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     159  CPPUNIT_ASSERT_EQUAL( 10., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    156160  Point = Vector(0.,0.5,0.);
    157161  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    159163  // simple test on x line
    160164  Point = Vector(0.5,-1.,+1.);
    161   CPPUNIT_ASSERT_EQUAL( 2., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     165  CPPUNIT_ASSERT_EQUAL( 2., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    162166  Point = Vector(0.5,0.,0.);
    163167  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    164168  Point = Vector(0.5,-1.,-2.);
    165   CPPUNIT_ASSERT_EQUAL( 5., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     169  CPPUNIT_ASSERT_EQUAL( 5., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    166170  Point = Vector(0.5,0.,0.);
    167171  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    169173  // simple test on slanted line
    170174  Point = Vector(1.,1.,+3.);
    171   CPPUNIT_ASSERT_EQUAL( 9.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     175  CPPUNIT_ASSERT_EQUAL( 9.5, triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    172176  Point = Vector(0.5,0.5,0.);
    173177  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
    174178  Point = Vector(1.,1.,-4.);
    175   CPPUNIT_ASSERT_EQUAL( 16.5, triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     179  CPPUNIT_ASSERT_EQUAL( 16.5, triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    176180  Point = Vector(0.5,0.5,0.);
    177181  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    179183  // simple test on first node
    180184  Point = Vector(-1.,-1.,5.);
    181   CPPUNIT_ASSERT_EQUAL( 27., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     185  CPPUNIT_ASSERT_EQUAL( 27., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    182186  Point = Vector(0.,0.,0.);
    183187  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    185189  // simple test on second node
    186190  Point = Vector(0.,2.,5.);
    187   CPPUNIT_ASSERT_EQUAL( 26., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     191  CPPUNIT_ASSERT_EQUAL( 26., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    188192  Point = Vector(0.,1.,0.);
    189193  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
     
    191195  // simple test on third node
    192196  Point = Vector(2.,0.,5.);
    193   CPPUNIT_ASSERT_EQUAL( 26., triangle->GetClosestPointInsideTriangle(&Point, &TestIntersection) );
     197  CPPUNIT_ASSERT_EQUAL( 26., triangle->GetClosestPointInsideTriangle(Point, TestIntersection) );
    194198  Point = Vector(1.,0.,0.);
    195199  CPPUNIT_ASSERT_EQUAL( true , Point == TestIntersection );
Note: See TracChangeset for help on using the changeset viewer.