2 * psychlops_figure_standard.h
3 * Psychlops Standard Library (Universal)
5 * Last Modified 2005/10/05 by Kenchi HOSOKAWA
6 * (C) 2005 Kenchi HOSOKAWA, Kazushi MARUYA, Takao SATO
9 #ifndef HEADER_PSYCHLOPS_FIGURE_STANDARD
10 #define HEADER_PSYCHLOPS_FIGURE_STANDARD
12 #include "../../../core/graphic/psychlops_g_fundamental.h"
13 #include "../../../psychlops_core.h"
14 #include "../../../core/ApplicationInterfaces/psychlops_app_thread.h"
22 class Arrow : virtual public Line
25 static Polygon default_head;
26 void createDefaultHead();
27 void setDefaultHead();
33 Arrow(const double x1, const double y1, const double x2, const double y2);
34 Arrow(const Point &dbegin, const Point &dend);
35 Arrow& set(const double x1, const double y1, const double x2, const double y2);
36 Arrow& set(const Point &dbegin, const Point &dend);
37 virtual Arrow& draw(Drawable &target = *Drawable::prime);
38 virtual Arrow& draw(const Color &col, Drawable &target = *Drawable::prime);
39 virtual Arrow& draw(const Stroke &strk, Drawable &target = *Drawable::prime);
43 class Cross : virtual public Shape, virtual public FigureDatum
46 //using FigureDatum::datum; using FigureDatum::shift;
47 //using Shape::centering;
52 Cross(const Rectangle& rect, Stroke dstrk = Stroke::hair_line);
53 Cross(double wid, double hei, Stroke dstrk = Stroke::hair_line);
55 Cross& set(const Rectangle& rect, Stroke dstrk = Stroke::hair_line);
56 Cross& set(double wid, double hei, Stroke dstrk = Stroke::hair_line);
57 virtual Cross& centering();
58 virtual Cross& centering(const Point &p);
59 virtual Cross& draw(Drawable &target = *Drawable::prime);
60 virtual Cross& draw(const Color &col, Drawable &target = *Drawable::prime);
61 virtual Cross& draw(const Stroke &strk, Drawable &target = *Drawable::prime);
65 class MovieSequence : public FigureDatum
\r
67 virtual MovieSequence& nextFrame() = 0;
\r
68 virtual MovieSequence& draw(Drawable& target = *Drawable::prime) = 0;
\r
71 class Movie : public MovieSequence
74 int current_frame_index;
75 std::deque<Image*> frames;
78 //static std::string bin_path;
79 Rectangle source_area;
85 Movie &set(Image* frames, int frame_num);
86 Movie &reserveFrames(int frame_num);
87 int getCurrentIndex();
88 int setCurrentIndex(int new_current);
89 Image& operator[](int frame_num);
91 virtual Movie& nextFrame();
92 virtual Movie& draw(Drawable& target = *Drawable::prime);
94 virtual Movie& captureOnce();
95 virtual Movie& captureOnce(const Rectangle &source_area_);
96 virtual Movie& captureOnce(int target_frame);
97 virtual Movie& captureOnce(const Rectangle &source_area_, int target_frame);
98 virtual Movie& save(std::string filename, const double fps = -1);
99 virtual Movie& saveEachFrames(std::string filename);
103 class ProgressBar : public FigureDatum
106 Rectangle frame_, bar_;
110 Color fgcolor, bgcolor;
111 ProgressBar(const Rectangle &rect);
112 ProgressBar(const double width, const double height);
113 virtual ~ProgressBar();
114 ProgressBar & set(Rectangle rect);
115 ProgressBar & set(const double width, const double height);
116 virtual ProgressBar & draw(Drawable& target = *Drawable::prime);
117 virtual ProgressBar & draw(const double x, const double y, const double z = 0, Drawable& target = *Drawable::prime) const;
119 ProgressBar & operator()(double ratio);
120 ProgressBar & operator()(double now, double max);
126 } /* <- namespace Figure */
127 } /* <- namespace Psycholops */