1 | /* |
---|
2 | * ====================================================================== |
---|
3 | * AUTHOR: Derrick Kearney, Purdue University |
---|
4 | * Copyright (c) 2004-2012 HUBzero Foundation, LLC |
---|
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 "RpCurve.h" |
---|
12 | #include "RpChainHelper.h" |
---|
13 | #include "RpAxisMarker.h" |
---|
14 | |
---|
15 | #ifndef RAPPTURE_HISTOGRAM_H |
---|
16 | #define RAPPTURE_HISTOGRAM_H |
---|
17 | |
---|
18 | namespace Rappture { |
---|
19 | |
---|
20 | class Histogram : public Curve |
---|
21 | { |
---|
22 | public: |
---|
23 | |
---|
24 | Histogram(); |
---|
25 | |
---|
26 | Histogram(double *h, size_t npts); |
---|
27 | |
---|
28 | Histogram(double *h, size_t npts, double *bins, size_t nbins); |
---|
29 | |
---|
30 | Histogram(double *h, size_t npts, double min, double max, |
---|
31 | size_t nbins); |
---|
32 | |
---|
33 | Histogram(double *h, size_t npts, double min, double max, |
---|
34 | double step); |
---|
35 | |
---|
36 | Histogram(const Histogram& o); |
---|
37 | |
---|
38 | virtual ~Histogram(); |
---|
39 | |
---|
40 | Histogram& xaxis(const char *label, const char *desc, |
---|
41 | const char *units); |
---|
42 | |
---|
43 | Histogram& xaxis(const char *label, const char *desc, |
---|
44 | const char *units, const double *bins, |
---|
45 | size_t nBins); |
---|
46 | |
---|
47 | Histogram& xaxis(const char *label, const char *desc, |
---|
48 | const char *units, double min, double max, |
---|
49 | size_t nBins); |
---|
50 | |
---|
51 | Histogram& xaxis(const char *label, const char *desc, |
---|
52 | const char *units, double min, double max, |
---|
53 | double step); |
---|
54 | |
---|
55 | Histogram& yaxis(const char *label, const char *desc, |
---|
56 | const char *units); |
---|
57 | |
---|
58 | Histogram& yaxis(const char *label, const char *desc, |
---|
59 | const char *units, const double *vals, |
---|
60 | size_t nPts); |
---|
61 | |
---|
62 | Histogram& binWidths(const size_t *widths, size_t nbins); |
---|
63 | |
---|
64 | Histogram& marker(const char *axisName, double at, |
---|
65 | const char *label, const char *style); |
---|
66 | |
---|
67 | // should be a list of groups to add this curve to? |
---|
68 | Accessor <const char *> group; |
---|
69 | |
---|
70 | static const char x[]; |
---|
71 | static const char y[]; |
---|
72 | |
---|
73 | size_t nbins(void) const; |
---|
74 | |
---|
75 | const char *xml(size_t indent, size_t tabstop); |
---|
76 | const int is(void) const; |
---|
77 | |
---|
78 | friend int axisMarkerCpyFxn (void **to, void *from); |
---|
79 | |
---|
80 | protected: |
---|
81 | |
---|
82 | Rp_Chain *_markerList; |
---|
83 | |
---|
84 | }; |
---|
85 | |
---|
86 | } // namespace Rappture |
---|
87 | |
---|
88 | /*--------------------------------------------------------------------------*/ |
---|
89 | |
---|
90 | #endif // RAPPTURE_HISTOGRAM_H |
---|