gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/utils.h
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年01月05日 16:27:55 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年01月30日 21:26:02 +0100
commit6a1fc7ce42d752b43aab688c25305098f1525b84 (patch)
tree75e23e2f476fbb6ef26d38a5963708ad240728ce /agg-plot/utils.h
parent349fb72c939405efb9a25aea3fbd90da2f10a8f8 (diff)
downloadgsl-shell-6a1fc7ce42d752b43aab688c25305098f1525b84.tar.gz
Implement categories for axis labels in plot
Diffstat (limited to 'agg-plot/utils.h')
-rw-r--r--agg-plot/utils.h 24
1 files changed, 24 insertions, 0 deletions
diff --git a/agg-plot/utils.h b/agg-plot/utils.h
index 311ca5c0..d90febf6 100644
--- a/agg-plot/utils.h
+++ b/agg-plot/utils.h
@@ -2,6 +2,7 @@
#define AGGPLOT_UTILS_H
#include "agg_trans_affine.h"
+#include "agg_array.h"
#ifdef min
#undef min
@@ -24,6 +25,29 @@ T max(T a, T b)
return (a > b) ? a : b;
};
+template <class T>
+class ptr_list {
+public:
+ ~ptr_list() { clear(); }
+
+ void add(T* p) { m_list.add(p); }
+
+ T* operator [] (unsigned k) const { return m_list[k]; }
+
+ unsigned size() const { return m_list.size(); }
+
+ void clear()
+ {
+ unsigned n = m_list.size();
+ for (unsigned k = 0; k < n; k++)
+ delete m_list[k];
+ m_list.clear();
+ }
+
+private:
+ agg::pod_bvector<T*> m_list;
+};
+
extern void trans_affine_compose (agg::trans_affine& a,
const agg::trans_affine& b);
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月16日 17:03:53 +0000

AltStyle によって変換されたページ (->オリジナル) /