source: trunk/src/objects/RpPlot.h @ 1389

Last change on this file since 1389 was 1386, checked in by dkearney, 15 years ago

adding a few object prototypes we can play with for future developement. the plot object is probably the most interesting. examples are located in examples/objects dirs

File size: 1.4 KB
Line 
1/*
2 * ======================================================================
3 *  AUTHOR:  Derrick Kearney, Purdue University
4 *  Copyright (c) 2005-2009  Purdue Research Foundation
5 *
6 *  See the file "license.terms" for information on usage and
7 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
8 * ======================================================================
9 */
10#include <errno.h>
11#include "RpVariable.h"
12#include "RpChainHelper.h"
13#include "RpCurve.h"
14
15#ifndef RAPPTURE_PLOT_H
16#define RAPPTURE_PLOT_H
17
18namespace Rappture {
19
20class Plot : public Variable
21{
22    public:
23
24        Plot ();
25
26        Plot ( const Plot& o );
27        virtual ~Plot ();
28
29        Plot& add ( size_t nPts,
30                    double *x,
31                    double *y,
32                    const char *fmt,
33                    const char *name);
34
35        // count the number of curves in the object
36        size_t count() const;
37
38        // retrieve a curve from the object
39        Curve *curve (const char* name) const;
40
41        static const char format[];
42        static const char id[];
43        static const char xaxis[];
44        static const char yaxis[];
45
46    private:
47
48        // hash or linked list of preset values
49        Rp_Chain *_curveList;
50
51        Rp_ChainLink *__searchCurveList(const char *name) const;
52        static int __curveCopyFxn(void **to, void *from);
53};
54
55} // namespace Rappture
56
57#endif // RAPPTURE_PLOT_H
Note: See TracBrowser for help on using the repository browser.