| 45 |  | * | 
| 46 |  | *  Created by Charles F. Vardeman II on 14 Dec 2006. | 
| 47 |  | *  @author  Charles F. Vardeman II | 
| 48 | < | *  @version $Id: NanoVolume.cpp,v 1.3 2007-12-06 19:52:11 chuckv Exp $ | 
| 48 | > | *  @version $Id: NanoVolume.cpp,v 1.6 2008-01-08 19:36:28 chuckv Exp $ | 
| 49 |  | * | 
| 50 |  | */ | 
| 51 |  |  | 
| 52 |  | #include "applications/staticProps/NanoVolume.hpp" | 
| 53 |  | #include "math/ConvexHull.hpp" | 
| 54 | + | #include "math/AlphaShape.hpp" | 
| 55 |  | #include "utils/simError.h" | 
| 56 |  | #include "io/DumpReader.hpp" | 
| 57 |  | #include "primitives/Molecule.hpp" | 
| 74 |  | } | 
| 75 |  |  | 
| 76 |  | void NanoVolume::process() { | 
| 77 | < |  | 
| 77 | > | #if defined(HAVE_CGAL) || defined(HAVE_QHULL) | 
| 78 |  | Molecule* mol; | 
| 79 |  | Atom* atom; | 
| 80 |  | RigidBody* rb; | 
| 86 |  | Vector3d vec; | 
| 87 |  | int i,j; | 
| 88 |  |  | 
| 89 | + | #ifdef HAVE_QHULL | 
| 90 |  | ConvexHull* hull = new ConvexHull(); | 
| 91 | + | #endif | 
| 92 | + | #ifdef HAVE_CGAL | 
| 93 | + | AlphaShape* hull = new AlphaShape(); | 
| 94 | + | #endif | 
| 95 |  |  | 
| 96 |  | DumpReader reader(info_, dumpFilename_); | 
| 97 |  | int nFrames = reader.getNFrames(); | 
| 132 |  | } | 
| 133 |  | // Generate convex hull for this frame. | 
| 134 |  | hull->genHull(pos_); | 
| 135 | < | totalVolume_ += hull->getVolume(); | 
| 135 | > | //  totalVolume_ += hull->getVolume(); | 
| 136 |  | } | 
| 137 | < | RealType avgVolume = totalVolume_/(RealType) frameCounter_; | 
| 137 | > | //RealType avgVolume = totalVolume_/(RealType) frameCounter_; | 
| 138 |  | //std::cout.precision(7); | 
| 139 |  | //std::cout  << avgVolume << std::endl; | 
| 140 | < |  | 
| 140 | > | /* | 
| 141 |  | std::ofstream osq(getOutputFileName().c_str()); | 
| 142 |  | osq.precision(7); | 
| 143 |  | if (osq.is_open()){ | 
| 145 |  |  | 
| 146 |  | } | 
| 147 |  | osq.close(); | 
| 148 | + | */ | 
| 149 | + | #else | 
| 150 | + | sprintf(painCave.errMsg, "NanoVolume: Neither CGAL nor qhull support was compiled in!\n"); | 
| 151 | + | painCave.isFatal = 1; | 
| 152 | + | simError(); | 
| 153 |  |  | 
| 154 | + | #endif | 
| 155 | + |  | 
| 156 |  | } |