Changeset 34c43a


Ignore:
Timestamp:
Mar 1, 2011, 10:16:38 AM (14 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:
caa06ef
Parents:
ba5215
git-author:
Frederik Heber <heber@…> (02/21/11 18:02:41)
git-committer:
Frederik Heber <heber@…> (03/01/11 10:16:38)
Message:

Bigger change: Replaced PointCloud by PointCloudAdaptor.

Files:
2 added
2 deleted
31 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    rba5215 r34c43a  
    115115#AC_MSG_NOTICE(["GLU_CFLAGS: $GLU_CFLAGS, GLU_CXXFLAGS: $GLU_CXXFLAGS, GLU_LDFLAGS: $GLU_LDFLAGS, GLU_LIBS: $GLU_LIBS"])
    116116
    117 # CodePatterns library (needs bugfixed ObservedContainer)
    118 AM_PATH_CODEPATTERNS([1.0.9], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
     117# CodePatterns library (needs ObservedIterator<> operator==,!= to be const)
     118AM_PATH_CODEPATTERNS([1.0.11], $have_debug,,[AC_MSG_ERROR([Missing CodePatterns library, please specify PKG_CONFIG_PATH or use --with-codepatterns...])])
    119119
    120120# Checks for header files.
  • src/Actions/AnalysisAction/MolecularVolumeAction.cpp

    rba5215 r34c43a  
    2626#include "CodePatterns/Log.hpp"
    2727#include "CodePatterns/Verbose.hpp"
     28#include "PointCloudAdaptor.hpp"
    2829#include "tesselation.hpp"
    2930#include "World.hpp"
     
    5152    const LinkedCell *LCList = NULL;
    5253    DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope.");
    53     LCList = new LinkedCell(*mol, 10.);
     54    PointCloudAdaptor< molecule > cloud(mol);
     55    LCList = new LinkedCell(cloud, 10.);
    5456    config * const configuration = World::getInstance().getConfig();
    5557    //Boundaries *BoundaryPoints = NULL;
  • src/Actions/AnalysisAction/SurfaceCorrelationAction.cpp

    rba5215 r34c43a  
    2525#include "CodePatterns/Verbose.hpp"
    2626#include "CodePatterns/Log.hpp"
     27#include "Descriptors/MoleculeIdDescriptor.hpp"
    2728#include "element.hpp"
     29#include "LinearAlgebra/Vector.hpp"
    2830#include "molecule.hpp"
    2931#include "periodentafel.hpp"
     32#include "PointCloudAdaptor.hpp"
    3033#include "tesselation.hpp"
    31 #include "LinearAlgebra/Vector.hpp"
    3234#include "World.hpp"
    3335
     
    5759  output.open(params.outputname.string().c_str());
    5860  binoutput.open(params.binoutputname.string().c_str());
    59   ASSERT(params.Boundary != NULL, "No molecule specified for SurfaceCorrelation.");
     61  molecule *surfacemol = const_cast<molecule *>(params.Boundary);
     62  ASSERT(surfacemol != NULL, "No molecule specified for SurfaceCorrelation.");
    6063  const double radius = 4.;
    6164  double LCWidth = 20.;
     
    7376  std::vector<molecule*> molecules = World::getInstance().getSelectedMolecules();
    7477  std::cout << "There are " << molecules.size() << " selected molecules." << std::endl;
    75   LCList = new LinkedCell(*params.Boundary, LCWidth);
    76   FindNonConvexBorder(params.Boundary, TesselStruct, LCList, radius, NULL);
     78  PointCloudAdaptor<molecule> cloud(surfacemol);
     79  LCList = new LinkedCell(cloud, LCWidth);
     80  FindNonConvexBorder(surfacemol, TesselStruct, LCList, radius, NULL);
    7781  CorrelationToSurfaceMap *surfacemap = NULL;
    7882  if (params.periodic)
  • src/Actions/FragmentationAction/ConstructBondGraphAction.cpp

    rba5215 r34c43a  
    2626#include "bond.hpp"
    2727#include "bondgraph.hpp"
     28#include "CodePatterns/Log.hpp"
     29#include "CodePatterns/Verbose.hpp"
    2830#include "config.hpp"
    2931#include "linkedcell.hpp"
    30 #include "CodePatterns/Log.hpp"
    31 #include "CodePatterns/Verbose.hpp"
    3232#include "molecule.hpp"
     33#include "PointCloudAdaptor.hpp"
    3334#include "World.hpp"
    3435#include "WorldTime.hpp"
    3536
    3637#include <iostream>
     38#include <list>
    3739#include <string>
    3840
     
    8688  if ((AtomCount > 1) && (BondDistance > 1.)) {
    8789    DoLog(2) && (Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl);
    88     LinkedCell::LinkedNodes list;
     90    TesselPointSTLList list;
    8991    for (World::AtomSelectionIterator AtomRunner = World::getInstance().beginAtomSelection();
    9092        AtomRunner != World::getInstance().endAtomSelection();
     
    9294      list.push_back(AtomRunner->second);
    9395    }
    94     LC = new LinkedCell(list, BondDistance);
     96    PointCloudAdaptor< TesselPointSTLList > cloud(&list);
     97    LC = new LinkedCell(cloud, BondDistance);
    9598
    9699    // create a list to map Tesselpoint::nr to atom *
     
    111114      for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++)
    112115        for (LC->n[2] = 0; LC->n[2] < LC->N[2]; LC->n[2]++) {
    113           const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     116          const TesselPointSTLList *List = LC->GetCurrentCell();
    114117//          Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    115118          if (List != NULL) {
    116             for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin();
     119            for (TesselPointSTLList::const_iterator Runner = List->begin();
    117120                Runner != List->end();
    118121                Runner++) {
     
    124127                for (n[1] = -1; n[1] <= 1; n[1]++)
    125128                  for (n[2] = -1; n[2] <= 1; n[2]++) {
    126                     const LinkedCell::LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n);
     129                    const TesselPointSTLList *OtherList = LC->GetRelativeToCurrentCell(n);
    127130//                    Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    128131                    if (OtherList != NULL) {
    129                       for (LinkedCell::LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
     132                      for (TesselPointSTLList::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
    130133                        if (AtomIds.find(*OtherRunner)->second > AtomIds.find(Walker)->second) {
    131134                          OtherWalker = dynamic_cast<atom*>(*OtherRunner);
  • src/Actions/TesselationAction/ConvexEnvelopeAction.cpp

    rba5215 r34c43a  
    2121
    2222#include "boundary.hpp"
     23#include "CodePatterns/Log.hpp"
     24#include "CodePatterns/Verbose.hpp"
    2325#include "config.hpp"
    2426#include "linkedcell.hpp"
    25 #include "CodePatterns/Log.hpp"
    2627#include "molecule.hpp"
     28#include "PointCloudAdaptor.hpp"
    2729#include "tesselation.hpp"
    28 #include "CodePatterns/Verbose.hpp"
    2930#include "World.hpp"
    3031
     
    5556    DoLog(1) && (Log() << Verbose(1) << "Storing tecplot convex data in " << params.filenameConvex << "." << endl);
    5657    DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << params.filenameNonConvex << "." << endl);
    57     LCList = new LinkedCell(*mol, 100.);
     58    PointCloudAdaptor<molecule> cloud(mol);
     59    LCList = new LinkedCell(cloud, 100.);
    5860    //Boundaries *BoundaryPoints = NULL;
    5961    //FindConvexBorder(mol, BoundaryPoints, TesselStruct, LCList, argv[argptr]);
  • src/Actions/TesselationAction/NonConvexEnvelopeAction.cpp

    rba5215 r34c43a  
    2121
    2222#include "boundary.hpp"
     23#include "CodePatterns/Log.hpp"
     24#include "CodePatterns/Verbose.hpp"
    2325#include "linkedcell.hpp"
    24 #include "CodePatterns/Log.hpp"
    2526#include "molecule.hpp"
     27#include "PointCloudAdaptor.hpp"
    2628#include "tesselation.hpp"
    27 #include "CodePatterns/Verbose.hpp"
    2829#include "World.hpp"
    2930
     
    5556    DoLog(1) && (Log() << Verbose(1) << "Specified molecule has " << Boundary->getAtomCount() << " atoms." << endl);
    5657    start = clock();
    57     LCList = new LinkedCell(*Boundary, params.SphereRadius*2.);
     58    PointCloudAdaptor< molecule > cloud(Boundary);
     59    LCList = new LinkedCell(cloud, params.SphereRadius*2.);
    5860    Success = FindNonConvexBorder(Boundary, T, LCList, params.SphereRadius, params.filename.string().c_str());
    5961    //FindDistributionOfEllipsoids(T, &LCList, N, number, params.filename.c_str());
  • src/Makefile.am

    rba5215 r34c43a  
    143143  BoundaryTriangleSet.cpp \
    144144  CandidateForTesselation.cpp \
    145   PointCloud.cpp \
    146145  tesselation.cpp \
    147146  tesselationhelpers.cpp \
     
    154153  BoundaryTriangleSet.hpp \
    155154  CandidateForTesselation.hpp \
    156   PointCloud.hpp \
     155  IPointCloud.hpp \
     156  PointCloudAdaptor.hpp \
    157157  tesselation.hpp \
    158158  tesselationhelpers.hpp \
  • src/boundary.cpp

    rba5215 r34c43a  
    1818#include "CodePatterns/MemDebug.hpp"
    1919
    20 #include "BoundaryPointSet.hpp"
    21 #include "BoundaryLineSet.hpp"
    22 #include "BoundaryTriangleSet.hpp"
    23 #include "CandidateForTesselation.hpp"
    24 //#include "TesselPoint.hpp"
    25 #include "World.hpp"
    2620#include "atom.hpp"
    2721#include "bond.hpp"
    2822#include "boundary.hpp"
     23#include "BoundaryLineSet.hpp"
     24#include "BoundaryPointSet.hpp"
     25#include "BoundaryTriangleSet.hpp"
     26#include "Box.hpp"
     27#include "CandidateForTesselation.hpp"
     28#include "CodePatterns/Info.hpp"
     29#include "CodePatterns/Log.hpp"
     30#include "CodePatterns/Verbose.hpp"
    2931#include "config.hpp"
    3032#include "element.hpp"
    3133#include "Helpers/helpers.hpp"
    32 #include "CodePatterns/Info.hpp"
     34#include "LinearAlgebra/Plane.hpp"
     35#include "LinearAlgebra/RealSpaceMatrix.hpp"
    3336#include "linkedcell.hpp"
    34 #include "CodePatterns/Verbose.hpp"
    35 #include "CodePatterns/Log.hpp"
    3637#include "molecule.hpp"
     38#include "PointCloudAdaptor.hpp"
     39#include "RandomNumbers/RandomNumberGeneratorFactory.hpp"
     40#include "RandomNumbers/RandomNumberGenerator.hpp"
    3741#include "tesselation.hpp"
    3842#include "tesselationhelpers.hpp"
    3943#include "World.hpp"
    40 #include "LinearAlgebra/Plane.hpp"
    41 #include "LinearAlgebra/RealSpaceMatrix.hpp"
    42 #include "RandomNumbers/RandomNumberGeneratorFactory.hpp"
    43 #include "RandomNumbers/RandomNumberGenerator.hpp"
    44 #include "Box.hpp"
    4544
    4645#include <iostream>
     
    378377
    379378  // 3b. go through all lines, that are not yet part of two triangles (only of one so far)
    380   TesselStruct->TesselateOnBoundary(mol);
     379  PointCloudAdaptor< molecule > cloud(const_cast<molecule *>(mol));
     380  TesselStruct->TesselateOnBoundary(cloud);
    381381
    382382  // 3c. check whether all atoms lay inside the boundary, if not, add to boundary points, segment triangle into three with the new point
    383   if (!TesselStruct->InsertStraddlingPoints(mol, LCList))
     383  if (!TesselStruct->InsertStraddlingPoints(cloud, LCList))
    384384    DoeLog(1) && (eLog()<< Verbose(1) << "Insertion of straddling points failed!" << endl);
    385385
     
    645645{
    646646        Info FunctionInfo(__func__);
     647  PointCloudAdaptor< molecule > cloud(const_cast<molecule *>(mol));
    647648  // 4. Store triangles in tecplot file
    648649  if (filename != NULL) {
     
    652653      OutputName.append(TecplotSuffix);
    653654      ofstream *tecplot = new ofstream(OutputName.c_str());
    654       WriteTecplotFile(tecplot, TesselStruct, mol, -1);
     655      WriteTecplotFile(tecplot, TesselStruct, cloud, -1);
    655656      tecplot->close();
    656657      delete(tecplot);
     
    661662      OutputName.append(Raster3DSuffix);
    662663      ofstream *rasterplot = new ofstream(OutputName.c_str());
    663       WriteRaster3dFile(rasterplot, TesselStruct, mol);
     664      WriteRaster3dFile(rasterplot, TesselStruct, cloud);
    664665      rasterplot->close();
    665666      delete(rasterplot);
     
    699700  BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    700701  GreatestDiameter = GetDiametersOfCluster(BoundaryPoints, mol, TesselStruct, IsAngstroem);
    701   LinkedCell *LCList = new LinkedCell(*mol, 10.);
     702  PointCloudAdaptor< molecule > cloud(mol);
     703  LinkedCell *LCList = new LinkedCell(cloud, 10.);
    702704  FindConvexBorder(mol, BoundaryPoints, TesselStruct, (const LinkedCell *&)LCList, NULL);
    703705  delete (LCList);
     
    808810    if ((*ListRunner)->getAtomCount() > 0) {
    809811      DoLog(1) && (Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl);
    810       LCList[(*ListRunner)] = new LinkedCell(*(*ListRunner), 10.); // get linked cell list
     812      PointCloudAdaptor< molecule > cloud(*ListRunner);
     813      LCList[(*ListRunner)] = new LinkedCell(cloud, 10.); // get linked cell list
    811814      DoLog(1) && (Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl);
    812815      TesselStruct[(*ListRunner)] = NULL;
     
    10151018{
    10161019  size_t compareTo = 0;
    1017   LinkedCell::LinkedNodes* liste = LC->GetPointsInsideSphere(boundary == 0. ? MYEPSILON : boundary, &CurrentPosition);
     1020  TesselPointSTLList* liste = LC->GetPointsInsideSphere(boundary == 0. ? MYEPSILON : boundary, &CurrentPosition);
    10181021  if (filler != NULL) {
    1019     for (LinkedCell::LinkedNodes::const_iterator iter = liste->begin();
     1022    for (TesselPointSTLList::const_iterator iter = liste->begin();
    10201023        iter != liste->end();
    10211024        ++iter) {
     
    10311034  if (!result) {
    10321035    DoLog(0) && (Log() << Verbose(0) << "Skipping because of the following atoms:" << std::endl);
    1033     for (LinkedCell::LinkedNodes::const_iterator iter = liste->begin();
     1036    for (TesselPointSTLList::const_iterator iter = liste->begin();
    10341037        iter != liste->end();
    10351038        ++iter) {
     
    10841087    if ((*ListRunner)->getAtomCount() > 0) {
    10851088      DoLog(1) && (Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl);
    1086       LCList[(*ListRunner)] = new LinkedCell(*(*ListRunner), 10.); // get linked cell list
     1089      PointCloudAdaptor< molecule > cloud(*ListRunner);
     1090      LCList[(*ListRunner)] = new LinkedCell(cloud, 10.); // get linked cell list
    10871091    }
    10881092
     
    12151219 * \return true - tesselation successful, false - tesselation failed
    12161220 */
    1217 bool FindNonConvexBorder(const molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LCList, const double RADIUS, const char *filename = NULL)
     1221bool FindNonConvexBorder(molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LCList, const double RADIUS, const char *filename = NULL)
    12181222{
    12191223        Info FunctionInfo(__func__);
     
    12361240
    12371241  // initialise Linked Cell
     1242  PointCloudAdaptor< molecule > cloud(mol);
    12381243  if (LCList == NULL) {
    1239     LCList = new LinkedCell(*mol, 2.*RADIUS);
     1244    LCList = new LinkedCell(cloud, 2.*RADIUS);
    12401245    freeLC = true;
    12411246  }
     
    12481253  if (filename != NULL) {
    12491254    if ((DoSingleStepOutput && ((TesselStruct->TrianglesOnBoundary.size() % SingleStepWidth == 0)))) { // if we have a new triangle and want to output each new triangle configuration
    1250       TesselStruct->Output(filename, mol);
     1255      TesselStruct->Output(filename, cloud);
    12511256    }
    12521257  }
     
    12881293    if (filename != NULL) {
    12891294      if ((DoSingleStepOutput && ((TesselStruct->TrianglesOnBoundary.size() % SingleStepWidth == 0)))) { // if we have a new triangle and want to output each new triangle configuration
    1290         TesselStruct->Output(filename, mol);
     1295        TesselStruct->Output(filename, cloud);
    12911296      }
    12921297    }
  • src/boundary.hpp

    rba5215 r34c43a  
    4242void FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, const double MaxDistance, const double distance[NDIM], const double boundary, const double RandomAtomDisplacement, const double RandomMolDisplacement, const bool DoRandomRotation);
    4343void FillVoidWithMolecule(molecule *&filler, config &configuration, const double distance[NDIM], const double boundary, const double RandomAtomDisplacement, const double RandomMolDisplacement, const double MinDistance, const bool DoRandomRotation);
    44     void FindConvexBorder(const molecule* const mol, Boundaries *BoundaryPts, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename);
     44void FindConvexBorder(const molecule* const mol, Boundaries *BoundaryPts, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename);
    4545Vector* FindEmbeddingHole(MoleculeListClass *mols, molecule *srcmol);
    46 bool FindNonConvexBorder(const molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LC, const double RADIUS, const char *tempbasename);
     46bool FindNonConvexBorder(molecule* const mol, Tesselation *&TesselStruct, const LinkedCell *&LC, const double RADIUS, const char *tempbasename);
    4747Boundaries *GetBoundaryPoints(const molecule *mol, Tesselation *&TesselStruct);
    4848double * GetDiametersOfCluster(const Boundaries *BoundaryPtr, const molecule *mol, Tesselation *&TesselStruct, const bool IsAngstroem);
  • src/ellipsoid.cpp

    rba5215 r34c43a  
    284284    DoLog(2) && (Log() << Verbose(2) << "INFO: Center cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " ... ");
    285285    // get random cell
    286     const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     286    const TesselPointSTLList *List = LC->GetCurrentCell();
    287287    if (List == NULL) {  // set index to it
    288288      continue;
     
    303303      for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    304304        for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    305           const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     305          const TesselPointSTLList *List = LC->GetCurrentCell();
    306306          PointsLeft += List->size();
    307307        }
     
    328328      for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    329329        for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    330           const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     330          const TesselPointSTLList *List = LC->GetCurrentCell();
    331331//          Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    332332          if (List != NULL) {
     
    335335//            else
    336336//              Log() << Verbose(2) << "Cell is empty ... " << endl;
    337             for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     337            for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    338338              if ((current != PickedAtomNrs.end()) && (*current == index)) {
    339339                Candidate = (*Runner);
  • src/linkedcell.cpp

    rba5215 r34c43a  
    2525#include "CodePatterns/Log.hpp"
    2626#include "molecule.hpp"
    27 #include "PointCloud.hpp"
     27#include "IPointCloud.hpp"
    2828#include "tesselation.hpp"
    2929#include "LinearAlgebra/Vector.hpp"
    3030
    3131// ========================================================= class LinkedCell ===========================================
    32 
    33 /** Constructor for class LinkedCell::LinkedNodes.
    34  */
    35 LinkedCell::LinkedNodes::LinkedNodes()
    36 {}
    37 
    38 /** Destructor for class LinkedCell::LinkedNodes.
    39  */
    40 LinkedCell::LinkedNodes::~LinkedNodes()
    41 {}
    42 
    43 TesselPoint * LinkedCell::LinkedNodes::getValue (const_iterator &rhs) const
    44 {
    45   return *rhs;
    46 }
    47 
    48 TesselPoint * LinkedCell::LinkedNodes::getValue (iterator &rhs) const
    49 {
    50   return *rhs;
    51 }
    5232
    5333/** Constructor for class LinkedCell.
     
    6848 * \param RADIUS edge length of cells
    6949 */
    70 LinkedCell::LinkedCell(const PointCloud & set, const double radius) :
     50LinkedCell::LinkedCell(IPointCloud & set, const double radius) :
    7151  LC(NULL),
    7252  RADIUS(radius),
     
    11797  }
    11898  ASSERT(N[0]*N[1]*N[2] < MAX_LINKEDCELLNODES, "Number linked of linked cell nodes exceded hard-coded limit, use greater edge length!");
    119   LC = new LinkedNodes[N[0]*N[1]*N[2]];
     99  LC = new TesselPointSTLList[N[0]*N[1]*N[2]];
    120100  for (index=0;index<N[0]*N[1]*N[2];index++) {
    121101    LC [index].clear();
     
    184164 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell::n[] are out of bounds.
    185165 */
    186 const LinkedCell::LinkedNodes* LinkedCell::GetCurrentCell() const
     166const TesselPointSTLList* LinkedCell::GetCurrentCell() const
    187167{
    188168  if (CheckBounds()) {
     
    198178 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell::n[]+relative[] are out of bounds.
    199179 */
    200 const LinkedCell::LinkedNodes* LinkedCell::GetRelativeToCurrentCell(const int relative[NDIM]) const
     180const TesselPointSTLList* LinkedCell::GetRelativeToCurrentCell(const int relative[NDIM]) const
    201181{
    202182  if (CheckBounds(relative)) {
     
    232212  index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2];
    233213  if (CheckBounds()) {
    234     for (LinkedNodes::iterator Runner = LC[index].begin(); Runner != LC[index].end(); Runner++)
     214    for (TesselPointSTLList::iterator Runner = LC[index].begin(); Runner != LC[index].end(); Runner++)
    235215      status = status || ((*Runner) == Walker);
    236216    return status;
     
    267247 * \return list of tesselpoints
    268248 */
    269 LinkedCell::LinkedNodes* LinkedCell::GetallNeighbours(const double distance) const
     249TesselPointSTLList* LinkedCell::GetallNeighbours(const double distance) const
    270250{
    271251  int Nlower[NDIM], Nupper[NDIM];
    272252  TesselPoint *Walker = NULL;
    273   LinkedNodes *TesselList = new LinkedNodes;
     253  TesselPointSTLList *TesselList = new TesselPointSTLList;
    274254
    275255  // then go through the current and all neighbouring cells and check the contained points for possible candidates
     
    281261    for (n[1] = Nlower[1]; n[1] <= Nupper[1]; n[1]++)
    282262      for (n[2] = Nlower[2]; n[2] <= Nupper[2]; n[2]++) {
    283         const LinkedNodes *List = GetCurrentCell();
     263        const TesselPointSTLList *List = GetCurrentCell();
    284264        //Log() << Verbose(1) << "Current cell is " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl;
    285265        if (List != NULL) {
    286           for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     266          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    287267            Walker = *Runner;
    288268            TesselList->push_back(Walker);
     
    346326 * \return list of all points inside sphere
    347327 */
    348 LinkedCell::LinkedNodes* LinkedCell::GetPointsInsideSphere(const double radius, const Vector * const center) const
     328TesselPointSTLList* LinkedCell::GetPointsInsideSphere(const double radius, const Vector * const center) const
    349329{
    350330  const double radiusSquared = radius*radius;
    351331  TesselPoint *Walker = NULL;
    352   LinkedNodes *TesselList = new LinkedNodes;
    353   LinkedNodes *NeighbourList = NULL;
     332  TesselPointSTLList *TesselList = new TesselPointSTLList;
     333  TesselPointSTLList *NeighbourList = NULL;
    354334
    355335  // set index of LC to center of sphere
     
    365345  //Log() << Verbose(1) << "I found " << NeighbourList->size() << " neighbours to check." << endl;
    366346  if (NeighbourList != NULL) {
    367     for (LinkedNodes::const_iterator Runner = NeighbourList->begin(); Runner != NeighbourList->end(); Runner++) {
     347    for (TesselPointSTLList::const_iterator Runner = NeighbourList->begin(); Runner != NeighbourList->end(); Runner++) {
    368348      Walker = *Runner;
    369349      //Log() << Verbose(1) << "Current neighbour is at " << *Walker->node << "." << endl;
  • src/linkedcell.hpp

    rba5215 r34c43a  
    2929#include "CodePatterns/Verbose.hpp"
    3030#include "Helpers/defs.hpp"
     31#include "LinearAlgebra/Vector.hpp"
    3132#include "World.hpp"
    32 #include "LinearAlgebra/Vector.hpp"
    3333
    3434/****************************************** forward declarations *****************************/
    3535
    36 class PointCloud;
     36class IPointCloud;
    3737class TesselPoint;
    3838
     
    4444/********************************************** declarations *******************************/
    4545
     46typedef std::list<TesselPoint *> TesselPointSTLList;
     47
    4648/** Linked Cell class for containing Vectors in real space efficiently.
    4749 */
     
    5052
    5153public:
    52   class LinkedNodes : public std::list<TesselPoint *> {
    53   public:
    54     LinkedNodes();
    55     ~LinkedNodes();
    56 
    57     TesselPoint * getValue (const_iterator &rhs) const;
    58     TesselPoint * getValue (iterator &rhs) const;
    59   };
    60   //typedef list<TesselPoint *> LinkedNodes;
    61 
    62 
    6354    Vector max;       // upper boundary
    6455    Vector min;       // lower boundary
    65     LinkedNodes *LC;  // linked cell list
     56    TesselPointSTLList *LC;  // linked cell list
    6657    double RADIUS;    // cell edge length
    6758    int N[NDIM];      // number of cells per axis
     
    7061
    7162    LinkedCell();
    72     LinkedCell(const PointCloud &set, const double radius);
    73     template <class T> LinkedCell(const T &set, const double radius) :
    74       LC(NULL),
    75       RADIUS(radius),
    76       index(-1)
    77     {
    78       class TesselPoint *Walker = NULL;
    79       for(int i=0;i<NDIM;i++)
    80         N[i] = 0;
    81       max.Zero();
    82       min.Zero();
    83       DoLog(1) && (Log() << Verbose(1) << "Begin of LinkedCell" << endl);
    84       if (set.begin() == set.end()) {
    85         DoeLog(1) && (eLog()<< Verbose(1) << "set contains no linked cell nodes!" << endl);
    86         return;
    87       }
    88       // 1. find max and min per axis of atoms
    89       typename T::const_iterator Runner = set.begin();
    90       for (int i=0;i<NDIM;i++) {
    91         max[i] = set.getValue(Runner)->at(i);
    92         min[i] = set.getValue(Runner)->at(i);
    93       }
    94       for (typename T::const_iterator Runner = set.begin(); Runner != set.end(); Runner++) {
    95         Walker = set.getValue(Runner);
    96         for (int i=0;i<NDIM;i++) {
    97           if (max[i] < Walker->at(i))
    98             max[i] = Walker->at(i);
    99           if (min[i] > Walker->at(i))
    100             min[i] = Walker->at(i);
    101         }
    102       }
    103       DoLog(2) && (Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl);
    104 
    105       // 2. find then number of cells per axis
    106       for (int i=0;i<NDIM;i++) {
    107         N[i] = static_cast<int>(floor((max[i] - min[i])/RADIUS)+1);
    108       }
    109       DoLog(2) && (Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl);
    110 
    111       // 3. allocate the lists
    112       DoLog(2) && (Log() << Verbose(2) << "Allocating cells ... ");
    113       if (LC != NULL) {
    114         DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl);
    115         return;
    116       }
    117       ASSERT(N[0]*N[1]*N[2] < MAX_LINKEDCELLNODES, "Number linked of linked cell nodes exceded hard-coded limit, use greater edge length!");
    118       LC = new LinkedNodes[N[0]*N[1]*N[2]];
    119       for (index=0;index<N[0]*N[1]*N[2];index++) {
    120         LC [index].clear();
    121       }
    122       DoLog(0) && (Log() << Verbose(0) << "done."  << endl);
    123 
    124       // 4. put each atom into its respective cell
    125       DoLog(2) && (Log() << Verbose(2) << "Filling cells ... ");
    126       for (typename T::const_iterator Runner = set.begin(); Runner != set.end(); Runner++) {
    127         Walker = set.getValue(Runner);
    128         for (int i=0;i<NDIM;i++) {
    129           n[i] = static_cast<int>(floor((Walker->at(i) - min[i])/RADIUS));
    130         }
    131         index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2];
    132         LC[index].push_back(Walker);
    133         //Log() << Verbose(2) << *Walker << " goes into cell " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl;
    134       }
    135       DoLog(0) && (Log() << Verbose(0) << "done."  << endl);
    136       DoLog(1) && (Log() << Verbose(1) << "End of LinkedCell" << endl);
    137     };
    138 
    139 
     63    LinkedCell(IPointCloud &set, const double radius);
    14064    ~LinkedCell();
    141     const LinkedCell::LinkedNodes* GetCurrentCell()const ;
    142     const LinkedCell::LinkedNodes* GetRelativeToCurrentCell(const int relative[NDIM])const ;
     65    const TesselPointSTLList* GetCurrentCell()const ;
     66    const TesselPointSTLList* GetRelativeToCurrentCell(const int relative[NDIM])const ;
    14367    bool SetIndexToNode(const TesselPoint * const Walker)const ;
    14468    bool SetIndexToVector(const Vector &x)const ;
     
    14872    void GetNeighbourBounds(int lower[NDIM], int upper[NDIM], int step = 1)const ;
    14973
    150     LinkedCell::LinkedNodes* GetallNeighbours(const double distance = 0) const;
    151     LinkedCell::LinkedNodes* GetPointsInsideSphere(const double radius, const Vector * const center) const;
     74    TesselPointSTLList* GetallNeighbours(const double distance = 0) const;
     75    TesselPointSTLList* GetPointsInsideSphere(const double radius, const Vector * const center) const;
    15276    // not implemented yet
    15377    bool AddNode(Vector *Walker);
  • src/molecule.cpp

    rba5215 r34c43a  
    5757  elemente(teil),  MDSteps(0),  BondCount(0), NoNonHydrogen(0), NoNonBonds(0),
    5858  NoCyclicBonds(0), BondDistance(0.),  ActiveFlag(false), IndexNr(-1),
    59   AtomCount(this,boost::bind(&molecule::doCountAtoms,this),"AtomCount"), last_atom(0),  InternalPointer(atoms.begin())
     59  AtomCount(this,boost::bind(&molecule::doCountAtoms,this),"AtomCount"), last_atom(0)
    6060{
    6161
  • src/molecule.hpp

    rba5215 r34c43a  
    2525#include "types.hpp"
    2626#include "graph.hpp"
    27 #include "PointCloud.hpp"
    2827#include "CodePatterns/Observer.hpp"
    2928#include "CodePatterns/ObservedIterator.hpp"
     
    8180 * Class incorporates number of types
    8281 */
    83 class molecule : public PointCloud, public Observable
     82class molecule : public Observable
    8483{
    8584  friend molecule *NewMolecule();
     
    156155  pair<iterator, bool> insert(atom * const key);
    157156  bool containsAtom(atom* key);
    158 
    159   // re-definition of virtual functions from PointCloud
    160   const char * const GetName() const;
    161   Vector *GetCenter() const;
    162   TesselPoint *GetPoint() const;
    163   int GetMaxId() const;
    164   void GoToNext() const;
    165   void GoToFirst() const;
    166   bool IsEmpty() const;
    167   bool IsEnd() const;
    168157
    169158  /// remove atoms from molecule.
     
    283272  void init_DFS(struct DFSAccounting&) const;
    284273  int last_atom; //!< number given to last atom
    285   mutable internal_iterator InternalPointer; //!< internal pointer for PointCloud
    286274};
    287275
  • src/molecule_graph.cpp

    rba5215 r34c43a  
    2525#include "bond.hpp"
    2626#include "bondgraph.hpp"
     27#include "Box.hpp"
     28#include "CodePatterns/Assert.hpp"
     29#include "CodePatterns/Info.hpp"
     30#include "CodePatterns/Log.hpp"
     31#include "CodePatterns/Verbose.hpp"
    2732#include "config.hpp"
    2833#include "element.hpp"
     
    3338#include "linkedcell.hpp"
    3439#include "molecule.hpp"
     40#include "PointCloudAdaptor.hpp"
    3541#include "World.hpp"
    3642#include "WorldTime.hpp"
    37 #include "Box.hpp"
    38 
    39 #include "CodePatterns/Assert.hpp"
    40 #include "CodePatterns/Info.hpp"
    41 #include "CodePatterns/Log.hpp"
    42 #include "CodePatterns/Verbose.hpp"
    4343
    4444#define MAXBONDS 8
     
    162162  if ((getAtomCount() > 1) && (bonddistance > 0.1)) {
    163163    DoLog(2) && (Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl);
    164     LC = new LinkedCell(*this, bonddistance);
     164    PointCloudAdaptor<molecule> cloud(this);
     165    LC = new LinkedCell(cloud, bonddistance);
    165166
    166167    // create a list to map Tesselpoint::nr to atom *
     
    178179      for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++)
    179180        for (LC->n[2] = 0; LC->n[2] < LC->N[2]; LC->n[2]++) {
    180           const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     181          const TesselPointSTLList *List = LC->GetCurrentCell();
    181182          Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    182183          if (List != NULL) {
    183             for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     184            for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    184185              Walker = dynamic_cast<atom*>(*Runner);
    185186              ASSERT(Walker,"Tesselpoint that was not an atom retrieved from LinkedNode");
     
    189190                for (n[1] = -1; n[1] <= 1; n[1]++)
    190191                  for (n[2] = -1; n[2] <= 1; n[2]++) {
    191                     const LinkedCell::LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n);
     192                    const TesselPointSTLList *OtherList = LC->GetRelativeToCurrentCell(n);
    192193                    if (OtherList != NULL) {
    193194                      Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    194                       for (LinkedCell::LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
     195                      for (TesselPointSTLList::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
    195196                        if ((*OtherRunner)->nr > Walker->nr) {
    196197                          OtherWalker = dynamic_cast<atom*>(*OtherRunner);
  • src/molecule_pointcloud.cpp

    rba5215 r34c43a  
    3737}
    3838
    39 /** Returns a name for this point cloud, here the molecule's name.
    40  * \return name of point cloud
    41  */
    42 const char * const molecule::GetName() const
    43 {
    44   return name;
    45 };
    46 
    47 /** Determine center of all atoms.
    48  * \param *out output stream for debugging
    49  * \return pointer to allocated with central coordinates
    50  */
    51 Vector *molecule::GetCenter() const
    52 {
    53   Vector *center = DetermineCenterOfAll();
    54   return center;
    55 };
    56 
    57 
    58 /** PointCloud implementation of GoPoint
    59  * Uses atoms and STL stuff.
    60  */
    61 TesselPoint* molecule::GetPoint() const
    62 {
    63   return (*InternalPointer);
    64 };
    65 
    66 /** PointCloud implementation of GoToNext.
    67  * Uses atoms and STL stuff.
    68  */
    69 void molecule::GoToNext() const
    70 {
    71   if (InternalPointer != atoms.end())
    72     InternalPointer++;
    73 };
    74 
    75 /** PointCloud implementation of GoToFirst.
    76  * Uses atoms and STL stuff.
    77  */
    78 void molecule::GoToFirst() const
    79 {
    80   // evil hack necessary because
    81   // -# although InternalPointer is mutable
    82   // -# only const_iterator begin() is called due to const in the function declaration above
    83   // -# and there is no cast from const_iterator to const iterator
    84   atomSet::const_iterator test = begin();
    85   InternalPointer = *(reinterpret_cast<atomSet::iterator *>(&test));
    86 };
    87 
    88 /** PointCloud implementation of IsEmpty.
    89  * Uses atoms and STL stuff.
    90  */
    91 bool molecule::IsEmpty() const
    92 {
    93   return (empty());
    94 };
    95 
    96 /** PointCloud implementation of IsLast.
    97  * Uses atoms and STL stuff.
    98  */
    99 bool molecule::IsEnd() const
    100 {
    101   return (InternalPointer == atoms.end());
    102 };
    103 
    104 int molecule::GetMaxId() const {
    105   return getAtomCount();
    106 }
  • src/tesselation.cpp

    rba5215 r34c43a  
    2323#include <iomanip>
    2424
    25 #include "Helpers/helpers.hpp"
    26 #include "CodePatterns/Info.hpp"
    2725#include "BoundaryPointSet.hpp"
    2826#include "BoundaryLineSet.hpp"
    2927#include "BoundaryTriangleSet.hpp"
    3028#include "BoundaryPolygonSet.hpp"
    31 #include "TesselPoint.hpp"
    3229#include "CandidateForTesselation.hpp"
    33 #include "PointCloud.hpp"
    34 #include "linkedcell.hpp"
     30#include "CodePatterns/Assert.hpp"
     31#include "CodePatterns/Info.hpp"
     32#include "CodePatterns/IteratorAdaptors.hpp"
    3533#include "CodePatterns/Log.hpp"
    36 #include "tesselation.hpp"
    37 #include "tesselationhelpers.hpp"
    38 #include "triangleintersectionlist.hpp"
     34#include "CodePatterns/Verbose.hpp"
     35#include "Exceptions/LinearDependenceException.hpp"
     36#include "Helpers/fast_functions.hpp"
     37#include "Helpers/helpers.hpp"
     38#include "IPointCloud.hpp"
    3939#include "LinearAlgebra/Vector.hpp"
    4040#include "LinearAlgebra/Line.hpp"
    4141#include "LinearAlgebra/vector_ops.hpp"
    42 #include "CodePatterns/Verbose.hpp"
    4342#include "LinearAlgebra/Plane.hpp"
    44 #include "Exceptions/LinearDependenceException.hpp"
    45 #include "CodePatterns/Assert.hpp"
    46 
    47 #include "Helpers/fast_functions.hpp"
     43#include "linkedcell.hpp"
     44#include "PointCloudAdaptor.hpp"
     45#include "tesselation.hpp"
     46#include "tesselationhelpers.hpp"
     47#include "TesselPoint.hpp"
     48#include "triangleintersectionlist.hpp"
    4849
    4950class molecule;
     
    8687  DoLog(0) && (Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl);
    8788}
    88 ;
    89 
    90 TesselPoint * Tesselation::getValue(const_iterator &rhs) const
    91 {
    92   return (*rhs).second->node;
    93 }
    94 
    95 TesselPoint * Tesselation::getValue(iterator &rhs) const
    96 {
    97   return (*rhs).second->node;
    98 }
    99 
    100 const char * const Tesselation::GetName() const
    101 {
    102   return "unknown";
    103 }
    104 
    105 /** PointCloud implementation of GetCenter
    106  * Uses PointsOnBoundary and STL stuff.
    107  */
    108 Vector * Tesselation::GetCenter() const
    109 {
    110   Info FunctionInfo(__func__);
    111   Vector *Center = new Vector(0., 0., 0.);
    112   int num = 0;
    113   for (GoToFirst(); (!IsEnd()); GoToNext()) {
    114     (*Center) += (GetPoint()->getPosition());
    115     num++;
    116   }
    117   Center->Scale(1. / num);
    118   return Center;
    119 }
    120 ;
    121 
    122 /** PointCloud implementation of GoPoint
    123  * Uses PointsOnBoundary and STL stuff.
    124  */
    125 TesselPoint * Tesselation::GetPoint() const
    126 {
    127   Info FunctionInfo(__func__);
    128   return (InternalPointer->second->node);
    129 }
    130 ;
    131 
    132 int Tesselation::GetMaxId() const
    133 {
    134   int max_id = 0;
    135   for (PointMap::const_iterator iter = PointsOnBoundary.begin();
    136       iter != PointsOnBoundary.end();
    137       ++iter) {
    138     if ((iter->second)->node->nr > max_id)
    139       (iter->second)->node->nr = max_id;
    140   }
    141   return max_id;
    142 }
    143 
    144 /** PointCloud implementation of GoToNext.
    145  * Uses PointsOnBoundary and STL stuff.
    146  */
    147 void Tesselation::GoToNext() const
    148 {
    149   Info FunctionInfo(__func__);
    150   if (InternalPointer != PointsOnBoundary.end())
    151     InternalPointer++;
    152 }
    153 ;
    154 
    155 /** PointCloud implementation of GoToFirst.
    156  * Uses PointsOnBoundary and STL stuff.
    157  */
    158 void Tesselation::GoToFirst() const
    159 {
    160   Info FunctionInfo(__func__);
    161   InternalPointer = PointsOnBoundary.begin();
    162 }
    163 ;
    164 
    165 /** PointCloud implementation of IsEmpty.
    166  * Uses PointsOnBoundary and STL stuff.
    167  */
    168 bool Tesselation::IsEmpty() const
    169 {
    170   Info FunctionInfo(__func__);
    171   return (PointsOnBoundary.empty());
    172 }
    173 ;
    174 
    175 /** PointCloud implementation of IsLast.
    176  * Uses PointsOnBoundary and STL stuff.
    177  */
    178 bool Tesselation::IsEnd() const
    179 {
    180   Info FunctionInfo(__func__);
    181   return (InternalPointer == PointsOnBoundary.end());
    182 }
    183 ;
    18489
    18590/** Gueses first starting triangle of the convex envelope.
     
    318223 * \param *cloud cluster of points
    319224 */
    320 void Tesselation::TesselateOnBoundary(const PointCloud * const cloud)
     225void Tesselation::TesselateOnBoundary(IPointCloud & cloud)
    321226{
    322227  Info FunctionInfo(__func__);
     
    328233  LineMap::iterator LineChecker[2];
    329234
    330   Center = cloud->GetCenter();
     235  Center = cloud.GetCenter();
    331236  // create a first tesselation with the given BoundaryPoints
    332237  do {
     
    509414 * \return true - all straddling points insert, false - something went wrong
    510415 */
    511 bool Tesselation::InsertStraddlingPoints(const PointCloud *cloud, const LinkedCell *LC)
     416bool Tesselation::InsertStraddlingPoints(IPointCloud & cloud, const LinkedCell *LC)
    512417{
    513418  Info FunctionInfo(__func__);
    514419  Vector Intersection, Normal;
    515420  TesselPoint *Walker = NULL;
    516   Vector *Center = cloud->GetCenter();
     421  Vector *Center = cloud.GetCenter();
    517422  TriangleList *triangles = NULL;
    518423  bool AddFlag = false;
     
    520425  bool SuccessFlag = true;
    521426
    522   cloud->GoToFirst();
    523   BoundaryPoints = new LinkedCell(*this, 5.);
    524   while (!cloud->IsEnd()) { // we only have to go once through all points, as boundary can become only bigger
     427  cloud.GoToFirst();
     428  PointCloudAdaptor< Tesselation, MapValueIterator<Tesselation::iterator> > newcloud(this);
     429  BoundaryPoints = new LinkedCell(newcloud, 5.);
     430  while (!cloud.IsEnd()) { // we only have to go once through all points, as boundary can become only bigger
    525431    if (AddFlag) {
    526432      delete (BoundaryPoints);
    527       BoundaryPoints = new LinkedCell(*this, 5.);
     433      BoundaryPoints = new LinkedCell(newcloud, 5.);
    528434      AddFlag = false;
    529435    }
    530     Walker = cloud->GetPoint();
     436    Walker = cloud.GetPoint();
    531437    DoLog(0) && (Log() << Verbose(0) << "Current point is " << *Walker << "." << endl);
    532438    // get the next triangle
     
    539445    if ((BTS == NULL) || (BTS->ContainsBoundaryPoint(Walker))) {
    540446      DoLog(0) && (Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl);
    541       cloud->GoToNext();
     447      cloud.GoToNext();
    542448      continue;
    543449    } else {
     
    610516      break;
    611517    }
    612     cloud->GoToNext();
     518    cloud.GoToNext();
    613519  }
    614520
     
    11221028    for (LC->n[map[1]] = 0; LC->n[map[1]] < LC->N[map[1]]; LC->n[map[1]]++)
    11231029      for (LC->n[map[2]] = 0; LC->n[map[2]] < LC->N[map[2]]; LC->n[map[2]]++) {
    1124         const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     1030        const TesselPointSTLList *List = LC->GetCurrentCell();
    11251031        //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    11261032        if (List != NULL) {
    1127           for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     1033          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    11281034            if ((*Runner)->at(map[0]) > maxCoordinate[map[0]]) {
    11291035              DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << map[0] << " node is " << *(*Runner) << " at " << (*Runner)->getPosition() << "." << endl);
     
    19821888    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    19831889      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    1984         const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     1890        const TesselPointSTLList *List = LC->GetCurrentCell();
    19851891        //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    19861892        if (List != NULL) {
    1987           for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     1893          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    19881894            Candidate = (*Runner);
    19891895            // check if we only have one unique point yet ...
     
    21402046        for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    21412047          for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    2142             const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     2048            const TesselPointSTLList *List = LC->GetCurrentCell();
    21432049            //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    21442050            if (List != NULL) {
    2145               for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     2051              for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    21462052                Candidate = (*Runner);
    21472053
     
    23132219    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    23142220      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    2315         const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     2221        const TesselPointSTLList *List = LC->GetCurrentCell();
    23162222        //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
    23172223        if (List != NULL) {
    2318           for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     2224          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    23192225            FindPoint = PointsOnBoundary.find((*Runner)->nr);
    23202226            if (FindPoint != PointsOnBoundary.end()) {
     
    37103616 * \param *out otuput stream for debugging
    37113617 * \param *filename basename of output file
    3712  * \param *cloud PointCloud structure with all nodes
    3713  */
    3714 void Tesselation::Output(const char *filename, const PointCloud * const cloud)
     3618 * \param *cloud IPointCloud structure with all nodes
     3619 */
     3620void Tesselation::Output(const char *filename, IPointCloud & cloud)
    37153621{
    37163622  Info FunctionInfo(__func__);
  • src/tesselation.hpp

    rba5215 r34c43a  
    2626#include <stack>
    2727
     28#include "atom_particleinfo.hpp"
    2829#include "BoundaryMaps.hpp"
    2930#include "BoundaryPointSet.hpp"
    30 #include "PointCloud.hpp"
    31 #include "TesselPoint.hpp"
    32 #include "atom_particleinfo.hpp"
    3331#include "Helpers/helpers.hpp"
    3432#include "LinearAlgebra/Vector.hpp"
     33#include "TesselPoint.hpp"
    3534
    3635
     
    4140class BoundaryTriangleSet;
    4241class CandidateForTesselation;
     42class IPointCloud;
    4343class LinkedCell;
     44class Plane;
    4445class Tesselation;
    45 class Plane;
    4646
    4747/********************************************** definitions *********************************/
     
    6363// =========================================================== class TESSELATION ===========================================
    6464
    65 /** Contains the envelope to a PointCloud.
     65/** Is iterable container of TesselPoints.
    6666 */
    67 class Tesselation : public PointCloud {
     67class Tesselation {
    6868  public:
    6969
     
    9797
    9898    // convex envelope
    99     void TesselateOnBoundary(const PointCloud * const cloud);
     99    void TesselateOnBoundary(IPointCloud & cloud);
    100100    void GuessStartingTriangle();
    101     bool InsertStraddlingPoints(const PointCloud *cloud, const LinkedCell *LC);
     101    bool InsertStraddlingPoints(IPointCloud & cloud, const LinkedCell *LC);
    102102    double RemovePointFromTesselatedSurface(class BoundaryPointSet *point);
    103103    class BoundaryLineSet * FlipBaseline(class BoundaryLineSet *Base);
     
    134134
    135135    // store envelope in file
    136     void Output(const char *filename, const PointCloud * const cloud);
     136    void Output(const char *filename, IPointCloud & cloud);
    137137
    138138    PointMap PointsOnBoundary;
     
    146146    typedef PointMap::iterator iterator;
    147147    typedef PointMap::const_iterator const_iterator;
    148     TesselPoint * getValue(const_iterator &rhs) const;
    149     TesselPoint * getValue(iterator &rhs) const;
    150148    iterator begin() { return PointsOnBoundary.begin(); }
    151149    const_iterator begin() const { return PointsOnBoundary.begin(); }
    152150    iterator end() { return PointsOnBoundary.end(); }
    153151    const_iterator end() const { return PointsOnBoundary.end(); }
    154     // PointCloud implementation for PointsOnBoundary
    155     const char * const GetName() const;
    156     Vector *GetCenter() const;
    157     TesselPoint *GetPoint() const;
    158     int GetMaxId() const;
    159     void GoToNext() const;
    160     void GoToFirst() const;
    161     bool IsEmpty() const;
    162     bool IsEnd() const;
    163152
    164153    class BoundaryPointSet *BPS[2];
     
    179168};
    180169
    181 
    182170#endif /* TESSELATION_HPP_ */
  • src/tesselationhelpers.cpp

    rba5215 r34c43a  
    2828#include "CandidateForTesselation.hpp"
    2929#include "CodePatterns/Info.hpp"
     30#include "CodePatterns/Log.hpp"
     31#include "CodePatterns/Verbose.hpp"
     32#include "IPointCloud.hpp"
     33#include "LinearAlgebra/Line.hpp"
     34#include "LinearAlgebra/LinearSystemOfEquations.hpp"
     35#include "LinearAlgebra/Plane.hpp"
     36#include "LinearAlgebra/RealSpaceMatrix.hpp"
     37#include "LinearAlgebra/Vector.hpp"
     38#include "LinearAlgebra/vector_ops.hpp"
    3039#include "linkedcell.hpp"
    31 #include "LinearAlgebra/LinearSystemOfEquations.hpp"
    32 #include "CodePatterns/Log.hpp"
    3340#include "tesselation.hpp"
    3441#include "tesselationhelpers.hpp"
    35 #include "LinearAlgebra/Vector.hpp"
    36 #include "LinearAlgebra/Line.hpp"
    37 #include "LinearAlgebra/vector_ops.hpp"
    38 #include "CodePatterns/Verbose.hpp"
    39 #include "LinearAlgebra/Plane.hpp"
    40 #include "LinearAlgebra/RealSpaceMatrix.hpp"
    4142
    4243void GetSphere(Vector * const center, const Vector &a, const Vector &b, const Vector &c, const double RADIUS)
     
    427428    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    428429      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    429         const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     430        const TesselPointSTLList *List = LC->GetCurrentCell();
    430431        //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
    431432        if (List != NULL) {
    432           for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     433          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    433434            helper = (Point) - ((*Runner)->getPosition());
    434435            double currentNorm = helper. Norm();
     
    480481    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    481482      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    482         const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
     483        const TesselPointSTLList *List = LC->GetCurrentCell();
    483484        //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
    484485        if (List != NULL) {
    485           for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     486          for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    486487            helper = (Point) - ((*Runner)->getPosition());
    487488            double currentNorm = helper.NormSquared();
     
    569570 * \param *mol molecule structure with atom positions
    570571 */
    571 void WriteVrmlFile(ofstream * const vrmlfile, const Tesselation * const Tess, const PointCloud * const cloud)
     572void WriteVrmlFile(ofstream * const vrmlfile, const Tesselation * const Tess, IPointCloud & cloud)
    572573{
    573574        Info FunctionInfo(__func__);
    574575  TesselPoint *Walker = NULL;
    575576  int i;
    576   Vector *center = cloud->GetCenter();
     577  Vector *center = cloud.GetCenter();
    577578  if (vrmlfile != NULL) {
    578579    //Log() << Verbose(1) << "Writing Raster3D file ... ";
     
    580581    *vrmlfile << "#Created by molecuilder" << endl;
    581582    *vrmlfile << "#All atoms as spheres" << endl;
    582     cloud->GoToFirst();
    583     while (!cloud->IsEnd()) {
    584       Walker = cloud->GetPoint();
     583    cloud.GoToFirst();
     584    while (!cloud.IsEnd()) {
     585      Walker = cloud.GetPoint();
    585586      *vrmlfile << "Sphere {" << endl << "  "; // 2 is sphere type
    586587      for (i=0;i<NDIM;i++)
    587588        *vrmlfile << Walker->at(i)-center->at(i) << " ";
    588589      *vrmlfile << "\t0.1\t1. 1. 1." << endl; // radius 0.05 and white as colour
    589       cloud->GoToNext();
     590      cloud.GoToNext();
    590591    }
    591592
     
    613614 * \param *mol molecule structure with atom positions
    614615 */
    615 void IncludeSphereinRaster3D(ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud)
     616void IncludeSphereinRaster3D(ofstream * const rasterfile, const Tesselation * const Tess, IPointCloud & cloud)
    616617{
    617618        Info FunctionInfo(__func__);
     
    620621  if (Tess->LastTriangle != NULL) {
    621622    // include the current position of the virtual sphere in the temporary raster3d file
    622     Vector *center = cloud->GetCenter();
     623    Vector *center = cloud.GetCenter();
    623624    // make the circumsphere's center absolute again
    624625    Vector helper = (1./3.) * ((Tess->LastTriangle->endpoints[0]->node->getPosition()) +
     
    641642 * \param *mol molecule structure with atom positions
    642643 */
    643 void WriteRaster3dFile(ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud)
     644void WriteRaster3dFile(ofstream * const rasterfile, const Tesselation * const Tess, IPointCloud & cloud)
    644645{
    645646        Info FunctionInfo(__func__);
    646647  TesselPoint *Walker = NULL;
    647648  int i;
    648   Vector *center = cloud->GetCenter();
     649  Vector *center = cloud.GetCenter();
    649650  if (rasterfile != NULL) {
    650651    //Log() << Verbose(1) << "Writing Raster3D file ... ";
     
    652653    *rasterfile << "@header.r3d" << endl;
    653654    *rasterfile << "# All atoms as spheres" << endl;
    654     cloud->GoToFirst();
    655     while (!cloud->IsEnd()) {
    656       Walker = cloud->GetPoint();
     655    cloud.GoToFirst();
     656    while (!cloud.IsEnd()) {
     657      Walker = cloud.GetPoint();
    657658      *rasterfile << "2" << endl << "  ";  // 2 is sphere type
    658659      for (int j=0;j<NDIM;j++) { // and for each node all NDIM coordinates
     
    661662      }
    662663      *rasterfile << "\t0.1\t1. 1. 1." << endl; // radius 0.05 and white as colour
    663       cloud->GoToNext();
     664      cloud.GoToNext();
    664665    }
    665666
     
    691692 * \param N arbitrary number to differentiate various zones in the tecplot format
    692693 */
    693 void WriteTecplotFile(ofstream * const tecplot, const Tesselation * const TesselStruct, const PointCloud * const cloud, const int N)
     694void WriteTecplotFile(ofstream * const tecplot, const Tesselation * const TesselStruct, IPointCloud & cloud, const int N)
    694695{
    695696        Info FunctionInfo(__func__);
     
    700701    *tecplot << "ZONE T=\"";
    701702    if (N < 0) {
    702       *tecplot << cloud->GetName();
     703      *tecplot << cloud.GetName();
    703704    } else {
    704705      *tecplot << N << "-";
     
    711712    }
    712713    *tecplot << "\", N=" << TesselStruct->PointsOnBoundary.size() << ", E=" << TesselStruct->TrianglesOnBoundary.size() << ", DATAPACKING=POINT, ZONETYPE=FETRIANGLE" << endl;
    713     const int MaxId=cloud->GetMaxId();
    714     int *LookupList = new int[MaxId];
    715     for (int i=0; i< MaxId ; i++){
     714    const int MaxId=cloud.GetMaxId();
     715    ASSERT(MaxId >= 0, "WriteTecplotFile() - negative MaxId? No atoms present?");
     716    int *LookupList = new int[MaxId+1];
     717    for (int i=0; i<= MaxId ; i++){
    716718      LookupList[i] = -1;
    717719    }
     
    722724    for (PointMap::const_iterator target = TesselStruct->PointsOnBoundary.begin(); target != TesselStruct->PointsOnBoundary.end(); ++target) {
    723725      Walker = target->second->node;
     726      ASSERT(Walker->nr <= MaxId, "WriteTecplotFile() - Id of particle greater than MaxId.");
    724727      LookupList[Walker->nr] = Counter++;
    725728      for (int i=0;i<NDIM;i++) {
  • src/tesselationhelpers.hpp

    rba5215 r34c43a  
    3434class LinkedCell;
    3535class TesselPoint;
    36 class PointCloud;
     36class IPointCloud;
    3737class Tesselation;
    3838class Vector;
     
    5656Vector * GetClosestPointBetweenLine(const BoundaryLineSet * const Base, const BoundaryLineSet * const OtherBase);
    5757
    58 void WriteTecplotFile(ofstream * const tecplot, const Tesselation * const TesselStruct, const PointCloud * const cloud, const int N);
    59 void WriteRaster3dFile(ofstream * const rasterfile, const Tesselation * const Tess, const PointCloud * const cloud);
    60 void IncludeSphereinRaster3D(ofstream * const rasterfile, const Tesselation *Tess, const PointCloud *cloud);
    61 void WriteVrmlFile(ofstream * const vrmlfile, const Tesselation * const Tess, const PointCloud * const cloud);
     58void WriteTecplotFile(ofstream * const tecplot, const Tesselation * const TesselStruct, IPointCloud & cloud, const int N);
     59void WriteRaster3dFile(ofstream * const rasterfile, const Tesselation * const Tess, IPointCloud & cloud);
     60void IncludeSphereinRaster3D(ofstream * const rasterfile, const Tesselation *Tess, IPointCloud & cloud);
     61void WriteVrmlFile(ofstream * const vrmlfile, const Tesselation * const Tess, IPointCloud & cloud);
    6262void CalculateConcavityPerBoundaryPoint(const Tesselation * const TesselStruct);
    6363void CalculateConstrictionPerBoundaryPoint(const Tesselation * const TesselStruct, const Tesselation * const Convex);
  • src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp

    rba5215 r34c43a  
    2727
    2828#include "analysis_correlation.hpp"
    29 #include "Descriptors/MoleculeDescriptor.hpp"
    30 
    3129#include "atom.hpp"
    3230#include "boundary.hpp"
     31#include "CodePatterns/Assert.hpp"
     32#include "Descriptors/MoleculeDescriptor.hpp"
    3333#include "element.hpp"
    3434#include "molecule.hpp"
    3535#include "linkedcell.hpp"
    3636#include "periodentafel.hpp"
     37#include "PointCloudAdaptor.hpp"
    3738#include "tesselation.hpp"
    3839#include "World.hpp"
    39 #include "CodePatterns/Assert.hpp"
    4040
    4141#include "AnalysisCorrelationToSurfaceUnitTest.hpp"
     
    100100  // init tesselation and linked cell
    101101  Surface = new Tesselation;
    102   LC = new LinkedCell(*TestSurfaceMolecule, 5.);
     102  PointCloudAdaptor<molecule> cloud(TestSurfaceMolecule);
     103  LC = new LinkedCell(cloud, 5.);
    103104  FindNonConvexBorder(TestSurfaceMolecule, Surface, (const LinkedCell *&)LC, 2.5, NULL);
    104105
  • src/unittests/LinkedCellUnitTest.cpp

    rba5215 r34c43a  
    2929
    3030#include "atom.hpp"
     31#include "Descriptors/MoleculeDescriptor.hpp"
    3132#include "element.hpp"
    3233#include "linkedcell.hpp"
    3334#include "molecule.hpp"
    3435#include "periodentafel.hpp"
     36#include "PointCloudAdaptor.hpp"
    3537#include "World.hpp"
    3638
     
    6971
    7072  // construct linked cell
    71   LC = new LinkedCell (*TestMolecule, 1.);
     73  PointCloudAdaptor<molecule> cloud(TestMolecule);
     74  LC = new LinkedCell (cloud, 1.);
    7275  CPPUNIT_ASSERT(LC != NULL && "could not create LinkedCell");
    7376
     
    121124  // within bounds
    122125  LC->n[0] = LC->n[1] = LC->n[2] = 0;
    123   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0 * 3*3 + 0 * 3 + 0], LC->GetCurrentCell() );
    124   LC->n[0] = LC->n[1] = LC->n[2] = 1;
    125   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[1 * 3*3 + 1 * 3 + 1], LC->GetCurrentCell() );
     126  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[0 * 3*3 + 0 * 3 + 0], LC->GetCurrentCell() );
     127  LC->n[0] = LC->n[1] = LC->n[2] = 1;
     128  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[1 * 3*3 + 1 * 3 + 1], LC->GetCurrentCell() );
    126129  LC->n[0] = LC->n[1] = LC->n[2] = 2;
    127   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetCurrentCell() );
     130  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetCurrentCell() );
    128131
    129132  // out of bounds
    130133  LC->n[0] = LC->n[1] = LC->n[2] = 3;
    131134  cout << "The following test is supposed to fail and produce an ERROR." << endl;
    132   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetCurrentCell() );
     135  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetCurrentCell() );
    133136  LC->n[0] = LC->n[1] = LC->n[2] = -1;
    134137  cout << "The following test is supposed to fail and produce an ERROR." << endl;
    135   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetCurrentCell() );
     138  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetCurrentCell() );
    136139};
    137140
     
    145148  offset[0] = offset[1] = offset[2] = 0;
    146149  LC->n[0] = LC->n[1] = LC->n[2] = 0;
    147   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );
     150  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );
    148151  offset[0] = offset[1] = offset[2] = -1;
    149152  LC->n[0] = LC->n[1] = LC->n[2] = 1;
    150   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );
     153  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );
    151154  offset[0] = offset[1] = offset[2] = -2;
    152155  LC->n[0] = LC->n[1] = LC->n[2] = 2;
    153   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );
     156  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[0], LC->GetRelativeToCurrentCell(offset) );
    154157
    155158  // offset to (0,0,0) - 1.*(x/y/z) out of bounds
     
    158161  LC->n[0] = LC->n[1] = LC->n[2] = 0;
    159162  cout << "The following test is supposed to fail and produce an ERROR." << endl;
    160   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
     163  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) );
    161164  offset[0] = offset[1] = offset[2] = 0;
    162165  offset[1] = -1;
    163166  LC->n[0] = LC->n[1] = LC->n[2] = 0;
    164167  cout << "The following test is supposed to fail and produce an ERROR." << endl;
    165   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
     168  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) );
    166169  offset[0] = offset[1] = offset[2] = 0;
    167170  offset[2] = -1;
    168171  LC->n[0] = LC->n[1] = LC->n[2] = 0;
    169172  cout << "The following test is supposed to fail and produce an ERROR." << endl;
    170   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
     173  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) );
    171174
    172175  // out of bounds
     
    174177  LC->n[0] = LC->n[1] = LC->n[2] = 1;
    175178  cout << "The following test is supposed to fail and produce an ERROR." << endl;
    176   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
     179  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) );
    177180  offset[0] = offset[1] = offset[2] = 192345;
    178181  LC->n[0] = LC->n[1] = LC->n[2] = 1;
    179182  cout << "The following test is supposed to fail and produce an ERROR." << endl;
    180   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
     183  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) );
    181184
    182185  // index is out of bounds, offset points within
    183186  offset[0] = offset[1] = offset[2] = -2;
    184187  LC->n[0] = LC->n[1] = LC->n[2] = 4;
    185   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetRelativeToCurrentCell(offset) );
     188  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)&LC->LC[2 * 3*3 + 2 * 3 + 2], LC->GetRelativeToCurrentCell(offset) );
    186189
    187190  // index is within bounds, offset points out
     
    189192  LC->n[0] = LC->n[1] = LC->n[2] = 2;
    190193  cout << "The following test is supposed to fail and produce an ERROR." << endl;
    191   CPPUNIT_ASSERT_EQUAL( (const LinkedCell::LinkedNodes*)NULL, LC->GetRelativeToCurrentCell(offset) );
     194  CPPUNIT_ASSERT_EQUAL( (const TesselPointSTLList*)NULL, LC->GetRelativeToCurrentCell(offset) );
    192195};
    193196
     
    276279{
    277280  Vector tester;
    278   LinkedCell::LinkedNodes *ListOfPoints = NULL;
     281  TesselPointSTLList *ListOfPoints = NULL;
    279282  size_t size = 0;
    280283
     
    337340{
    338341  Vector tester;
    339   LinkedCell::LinkedNodes *ListOfPoints = NULL;
     342  TesselPointSTLList *ListOfPoints = NULL;
    340343  size_t size = 0;
    341344
  • src/unittests/TesselationUnitTest.cpp

    rba5215 r34c43a  
    2626#include <cstring>
    2727
    28 #include "Helpers/defs.hpp"
    29 #include "TesselPoint.hpp"
    3028#include "BoundaryLineSet.hpp"
    3129#include "BoundaryTriangleSet.hpp"
    3230#include "CandidateForTesselation.hpp"
     31#include "Helpers/defs.hpp"
     32#include "PointCloudAdaptor.hpp"
     33#include "TesselPoint.hpp"
    3334
    3435#include "TesselationUnitTest.hpp"
     
    7273
    7374  // create linkedcell
    74   LinkedList = new LinkedCell(Corners, 2.*SPHERERADIUS);
     75  PointCloudAdaptor<TesselPointSTLList> cloud(&Corners);
     76  LinkedList = new LinkedCell(cloud, 2.*SPHERERADIUS);
    7577
    7678  // create tesselation
     
    116118  delete(LinkedList);
    117119  delete(TesselStruct);
    118   for (LinkedCell::LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++)
     120  for (TesselPointSTLList::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++)
    119121    delete(*Runner);
    120122  Corners.clear();
  • src/unittests/TesselationUnitTest.hpp

    rba5215 r34c43a  
    4242
    4343      class Tesselation *TesselStruct;
    44       LinkedCell::LinkedNodes Corners;
     44      TesselPointSTLList Corners;
    4545      class LinkedCell *LinkedList;
    4646};
  • src/unittests/Tesselation_BoundaryTriangleUnitTest.hpp

    rba5215 r34c43a  
    4646      class BoundaryPointSet *points[3];
    4747      class TesselPoint *tesselpoints[3];
    48       LinkedCell::LinkedNodes Corners;
     48      TesselPointSTLList Corners;
    4949};
    5050
  • src/unittests/Tesselation_InsideOutsideUnitTest.cpp

    rba5215 r34c43a  
    2727#include <iostream>
    2828
    29 #include "Helpers/defs.hpp"
    30 #include "TesselPoint.hpp"
    3129#include "BoundaryLineSet.hpp"
    3230#include "BoundaryTriangleSet.hpp"
    3331#include "CandidateForTesselation.hpp"
    3432#include "CodePatterns/Verbose.hpp"
     33#include "Helpers/defs.hpp"
     34#include "PointCloudAdaptor.hpp"
     35#include "TesselPoint.hpp"
    3536
    3637#include "Tesselation_InsideOutsideUnitTest.hpp"
     
    9596
    9697  // create linkedcell
    97   LinkedList = new LinkedCell(Corners, 2.*SPHERERADIUS);
     98  PointCloudAdaptor< TesselPointSTLList > cloud(&Corners);
     99  LinkedList = new LinkedCell(cloud, 2.*SPHERERADIUS);
    98100
    99101  // create tesselation
     
    146148  delete(LinkedList);
    147149  delete(TesselStruct);
    148   for (LinkedCell::LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++)
     150  for (TesselPointSTLList::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++)
    149151    delete(*Runner);
    150152  Corners.clear();
  • src/unittests/Tesselation_InsideOutsideUnitTest.hpp

    rba5215 r34c43a  
    3939
    4040      class Tesselation *TesselStruct;
    41       LinkedCell::LinkedNodes Corners;
     41      TesselPointSTLList Corners;
    4242      class LinkedCell *LinkedList;
    4343};
  • tests/regression/Tesselation/BigConvex/testsuite-tesselation-big-convex-envelope.at

    rba5215 r34c43a  
    22
    33AT_SETUP([Tesselation - big convex Envelope])
     4AT_KEYWORDS([Tesselation,convex])
    45AT_XFAIL_IF([/bin/true])
    5 AT_KEYWORDS([Tesselation])
    66AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Tesselation/BigConvex/pre/* .], 0)
    77AT_CHECK([../../molecuilder -i test.conf  --select-molecule-by-id 0 --convex-envelope --convex-file ConvexEnvelope --nonconvex-file NonConvexEnvelope], 0, [stdout], [stderr])
  • tests/regression/Tesselation/BigNonConvex/testsuite-tesselation-big-non-convex-envelope.at

    rba5215 r34c43a  
    22
    33AT_SETUP([Tesselation - Big non-Convex Envelope])
     4AT_KEYWORDS([Tesselation,nonconvex])
     5AT_XFAIL_IF([/bin/true])
    46AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Tesselation/BigNonConvex/pre/* .], 0)
    57AT_CHECK([../../molecuilder -i test.conf  --select-molecule-by-id 0 -N 4. --nonconvex-file NonConvexEnvelope], 0, [stdout], [stderr])
  • tests/regression/Tesselation/Convex/testsuite-tesselation-convex-envelope.at

    rba5215 r34c43a  
    22
    33AT_SETUP([Tesselation - Convex Envelope])
     4AT_KEYWORDS([Tesselation,convex])
     5AT_XFAIL_IF([/bin/true])
    46AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Tesselation/Convex/pre/* .], 0)
    57AT_CHECK([../../molecuilder -i test.conf  --select-molecule-by-id 0 --convex-envelope --convex-file ConvexEnvelope --nonconvex-file NonConvexEnvelope], 0, [stdout], [stderr])
  • tests/regression/Tesselation/NonConvex/testsuite-tesselation-non-convex-envelope.at

    rba5215 r34c43a  
    22
    33AT_SETUP([Tesselation - Non-Convex Envelope])
    4 AT_KEYWORDS([Tesselation])
     4AT_KEYWORDS([Tesselation,nonconvex])
     5AT_XFAIL_IF([/bin/true])
    56AT_CHECK([/bin/cp -f ${abs_top_srcdir}/${AUTOTEST_PATH}/Tesselation/NonConvex/pre/* .], 0)
    67AT_CHECK([../../molecuilder -i test.conf  --select-molecule-by-id 0 -N 4. --nonconvex-file NonConvexEnvelope], 0, [stdout], [stderr])
Note: See TracChangeset for help on using the changeset viewer.