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 "RpObject.h" |
---|
12 | #include "RpChain.h" |
---|
13 | #include "RpArray1D.h" |
---|
14 | |
---|
15 | #ifndef RAPPTURE_CURVE_H |
---|
16 | #define RAPPTURE_CURVE_H |
---|
17 | |
---|
18 | namespace Rappture { |
---|
19 | |
---|
20 | class Curve : public Object |
---|
21 | { |
---|
22 | public: |
---|
23 | |
---|
24 | Curve(); |
---|
25 | |
---|
26 | Curve(const char *name); |
---|
27 | |
---|
28 | Curve(const char *name, const char *label, const char *desc, |
---|
29 | const char *group); |
---|
30 | |
---|
31 | Curve(const Curve& o); |
---|
32 | |
---|
33 | virtual ~Curve(); |
---|
34 | |
---|
35 | Array1D *axis(const char *name, const char *label, const char *desc, |
---|
36 | const char *units, const char *scale, const double *val, |
---|
37 | size_t size); |
---|
38 | |
---|
39 | Curve& delAxis(const char *name); |
---|
40 | |
---|
41 | size_t data(const char *label, const double **arr) const; |
---|
42 | |
---|
43 | Array1D *getAxis(const char *name) const; |
---|
44 | Array1D *getNthAxis(size_t n) const; |
---|
45 | |
---|
46 | // should be a list of groups to add this curve to? |
---|
47 | Accessor <const char *> group; |
---|
48 | size_t dims() const; |
---|
49 | |
---|
50 | void configure(size_t as, ClientData p); |
---|
51 | void dump(size_t as, ClientData p); |
---|
52 | |
---|
53 | const int is() const; |
---|
54 | |
---|
55 | static const char x[]; |
---|
56 | static const char y[]; |
---|
57 | |
---|
58 | private: |
---|
59 | |
---|
60 | // hash or linked list of axis |
---|
61 | Rp_Chain *_axisList; |
---|
62 | |
---|
63 | Rp_ChainLink *__searchAxisList(const char * name) const; |
---|
64 | |
---|
65 | void __configureFromXml(const char *p); |
---|
66 | void __configureFromTree(Rp_ParserXml *p); |
---|
67 | void __dumpToXml(ClientData c); |
---|
68 | void __dumpToTree(ClientData c); |
---|
69 | }; |
---|
70 | |
---|
71 | |
---|
72 | } // namespace Rappture |
---|
73 | |
---|
74 | /*--------------------------------------------------------------------------*/ |
---|
75 | |
---|
76 | #endif // RAPPTURE_CURVE_H |
---|