Improve initAfterFirstFrame() usability
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 10 Aug 2014 04:24:06 +0000 (07:24 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Sun, 10 Aug 2014 07:12:40 +0000 (09:12 +0200)
The initAnalysis() function was changed a long time ago to take the
analysis settings as a parameter, to make it easy to use those values in
initialization without storing them in local variables.
Do the same for initAfterFirstFrame(), now that there is a tool in
pipeline (gmx rdf) that would actually use this function and sees the
same issue there.

Change-Id: Ib10abb3790ac5472070edc76155cfa50cce96541

src/gromacs/trajectoryanalysis/analysismodule.cpp
src/gromacs/trajectoryanalysis/analysismodule.h
src/gromacs/trajectoryanalysis/cmdlinerunner.cpp

index 721bac031e50f2a6964ab1bc0a37de3873089da6..a9ccfd833cfe2bbd0c7cc0328ce7cc022556b0e2 100644 (file)
@@ -293,7 +293,9 @@ void TrajectoryAnalysisModule::optionsFinished(
 }
 
 
-void TrajectoryAnalysisModule::initAfterFirstFrame(const t_trxframe & /*fr*/)
+void TrajectoryAnalysisModule::initAfterFirstFrame(
+        const TrajectoryAnalysisSettings & /*settings*/,
+        const t_trxframe                 & /*fr*/)
 {
 }
 
index 1bee97d8a95a32ede03a24ebf49066245a93ab84..af1cfbbf18bfeb1b86b5996f626ab93514fab5ce 100644 (file)
@@ -295,7 +295,8 @@ class TrajectoryAnalysisModule
          *
          * The default implementation does nothing.
          */
-        virtual void initAfterFirstFrame(const t_trxframe &fr);
+        virtual void initAfterFirstFrame(const TrajectoryAnalysisSettings &settings,
+                                         const t_trxframe                 &fr);
 
         /*! \brief
          * Starts the analysis of frames.
index 426796c5d160092f6bc2e3e8fc46b69e32de192c..9374c26c46cf3ff4883b1a28bb4889652de23f0c 100644 (file)
@@ -195,7 +195,7 @@ TrajectoryAnalysisCommandLineRunner::run(int argc, char *argv[])
 
     // Load first frame.
     common.initFirstFrame();
-    module->initAfterFirstFrame(common.frame());
+    module->initAfterFirstFrame(settings, common.frame());
 
     t_pbc  pbc;
     t_pbc *ppbc = settings.hasPBC() ? &pbc : NULL;