ARCS6 AR6-REV.24062600
読み取り中…
検索中…
一致する文字列を見つけられません
CuiPlot.hh
[詳解]
1
10//
11// Copyright (C) 2011-2020 Yokokura, Yuki
12// This program is free software;
13// you can redistribute it and/or modify it under the terms of the FreeBSD License.
14// For details, see the License.txt file.
15
16#ifndef CUIPLOT
17#define CUIPLOT
18
19#include <cassert>
20#include <cstdint>
21#include <memory>
22#include "FrameGraphics.hh"
23#include "RingBuffer.hh"
24#include "Matrix.hh"
25
26// ARCS組込み用マクロ
27#ifdef ARCS_IN
28 // ARCSに組み込まれる場合
29 #include "ARCSassert.hh"
30 #include "ARCSeventlog.hh"
31#else
32 // ARCSに組み込まれない場合
33 #define arcs_assert(a) (assert(a))
34 #define PassedLog()
35 #define EventLog(a)
36 #define EventLogVar(a)
37#endif
38
39namespace ARCS { // ARCS名前空間
40
52
54class CuiPlot {
55 public:
62 CuiPlot(FrameGraphics& Frame, int Left, int Top, int Width, int Height) :
63 LEFT(Left),
64 TOP(Top),
65 WIDTH(Width),
66 HEIGHT(Height),
67 PLOT_LEFT(LEFT + 3*MARGIN_WIDTH/2),
68 PLOT_TOP(TOP + MARGIN_TOP),
69 PLOT_WIDTH(WIDTH - MARGIN_WIDTH_X2),
70 PLOT_HEIGHT(HEIGHT - MARGIN_TOP - MARGIN_BOTTOM),
71 FG(Frame),
72 AxisColor(FGcolors::WHITE),
73 GridColor(FGcolors::GRAY25),
74 TextColor(FGcolors::WHITE),
75 BackColor(FGcolors::BLACK),
76 CursorColor(FGcolors::GRAY50),
77 Xmax(1),
78 Xmin(-1),
79 Ymax(1),
80 Ymin(-1),
81 Xwidth(Xmax - Xmin),
82 Yheight(Ymax - Ymin),
83 Xgrid({0}),
84 Ygrid({0}),
85 XgridNum(4),
86 YgridNum(4),
87 Xform("%1.1f"),
88 Yform("%1.1f"),
89 Xlabel("X AXIS [unit]"),
90 Ylabel("Y AXIS [unit]"),
91 VisibleFlag(true)
92 {
93 PassedLog();
94 CalcGridNumbers(); // グリッド数値の計算
95 }
96
99 CuiPlot(CuiPlot&& r) = delete;
100 // :
101 //{
102
103 //}
104
107 PassedLog();
108 }
109
116 void SetColors(FGcolors Axis, FGcolors Grid, FGcolors Text, FGcolors Back, FGcolors Cursor){
117 AxisColor = Axis;
118 GridColor = Grid;
119 TextColor = Text;
120 BackColor = Back;
121 CursorColor = Cursor;
122 FG.PrepareFontData(TextColor, BackColor); // 指定色のフォントデータの準備
123 }
124
130 void SetRanges(double xmin, double xmax, double ymin, double ymax){
131 arcs_assert(xmin < xmax);
132 arcs_assert(ymin < ymax);
133 Xmin = xmin;
134 Xmax = xmax;
135 Ymin = ymin;
136 Ymax = ymax;
137 Xwidth = Xmax - Xmin;
138 Yheight = Ymax - Ymin;
139 CalcGridNumbers(); // グリッド数値の再計算
140 }
141
145 void SetAxisLabels(const std::string& xlabel, const std::string& ylabel){
146 Xlabel = xlabel;
147 Ylabel = ylabel;
148 }
149
153 void SetGridLabelFormat(const std::string& xformat, const std::string& yformat){
154 Xform = xformat;
155 Yform = yformat;
156 }
157
161 void SetGridDivision(size_t xdiv, size_t ydiv){
162 arcs_assert(xdiv < XGRID_MAX);
163 arcs_assert(ydiv < YGRID_MAX);
164 XgridNum = xdiv;
165 YgridNum = ydiv;
166 CalcGridNumbers(); // グリッド数値の再計算
167 }
168
170 void DrawAxis(void){
171 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
172 ClearAxis(); // 背景色で塗りつぶし
173 FG.DrawRect(PLOT_LEFT, PLOT_TOP, PLOT_WIDTH, PLOT_HEIGHT, AxisColor); // グラフ外枠の描画
174 DrawGrid(); // グリッドの描画
175 DrawLabels(); // ラベルの描画
176 }
177
179 void ClearAxis(void){
180 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
181 FG.DrawRectFill(LEFT, TOP, WIDTH, HEIGHT, BackColor); // 背景色で塗りつぶす
182 }
183
188 void DrawLegend(size_t i, const std::string& name, const FGcolors& color){
189 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
190 FG.PrintText(LEFT + LEGEND_LEFT + i*LEGEND_INTERVAL, TOP + LEGEND_TOP, FGalign::ALIGN_LEFT, name);
191 FG.DrawRectFill(
192 LEFT + LEGEND_LEFT + i*LEGEND_INTERVAL - LEGEND_LINE_WIDTH - 3, TOP + LEGEND_TOP,
193 LEGEND_LINE_WIDTH, LEGEND_LINE_HEIGHT,
194 color
195 );
196 }
197
201 template <size_t N>
202 void DrawLegends(const std::array<std::string, N>& names, const std::array<FGcolors, N>& colors){
203 for(size_t i = 0; i < N; ++i){
204 DrawLegend(i + 1, names[i], colors[i]);
205 }
206 }
207
212 template <size_t N>
213 void DrawLegends(const std::array<std::string, N>& names, const std::array<FGcolors, N>& colors, size_t num){
214 for(size_t i = 0; i < num; ++i){
215 DrawLegend(i + 1, names[i], colors[i]);
216 }
217 }
218
221 void DrawCursorX(const double x){
222 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
223 FG.DrawLine(XtoPixel(x), YtoPixel(Ymax) + 1, XtoPixel(x), YtoPixel(Ymin) - 1, CursorColor);
224 }
225
230 void DrawText(const double x, const double y, const std::string& text){
231 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
232 FG.PrintText(XtoPixel(x), YtoPixel(y), FGalign::ALIGN_LEFT, text);
233 }
234
240 void DrawValue(const double x, const double y, const std::string& format, const double val){
241 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
242 FG.PrintValue(XtoPixel(x), YtoPixel(y), FGalign::ALIGN_LEFT, format, val);
243 }
244
250 void Plot(const double x, const double y, const CuiPlotTypes type, const uint32_t color){
251 PlotSingleData(x, y, x, y, type, color);
252 }
253
259 void Plot(const double x, const double y, const CuiPlotTypes type, const double r, const double g, const double b){
260 Plot(x, y, type, FG.RGBcolorToData(r,g,b));
261 }
262
268 void Plot(const double x, const double y, const CuiPlotTypes type, const FGcolors color){
269 Plot(x, y, type, FG.ColorNameToData(color));
270 }
271
277 void Plot(const double x1, const double y1, const double x2, const double y2, const CuiPlotTypes type, const uint32_t color){
278 PlotSingleData(x1, y1, x2, y2, type, color);
279 }
280
286 void Plot(const double x1, const double y1, const double x2, const double y2, const CuiPlotTypes type, const double r, const double g, const double b){
287 Plot(x1, y1, x2, y2, type, FG.RGBcolorToData(r,g,b));
288 }
289
295 void Plot(const double x1, const double y1, const double x2, const double y2, const CuiPlotTypes type, const FGcolors color){
296 Plot(x1, y1, x2, y2, type, FG.ColorNameToData(color));
297 }
298
305 template <size_t N>
306 void Plot(const std::array<double, N>& x, const std::array<double, N>& y, const CuiPlotTypes type, const uint32_t color){
307 for(size_t i = 1; i < N; ++i){
308 PlotSingleData(x[i-1], y[i-1], x[i], y[i], type, color); // 2点間の描画を配列の長さ分だけ実行
309 }
310 }
311
318 template <size_t N>
319 void Plot(const std::array<double, N>& x, const std::array<double, N>& y, const CuiPlotTypes type, const double r, const double g, const double b){
320 Plot(x, y, type, FG.RGBcolorToData(r,g,b));
321 }
322
329 template <size_t N>
330 void Plot(const std::array<double, N>& x, const std::array<double, N>& y, const CuiPlotTypes type, const FGcolors color){
331 Plot(x, y, type, FG.ColorNameToData(color));
332 }
333
340 template <size_t N>
341 void Plot(const Matrix<1,N>& x, const Matrix<1,N>& y, const CuiPlotTypes type, const uint32_t color){
342 for(size_t i = 2; i <= N; ++i){
343 PlotSingleData(x[i-1], y[i-1], x[i], y[i], type, color); // 2点間の描画を配列の長さ分だけ実行
344 }
345 }
346
353 template <size_t N>
354 void Plot(const Matrix<1,N>& x, const Matrix<1,N>& y, const CuiPlotTypes type, const double r, const double g, const double b){
355 Plot(x, y, type, FG.RGBcolorToData(r,g,b));
356 }
357
364 template <size_t N>
365 void Plot(const Matrix<1,N>& x, const Matrix<1,N>& y, const CuiPlotTypes type, const FGcolors color){
366 Plot(x, y, type, FG.ColorNameToData(color));
367 }
368
374 template <unsigned long N, bool M = false>
375 void TimeSeriesPlot(RingBuffer<double, N, M>& t, RingBuffer<double, N, M>& y, const CuiPlotTypes type, const uint32_t color){
376 const double Tnow = t.GetFirstValue(); // 現在の時刻
377 double t1, t2, y1, y2; // 加工後の座標
378 bool LeapZero = false; // 時刻ゼロを跨いだか否か
379
380 // リングバッファの分だけ回す
381 for(size_t i = 1; i < N; ++i){
382 // リングバッファの最先端(現在)から後方(過去)に向けて座標を抽出
383 t2 = t.GetRelativeValueFromFirst(i - 1);
384 y2 = y.GetRelativeValueFromFirst(i - 1);
387
388 if(LeapZero == true && t1 <= Tnow) break; // 時刻ゼロを跨ぎ,尚且つ現在時刻より前になったら描画終了
389 if(LeapZero == true && t2 < t1) break; // 時刻ゼロを2回跨いでも描画終了 (Tnow≒0で if(t1 <= Tnow) をすり抜けるときの対策)
390
391 if(t1 <= t2){
392 // 普通のときは普通に描画
393 PlotSingleData(t1, y1, t2, y2, type, color);
394 }else{
395 // 時刻ゼロを跨いだとき
396 LeapZero = true;
397 }
398 }
399
400 DrawCursorX(Tnow); // 時刻カーソルを現在時刻のところに表示
401 }
402
409 template <unsigned long N, bool M = false>
410 void TimeSeriesPlot(RingBuffer<double, N, M>& t, RingBuffer<double, N, M>& y, const CuiPlotTypes type, const double r, const double g, const double b){
411 TimeSeriesPlot(t, y, type, FG.RGBcolorToData(r, g, b));
412 }
413
420 template <unsigned long N, bool M = false>
422 TimeSeriesPlot(t, y, type, FG.ColorNameToData(color));
423 }
424
426 void Disp(void){
427 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
428 FG.RefreshFrame(LEFT, TOP, WIDTH, HEIGHT); // フレームバッファ更新
429 }
430
433 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
434 FG.StoreScreenAsBackground(LEFT, TOP, WIDTH, HEIGHT);
435 }
436
439 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
440 FG.LoadBackgroundToScreen(LEFT, TOP, WIDTH, HEIGHT);
441 }
442
445 void Visible(bool visible){
446 VisibleFlag = visible;
447 }
448
449 private:
450 CuiPlot(const CuiPlot&) = delete;
451 const CuiPlot& operator=(const CuiPlot&) = delete;
452 static constexpr int MARGIN_TOP = 14;
453 static constexpr int MARGIN_BOTTOM = 23;
454 static constexpr int MARGIN_WIDTH = 30;
455 static constexpr int MARGIN_WIDTH_X2 = MARGIN_WIDTH*2;
456 static constexpr int GRID_AXISLEN = 5;
457 static constexpr int LABEL_VERTICAL_ALIGN = 4;
458 static constexpr int LABEL_MARGIN_X = 3;
459 static constexpr int LABEL_MARGIN_Y = 5;
460 static constexpr int LEGEND_LEFT = 100;
461 static constexpr int LEGEND_TOP = 3;
462 static constexpr int LEGEND_INTERVAL = 70;
463 static constexpr int LEGEND_LINE_WIDTH = 9;
464 static constexpr int LEGEND_LINE_HEIGHT = 9;
465 static constexpr size_t XGRID_MAX = 16;
466 static constexpr size_t YGRID_MAX = 16;
467 const int LEFT;
468 const int TOP;
469 const int WIDTH;
470 const int HEIGHT;
471 const int PLOT_LEFT;
472 const int PLOT_TOP;
473 const int PLOT_WIDTH;
474 const int PLOT_HEIGHT;
475
476 FrameGraphics& FG;
477 FGcolors AxisColor;
478 FGcolors GridColor;
479 FGcolors TextColor;
480 FGcolors BackColor;
481 FGcolors CursorColor;
482 double Xmax;
483 double Xmin;
484 double Ymax;
485 double Ymin;
486 double Xwidth;
487 double Yheight;
488 std::array<double, XGRID_MAX> Xgrid;
489 std::array<double, YGRID_MAX> Ygrid;
490 size_t XgridNum;
491 size_t YgridNum;
492 std::string Xform;
493 std::string Yform;
494 std::string Xlabel;
495 std::string Ylabel;
496 bool VisibleFlag;
497
499 void CalcGridNumbers(void){
500 // X軸グリッド数値の計算
501 for(size_t i = 0; i < XgridNum; ++i){
502 Xgrid[i] = (Xmax - Xmin)/(double)XgridNum*(double)(i + 1) + Xmin;
503 }
504 // Y軸グリッド数値の計算
505 for(size_t i = 0; i < YgridNum; ++i){
506 Ygrid[i] = (Ymax - Ymin)/(double)YgridNum*(double)(i + 1) + Ymin;
507 }
508 }
509
511 int XtoPixel(double x) const{
512 if(Xmax < x) x = Xmax;
513 if(x < Xmin) x = Xmin;
514 return (int)((double)PLOT_WIDTH/Xwidth*(x - Xmin)) + PLOT_LEFT;
515 }
516
518 int YtoPixel(double y) const{
519 if(Ymax < y) y = Ymax;
520 if(y < Ymin) y = Ymin;
521 return (int)((double)PLOT_HEIGHT/Yheight*(-y + Ymax)) + PLOT_TOP;
522 }
523
525 void DrawGrid(void){
526 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
527 // X軸グリッドの描画
528 for(size_t i = 0; i < XgridNum - 1; ++i){
529 FG.DrawLine(XtoPixel(Xgrid[i]), YtoPixel(Ymin), XtoPixel(Xgrid[i]), YtoPixel(Ymax), GridColor); // グリッド線の描画
530 FG.DrawLine(XtoPixel(Xgrid[i]), YtoPixel(Ymin), XtoPixel(Xgrid[i]), YtoPixel(Ymin) - GRID_AXISLEN, AxisColor); // 下側目盛線の描画
531 FG.DrawLine(XtoPixel(Xgrid[i]), YtoPixel(Ymax), XtoPixel(Xgrid[i]), YtoPixel(Ymax) + GRID_AXISLEN, AxisColor); // 上側目盛線の描画
532 }
533 // Y軸グリッドの描画
534 for(size_t i = 0; i < YgridNum - 1; ++i){
535 FG.DrawLine(XtoPixel(Xmin), YtoPixel(Ygrid[i]), XtoPixel(Xmax), YtoPixel(Ygrid[i]), GridColor); // グリッド線の描画
536 FG.DrawLine(XtoPixel(Xmin), YtoPixel(Ygrid[i]), XtoPixel(Xmin) + GRID_AXISLEN, YtoPixel(Ygrid[i]), AxisColor); // 左側目盛線の描画
537 FG.DrawLine(XtoPixel(Xmax), YtoPixel(Ygrid[i]), XtoPixel(Xmax) - GRID_AXISLEN, YtoPixel(Ygrid[i]), AxisColor); // 右側目盛線の描画
538 }
539 }
540
542 void DrawLabels(void){
543 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
544 // グリッドラベルの描画
545 for(size_t i = 0; i < XgridNum - 1; ++i){
546 FG.PrintValue(XtoPixel(Xgrid[i]), YtoPixel(Ymin) + LABEL_MARGIN_X, FGalign::ALIGN_CENTER, Xform, Xgrid[i]); // X軸グリッドラベル
547 }
548 for(size_t i = 0; i < YgridNum - 1; ++i){
549 FG.PrintValue(XtoPixel(Xmin) - LABEL_MARGIN_Y, YtoPixel(Ygrid[i]) - LABEL_VERTICAL_ALIGN, FGalign::ALIGN_RIGHT, Yform, Ygrid[i]); // Y軸グリッドラベル
550 }
551 // X軸 最小値と最大値ラベルの描画
552 FG.PrintValue(XtoPixel(Xmax), YtoPixel(Ymin) + LABEL_MARGIN_X, FGalign::ALIGN_CENTER, Xform, Xmax); // 最大値ラベル
553 FG.PrintValue(XtoPixel(Xmin), YtoPixel(Ymin) + LABEL_MARGIN_X, FGalign::ALIGN_CENTER, Xform, Xmin); // 最小値ラベル
554 // Y軸 最小値と最大値ラベルの描画
555 FG.PrintValue(XtoPixel(Xmin) - LABEL_MARGIN_Y, YtoPixel(Ymax), FGalign::ALIGN_RIGHT, Yform, Ymax); // 最大値ラベル
556 FG.PrintValue(XtoPixel(Xmin) - LABEL_MARGIN_Y, YtoPixel(Ymin) - LABEL_VERTICAL_ALIGN*2, FGalign::ALIGN_RIGHT, Yform, Ymin); // 最小値ラベル
557 // XY軸ラベルの描画
558 FG.PrintText(XtoPixel(Xwidth/2.0 + Xmin), YtoPixel(Ymin) + LABEL_VERTICAL_ALIGN*2 + LABEL_MARGIN_X*2, FGalign::ALIGN_CENTER, Xlabel); // X軸ラベル
559 FG.PrintText(LEFT + 2, TOP + 2, FGalign::ALIGN_LEFT, Ylabel); // Y軸ラベル
560 }
561
569 void PlotSingleData(const double x1, const double y1, const double x2, const double y2, const CuiPlotTypes type, const uint32_t color){
570 if(VisibleFlag == false) return; // 不可視設定なら何もせず終了
571 switch(type){
572 case CuiPlotTypes::PLOT_LINE: // 線プロットのとき
573 FG.DrawLine(XtoPixel(x1), YtoPixel(y1), XtoPixel(x2), YtoPixel(y2), color);
574 break;
575 case CuiPlotTypes::PLOT_BOLDLINE: // 太線プロットのとき
576 FG.DrawLine<FGsize::PX_2>(XtoPixel(x1), YtoPixel(y1), XtoPixel(x2), YtoPixel(y2), color);
577 break;
578 case CuiPlotTypes::PLOT_DOT: // 点プロットのとき
579 FG.DrawPoint(XtoPixel(x1), YtoPixel(y1), color);
580 break;
581 case CuiPlotTypes::PLOT_BOLDDOT: // 太い点プロットのとき
582 FG.DrawPoint<FGsize::PX_3>(XtoPixel(x1), YtoPixel(y1), color);
583 break;
584 case CuiPlotTypes::PLOT_CROSS: // 十字プロットのとき
585 FG.DrawCross(XtoPixel(x1), YtoPixel(y1), color);
586 break;
587 case CuiPlotTypes::PLOT_STAIRS: // 階段プロットのとき
588 FG.DrawStairs(XtoPixel(x1), YtoPixel(y1), XtoPixel(x2), YtoPixel(y2), color);
589 break;
590 case CuiPlotTypes::PLOT_BOLDSTAIRS: // 太線階段プロットのとき
591 FG.DrawStairs<FGsize::PX_2>(XtoPixel(x1), YtoPixel(y1), XtoPixel(x2), YtoPixel(y2), color);
592 break;
593 case CuiPlotTypes::PLOT_LINEANDDOT: // 線と点の複合プロットのとき
594 FG.DrawLine(XtoPixel(x1), YtoPixel(y1), XtoPixel(x2), YtoPixel(y2), color);
595 FG.DrawPoint<FGsize::PX_3>(XtoPixel(x1), YtoPixel(y1), color);
596 break;
597 default:
598 arcs_assert(false); // ここには来ない
599 break;
600 }
601 }
602};
603}
604
605#endif
ARCS イベントログクラス
#define PassedLog()
イベントログ用マクロ(ファイルと行番号のみ記録版)
Definition ARCSeventlog.hh:26
ARCS用ASSERTクラス
#define arcs_assert(a)
ARCS用assertマクロ a : assert条件
Definition ARCSassert.hh:17
CuiPlotTypes
プロットタイプの定義
Definition CuiPlot.hh:42
@ PLOT_BOLDDOT
太点プロット
@ PLOT_CROSS
十字プロット
@ PLOT_STAIRS
階段プロット
@ PLOT_LINEANDDOT
線と点の複合プロット
@ PLOT_DOT
点プロット
@ PLOT_BOLDLINE
太線プロット
@ PLOT_BOLDSTAIRS
太線階段プロット
@ PLOT_LINE
線プロット
行列/ベクトル計算クラス(テンプレート版)
フレームグラフィックスクラスV2(新型テンプレート版)
FGcolors
色の定義
Definition FrameGraphics.hh:60
@ GRAY25
灰 輝度25%
@ GRAY50
灰 輝度50%
CuiPlot(新型きゅいプロットV2)
Definition CuiPlot.hh:54
void DrawCursorX(const double x)
x軸カーソルを描画する関数
Definition CuiPlot.hh:221
void Plot(const std::array< double, N > &x, const std::array< double, N > &y, const CuiPlotTypes type, const double r, const double g, const double b)
std::array配列データをプロットする関数(RGB輝度値版)
Definition CuiPlot.hh:319
void Disp(void)
画面に表示する関数
Definition CuiPlot.hh:426
void TimeSeriesPlot(RingBuffer< double, N, M > &t, RingBuffer< double, N, M > &y, const CuiPlotTypes type, const FGcolors color)
リングバッファの時系列データをプロットする関数(色の名前版)
Definition CuiPlot.hh:421
void Visible(bool visible)
グラフを表示するかどうか
Definition CuiPlot.hh:445
void Plot(const std::array< double, N > &x, const std::array< double, N > &y, const CuiPlotTypes type, const FGcolors color)
std::array配列データをプロットする関数(色の名前版)
Definition CuiPlot.hh:330
void Plot(const double x1, const double y1, const double x2, const double y2, const CuiPlotTypes type, const uint32_t color)
2点のデータをプロットする関数(バイナリ色データ版)
Definition CuiPlot.hh:277
void Plot(const double x1, const double y1, const double x2, const double y2, const CuiPlotTypes type, const double r, const double g, const double b)
2点のデータをプロットする関数(RGB輝度値版)
Definition CuiPlot.hh:286
void SetRanges(double xmin, double xmax, double ymin, double ymax)
グラフの範囲を設定する関数
Definition CuiPlot.hh:130
void Plot(const double x, const double y, const CuiPlotTypes type, const uint32_t color)
1点のデータをプロットする関数(バイナリ色データ版)
Definition CuiPlot.hh:250
void Plot(const Matrix< 1, N > &x, const Matrix< 1, N > &y, const CuiPlotTypes type, const double r, const double g, const double b)
Matrix縦ベクトルデータをプロットする関数(RGB輝度値版)
Definition CuiPlot.hh:354
void SetGridLabelFormat(const std::string &xformat, const std::string &yformat)
グリッドラベルの書式を設定する関数
Definition CuiPlot.hh:153
void ClearAxis(void)
グラフの軸をクリアする関数
Definition CuiPlot.hh:179
void LoadPlaneFromBuffer(void)
背景バッファからプロット平面の状態を読み込む関数
Definition CuiPlot.hh:438
void Plot(const double x1, const double y1, const double x2, const double y2, const CuiPlotTypes type, const FGcolors color)
2点のデータをプロットする関数(色の名前版)
Definition CuiPlot.hh:295
void Plot(const std::array< double, N > &x, const std::array< double, N > &y, const CuiPlotTypes type, const uint32_t color)
std::array配列データをプロットする関数(バイナリ色データ版)
Definition CuiPlot.hh:306
void TimeSeriesPlot(RingBuffer< double, N, M > &t, RingBuffer< double, N, M > &y, const CuiPlotTypes type, const uint32_t color)
リングバッファの時系列データをプロットする関数(バイナリ色データ版)
Definition CuiPlot.hh:375
void SetColors(FGcolors Axis, FGcolors Grid, FGcolors Text, FGcolors Back, FGcolors Cursor)
グラフの各部の色を設定する関数
Definition CuiPlot.hh:116
void TimeSeriesPlot(RingBuffer< double, N, M > &t, RingBuffer< double, N, M > &y, const CuiPlotTypes type, const double r, const double g, const double b)
リングバッファの時系列データをプロットする関数(RGB輝度値版)
Definition CuiPlot.hh:410
void SetAxisLabels(const std::string &xlabel, const std::string &ylabel)
軸ラベルを設定する関数
Definition CuiPlot.hh:145
CuiPlot(FrameGraphics &Frame, int Left, int Top, int Width, int Height)
コンストラクタ
Definition CuiPlot.hh:62
void Plot(const double x, const double y, const CuiPlotTypes type, const FGcolors color)
1点のデータをプロットする関数(色の名前版)
Definition CuiPlot.hh:268
~CuiPlot()
デストラクタ
Definition CuiPlot.hh:106
void StorePlaneInBuffer(void)
現在のプロット平面の状態を背景バッファに保存する関数
Definition CuiPlot.hh:432
void Plot(const Matrix< 1, N > &x, const Matrix< 1, N > &y, const CuiPlotTypes type, const uint32_t color)
Matrix縦ベクトルデータをプロットする関数(バイナリ色データ版)
Definition CuiPlot.hh:341
CuiPlot(CuiPlot &&r)=delete
ムーブコンストラクタ
void DrawText(const double x, const double y, const std::string &text)
文字列を描画する関数
Definition CuiPlot.hh:230
void DrawAxis(void)
グラフの軸を描画する関数
Definition CuiPlot.hh:170
void DrawValue(const double x, const double y, const std::string &format, const double val)
数値を描画する関数
Definition CuiPlot.hh:240
void Plot(const double x, const double y, const CuiPlotTypes type, const double r, const double g, const double b)
1点のデータをプロットする関数(RGB輝度値版)
Definition CuiPlot.hh:259
void DrawLegends(const std::array< std::string, N > &names, const std::array< FGcolors, N > &colors)
凡例を描画する関数(std::array版)
Definition CuiPlot.hh:202
void Plot(const Matrix< 1, N > &x, const Matrix< 1, N > &y, const CuiPlotTypes type, const FGcolors color)
Matrix縦ベクトルデータをプロットする関数(色の名前版)
Definition CuiPlot.hh:365
void DrawLegends(const std::array< std::string, N > &names, const std::array< FGcolors, N > &colors, size_t num)
凡例を描画する関数(std::array, 個数指定版)
Definition CuiPlot.hh:213
void SetGridDivision(size_t xdiv, size_t ydiv)
グリッドの分割数を設定する関数
Definition CuiPlot.hh:161
void DrawLegend(size_t i, const std::string &name, const FGcolors &color)
凡例を描画する関数
Definition CuiPlot.hh:188
フレームグラフィックスクラス(新型テンプレート版)
Definition FrameGraphics.hh:91
void DrawPoint(int x, int y, uint32_t ColorData)
点(x,y)を描画する関数(バイナリデータ版)
Definition FrameGraphics.hh:334
void DrawRect(int x, int y, int w, int h, uint32_t ColorData)
長方形の描画をする関数(バイナリ色データ版)(色は塗らない)
Definition FrameGraphics.hh:577
void DrawCross(int x, int y, uint32_t ColorData)
十字(x,y)を描画する関数(バイナリデータ版)
Definition FrameGraphics.hh:397
void DrawStairs(int x1, int y1, int x2, int y2, uint32_t ColorData)
階段直線(x1,y1)ー(x2,y2)を引く関数(バイナリデータ版)
Definition FrameGraphics.hh:546
uint32_t ColorNameToData(FGcolors color)
色の名前からバイナリ色データに変換する関数
Definition FrameGraphics.hh:797
void RefreshFrame(void)
フレームバッファを更新する関数
Definition FrameGraphics.hh:237
void PrepareFontData(FGcolors fore_color, FGcolors back_color)
指定した色のフォントデータを準備する関数
Definition FrameGraphics.hh:678
void LoadBackgroundToScreen(void)
背景バッファを画面バッファへ読み込む関数
Definition FrameGraphics.hh:273
void DrawLine(int x1, int y1, int x2, int y2, uint32_t ColorData)
直線(x1,y1)ー(x2,y2)を引く関数(バイナリデータ版)
Definition FrameGraphics.hh:431
void PrintText(int x, int y, FGalign align, std::string text)
文字列を描画する関数 x:[px]横位置,y:[px] 縦位置,align:揃え位置,text:所望の文字列
Definition FrameGraphics.hh:699
uint32_t RGBcolorToData(double Red, double Green, double Blue)
0~1の浮動小数点で表現された赤緑青色の輝度値をバイナリ色データに変える
Definition FrameGraphics.hh:803
void DrawRectFill(int x, int y, int w, int h, uint32_t ColorData)
長方形の範囲内に色を塗る関数(バイナリ色データ版) (色を塗る)
Definition FrameGraphics.hh:608
void StoreScreenAsBackground(void)
現在の画面バッファを背景バッファとして保存する関数
Definition FrameGraphics.hh:255
void PrintValue(int x, int y, FGalign align, std::string format, double val)
指定した書式で文字列を描画する関数 x:[px] 横位置,y:[px] 縦位置,align:揃え位置,format:書式指定子,val:所望の数値 formatの書式指定子は printf関数 の場合の...
Definition FrameGraphics.hh:724
行列/ベクトル計算クラス(テンプレート版)
Definition Matrix.hh:44
リングバッファクラス
Definition RingBuffer.hh:51
T GetRelativeValueFromFirst(const unsigned long k)
バッファの最先端から k だけ後方側に戻ったところの値を取り出す関数
Definition RingBuffer.hh:100
T GetFirstValue(void)
値をバッファの現在の先頭から取り出す関数
Definition RingBuffer.hh:90