--- trunk/src/applications/staticProps/NanoVolume.cpp 2007/12/06 20:40:38 1199 +++ trunk/src/applications/staticProps/NanoVolume.cpp 2009/10/22 14:22:55 1382 @@ -40,12 +40,9 @@ * * NanoVolume.cpp * - * Purpose: To calculate convexhull, hull volume and radius - * using the CGAL library. - * * Created by Charles F. Vardeman II on 14 Dec 2006. * @author Charles F. Vardeman II - * @version $Id: NanoVolume.cpp,v 1.5 2007-12-06 20:40:30 chuckv Exp $ + * @version $Id: NanoVolume.cpp,v 1.9 2009-10-22 14:19:26 gezelter Exp $ * */ @@ -73,7 +70,7 @@ void NanoVolume::process() { } void NanoVolume::process() { -#if defined(HAVE_CGAL) || defined(HAVE_QHULL) +#if defined(HAVE_QHULL) Molecule* mol; Atom* atom; RigidBody* rb; @@ -86,17 +83,14 @@ void NanoVolume::process() { int i,j; #ifdef HAVE_QHULL - ConvexHull* hull = new ConvexHull(); + ConvexHull* thishull = new ConvexHull(); #endif -#ifdef HAVE_CGAL - AlphaShape* hull = new AlphaShape(); -#endif DumpReader reader(info_, dumpFilename_); int nFrames = reader.getNFrames(); frameCounter_ = 0; - pos_.reserve(info_->getNGlobalAtoms()); + theAtoms_.reserve(info_->getNGlobalAtoms()); for (int istep = 0; istep < nFrames; istep += step_) { reader.readFrame(istep); @@ -104,7 +98,7 @@ void NanoVolume::process() { currentSnapshot_ = info_->getSnapshotManager()->getCurrentSnapshot(); // Clear pos vector between each frame. - pos_.clear(); + theAtoms_.clear(); if (evaluator_.isDynamic()) { seleMan_.setSelectionSet(evaluator_.evaluate()); @@ -123,20 +117,30 @@ void NanoVolume::process() { // outer loop is over the selected StuntDoubles: for (sd = seleMan_.beginSelected(i); sd != NULL; - sd = seleMan_.nextSelected(i)) { + sd = seleMan_.nextSelected(i)) { - pos_.push_back(sd->getPos()); + theAtoms_.push_back(sd); myIndex = sd->getGlobalIndex(); } + + /* + for (mol = info_->beginMolecule(mi); mol != NULL; + mol = info_->nextMolecule(mi)) { + for (atom = mol->beginAtom(ai); atom != NULL; + atom = mol->nextAtom(ai)) { + theAtoms_.push_back(atom); + } + } + */ // Generate convex hull for this frame. - hull->genHull(pos_); - totalVolume_ += hull->getVolume(); + thishull->computeHull(theAtoms_); + // totalVolume_ += hull->getVolume(); } - RealType avgVolume = totalVolume_/(RealType) frameCounter_; + //RealType avgVolume = totalVolume_/(RealType) frameCounter_; //std::cout.precision(7); //std::cout << avgVolume << std::endl; - +/* std::ofstream osq(getOutputFileName().c_str()); osq.precision(7); if (osq.is_open()){ @@ -144,9 +148,12 @@ void NanoVolume::process() { } osq.close(); +*/ #else - sprintf(painCave.errMsg, "NanoVolume: Neither CGAL nor qhull support was compiled in!\n"); + sprintf(painCave.errMsg, "NanoVolume: qhull support was not compiled in!\n"); painCave.isFatal = 1; simError(); + #endif + }