Changeset 8b7e0a for molecuilder


Ignore:
Timestamp:
Aug 21, 2009, 12:17:52 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
b73929
Parents:
5f4960
Message:

New function RemoveAllBoundaryPoints() for sequentially removing all boundary points.

  • This is meant as a pre-test for the ConvexizeNonconvexTesselation().
  • new function is incorporated into builder.cpp:ParseCommandLineOptions for case 'o'
Location:
molecuilder/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/boundary.cpp

    r5f4960 r8b7e0a  
    578578};
    579579
     580/** For testing removes one boundary point after another to check for leaks.
     581 * \param *out output stream for debugging
     582 * \param *TesselStruct Tesselation containing envelope with boundary points
     583 * \param *mol molecule
     584 * \param *filename name of file
     585 * \return true - all removed, false - something went wrong
     586 */
     587bool RemoveAllBoundaryPoints(ofstream *out, class Tesselation *TesselStruct, molecule *mol, char *filename)
     588{
     589  int i=0;
     590  char number[MAXSTRINGSIZE];
     591
     592  if ((TesselStruct == NULL) || (TesselStruct->PointsOnBoundary.empty())) {
     593    *out << Verbose(2) << "ERROR: TesselStruct is empty." << endl;
     594    return false;
     595  }
     596
     597  PointMap::iterator PointRunner;
     598  while (!TesselStruct->PointsOnBoundary.empty()) {
     599    *out << Verbose(2) << "Remaining points are: ";
     600    for (PointMap::iterator PointSprinter = TesselStruct->PointsOnBoundary.begin(); PointSprinter != TesselStruct->PointsOnBoundary.end(); PointSprinter++)
     601      *out << *(PointSprinter->second) << "\t";
     602      *out << endl;
     603
     604    PointRunner = TesselStruct->PointsOnBoundary.begin();
     605    // remove point
     606    TesselStruct->RemovePointFromTesselatedSurface(out, PointRunner->second);
     607
     608    // store envelope
     609    sprintf(number, "-%04d", i++);
     610    StoreTrianglesinFile(out, mol, filename, number);
     611  }
     612
     613  return true;
     614};
     615
    580616/** Creates a convex envelope from a given non-convex one.
    581617 * -# First step, remove concave spots, i.e. singular "dents"
  • molecuilder/src/boundary.hpp

    r5f4960 r8b7e0a  
    4444void CalculateConcavityPerBoundaryPoint(ofstream *out, class Tesselation *TesselStruct);
    4545void StoreTrianglesinFile(ofstream *out, molecule *mol, const char *filename, const char *extraSuffix);
     46bool RemoveAllBoundaryPoints(ofstream *out, class Tesselation *TesselStruct, molecule *mol, char *filename);
    4647
    4748
  • molecuilder/src/builder.cpp

    r5f4960 r8b7e0a  
    18731873                //FindConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr]);
    18741874                FindNonConvexBorder((ofstream *)&cout, mol, &LCList, argv[argptr], 10.);
    1875 
    1876                 double volumedifference = ConvexizeNonconvexEnvelope((ofstream *)&cout, mol->TesselStruct, mol, argv[argptr]);
    1877                 double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, mol->TesselStruct, &configuration);
    1878                 cout << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
    1879                 cout << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
     1875                RemoveAllBoundaryPoints((ofstream *)&cout, mol->TesselStruct, mol, argv[argptr]);
     1876//                double volumedifference = ConvexizeNonconvexEnvelope((ofstream *)&cout, mol->TesselStruct, mol, argv[argptr]);
     1877//                double clustervolume = VolumeOfConvexEnvelope((ofstream *)&cout, mol->TesselStruct, &configuration);
     1878//                cout << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
     1879//                cout << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;
    18801880                argptr+=1;
    18811881              }
Note: See TracChangeset for help on using the changeset viewer.