# | Line 45 | Line 45 | |
---|---|---|
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.5 2007-12-06 20:40:30 chuckv Exp $ |
48 | > | * @version $Id: NanoVolume.cpp,v 1.8 2008-10-15 18:26:01 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" | |
# | Line 86 | Line 87 | void NanoVolume::process() { | |
87 | int i,j; | |
88 | ||
89 | #ifdef HAVE_QHULL | |
90 | < | ConvexHull* hull = new ConvexHull(); |
90 | > | ConvexHull* thishull = new ConvexHull(); |
91 | #endif | |
92 | #ifdef HAVE_CGAL | |
93 | < | AlphaShape* hull = new AlphaShape(); |
93 | > | // AlphaShape* hull = new AlphaShape(); |
94 | > | ConvexHull* thishull = new ConvexHull(); |
95 | #endif | |
96 | ||
97 | DumpReader reader(info_, dumpFilename_); | |
98 | int nFrames = reader.getNFrames(); | |
99 | frameCounter_ = 0; | |
100 | ||
101 | < | pos_.reserve(info_->getNGlobalAtoms()); |
101 | > | theAtoms_.reserve(info_->getNGlobalAtoms()); |
102 | ||
103 | for (int istep = 0; istep < nFrames; istep += step_) { | |
104 | reader.readFrame(istep); | |
# | Line 104 | Line 106 | void NanoVolume::process() { | |
106 | currentSnapshot_ = info_->getSnapshotManager()->getCurrentSnapshot(); | |
107 | ||
108 | // Clear pos vector between each frame. | |
109 | < | pos_.clear(); |
109 | > | theAtoms_.clear(); |
110 | ||
111 | if (evaluator_.isDynamic()) { | |
112 | seleMan_.setSelectionSet(evaluator_.evaluate()); | |
# | Line 123 | Line 125 | void NanoVolume::process() { | |
125 | // outer loop is over the selected StuntDoubles: | |
126 | ||
127 | for (sd = seleMan_.beginSelected(i); sd != NULL; | |
128 | < | sd = seleMan_.nextSelected(i)) { |
128 | > | sd = seleMan_.nextSelected(i)) { |
129 | ||
130 | < | pos_.push_back(sd->getPos()); |
130 | > | theAtoms_.push_back(sd); |
131 | myIndex = sd->getGlobalIndex(); | |
132 | ||
133 | } | |
134 | + | |
135 | + | /* |
136 | + | for (mol = info_->beginMolecule(mi); mol != NULL; |
137 | + | mol = info_->nextMolecule(mi)) { |
138 | + | for (atom = mol->beginAtom(ai); atom != NULL; |
139 | + | atom = mol->nextAtom(ai)) { |
140 | + | theAtoms_.push_back(atom); |
141 | + | } |
142 | + | } |
143 | + | */ |
144 | // Generate convex hull for this frame. | |
145 | < | hull->genHull(pos_); |
146 | < | totalVolume_ += hull->getVolume(); |
145 | > | thishull->computeHull(theAtoms_); |
146 | > | // totalVolume_ += hull->getVolume(); |
147 | } | |
148 | < | RealType avgVolume = totalVolume_/(RealType) frameCounter_; |
148 | > | //RealType avgVolume = totalVolume_/(RealType) frameCounter_; |
149 | //std::cout.precision(7); | |
150 | //std::cout << avgVolume << std::endl; | |
151 | < | |
151 | > | /* |
152 | std::ofstream osq(getOutputFileName().c_str()); | |
153 | osq.precision(7); | |
154 | if (osq.is_open()){ | |
# | Line 144 | Line 156 | void NanoVolume::process() { | |
156 | ||
157 | } | |
158 | osq.close(); | |
159 | + | */ |
160 | #else | |
161 | sprintf(painCave.errMsg, "NanoVolume: Neither CGAL nor qhull support was compiled in!\n"); | |
162 | painCave.isFatal = 1; | |
163 | simError(); | |
164 | + | |
165 | #endif | |
166 | + | |
167 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |