OpenMPCD
Public Types | Public Member Functions | List of all members
OpenMPCD::Graph Class Reference

Represents a 2D graph. More...

#include <Graph.hpp>

Public Types

typedef std::deque< std::pair< FP, FP > > Container
 The type the data points are collected in. More...
 

Public Member Functions

void addPoint (const FP x, const FP y)
 Adds a data point. More...
 
const ContainergetPoints () const
 Returns the data points. More...
 
void save (const std::string &path, const bool prependGnuplotCommands) const
 Saves the graph data to the given file path. More...
 

Detailed Description

Represents a 2D graph.

Definition at line 19 of file Graph.hpp.

Member Typedef Documentation

◆ Container

typedef std::deque<std::pair<FP, FP> > OpenMPCD::Graph::Container

The type the data points are collected in.

Definition at line 22 of file Graph.hpp.

Member Function Documentation

◆ addPoint()

void OpenMPCD::Graph::addPoint ( const FP  x,
const FP  y 
)
inline

Adds a data point.

Parameters
[in]xThe x coordinate.
[in]yThe y coordinate.

Definition at line 30 of file Graph.hpp.

◆ getPoints()

const Container& OpenMPCD::Graph::getPoints ( ) const
inline

Returns the data points.

Definition at line 38 of file Graph.hpp.

◆ save()

void OpenMPCD::Graph::save ( const std::string &  path,
const bool  prependGnuplotCommands 
) const

Saves the graph data to the given file path.

Parameters
[in]pathThe file path to save to.
[in]prependGnuplotCommandsSet to true to prepend gnuplot commands, so that the resulting file can be plotted by calling gnuplot on it.

Definition at line 8 of file Graph.cpp.


The documentation for this class was generated from the following files: