/*
+ * This file is part of the GROMACS molecular simulation package.
*
- * This source code is part of
+ * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
*
- * G R O M A C S
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
*
- * GROningen MAchine for Chemical Simulations
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
*
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2009, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
*
* To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- *
- * For more info, check our website at http://www.gromacs.org
+ * the research papers on the package. Check out http://www.gromacs.org.
*/
/*! \file
* \brief
*
* \inpublicapi
* \ingroup module_analysisdata
- * \author Teemu Murtola <teemu.murtola@cbr.su.se>
+ * \author Teemu Murtola <teemu.murtola@gmail.com>
*/
#ifndef GMX_ANALYSISDATA_MODULES_PLOT_H
#define GMX_ANALYSISDATA_MODULES_PLOT_H
#include <boost/shared_ptr.hpp>
-#include "../datamodule.h"
-#include "../../options/timeunitmanager.h"
-#include "../../utility/common.h"
+#include "gromacs/analysisdata/datamodule.h"
+#include "gromacs/options/timeunitmanager.h"
+#include "gromacs/utility/common.h"
namespace gmx
{
+class AnalysisDataValue;
class Options;
class SelectionCollection;
private:
const SelectionCollection *selections_;
- TimeUnit timeUnit_;
- int plotFormat_;
+ TimeUnit timeUnit_;
+ int plotFormat_;
};
/*! \brief
* straightforward plotting).
*
* By default, the data is written into an xvgr file, according to the
- * options read from the Options object given to the constructor.
+ * options read from the AnalysisDataPlotSettings object given to the
+ * constructor.
* For non-xvgr data, it's possible to skip all headers by calling
* setPlainOutput().
*
- * Multipoint data is supported, in which case all the points are written to
- * the output, in the order in which they are added to the data. A single
- * output line corresponds to a single frame. In most cases with multipoint
- * data, setPlainOutput() should be called since the output does not make sense
- * as an xvgr file, but this is not enforced.
+ * A single output line corresponds to a single frame. In most cases with
+ * multipoint data, setPlainOutput() should be called since the output does not
+ * make sense as an xvgr file, but this is not enforced.
+ *
+ * Multipoint data and multiple data sets are both supported, in which case all
+ * the points are written to the output, in the order in which they are added
+ * to the data.
*
* \ingroup module_analysisdata
*/
-class AbstractPlotModule : public AnalysisDataModuleInterface
+class AbstractPlotModule : public AnalysisDataModuleSerial
{
public:
virtual ~AbstractPlotModule();
/*! \brief
* Set the output file name.
*
- * If no file name is set (or if \p fnm is NULL), no output occurs.
+ * If no file name is set (or if \p filename is empty), no output occurs.
*/
- void setFileName(const std::string &fnm);
+ void setFileName(const std::string &filename);
/*! \brief
* Set plain output.
*
* methods have any effect on the output.
*/
void setPlainOutput(bool bPlain);
+ /*! \brief
+ * Plot errors as a separate output column after each value column.
+ */
+ void setErrorsAsSeparateColumn(bool bSeparate);
/*! \brief
* Omit the X coordinates from the output.
*
* together.
*/
void appendLegend(const char *setname);
+ //! \copydoc appendLegend(const char *)
+ void appendLegend(const std::string &setname);
/*! \brief
* Set field width and precision for X value output.
*/
- void setXFormat(int width, int prec, char fmt = 'f');
+ void setXFormat(int width, int precision, char format = 'f');
/*! \brief
* Set field width and precision for Y value output.
*/
- void setYFormat(int width, int prec, char fmt = 'f');
+ void setYFormat(int width, int precision, char format = 'f');
virtual int flags() const;
*
* Must not be called if isFileOpen() returns false.
*/
- void writeValue(real value) const;
+ void writeValue(const AnalysisDataValue &value) const;
//! \endcond
private:
class Impl;
- PrivateImplPointer<Impl> _impl;
+ PrivateImplPointer<Impl> impl_;
};
virtual void pointsAdded(const AnalysisDataPointSetRef &points);
private:
- bool _bWrite[4];
+ bool bWrite_[4];
// Copy and assign disallowed by base.
};
//! Smart pointer to manage an AnalysisDataPlotModule object.
typedef boost::shared_ptr<AnalysisDataPlotModule>
- AnalysisDataPlotModulePointer;
+ AnalysisDataPlotModulePointer;
//! Smart pointer to manage an AnalysisDataVectorPlotModule object.
typedef boost::shared_ptr<AnalysisDataVectorPlotModule>
- AnalysisDataVectorPlotModulePointer;
+ AnalysisDataVectorPlotModulePointer;
} // namespace gmx