lib/GraphPlot2D.hh
00001 // X-T繧ー繝ゥ繝墓緒逕サ繧ッ繝ゥ繧ケ
00002 // 2011/02/07 Yuki YOKOKURA
00003 //
00004 // 逕サ髱「荳翫↓繧ー繝ゥ繝輔�ョ謠冗判繧定。後>縺セ縺吶��
00005 //
00006 // Copyright (C) 2011 Yuki YOKOKURA
00007 // This program is free software;
00008 // you can redistribute it and/or modify it under the terms of the GNU General Public License
00009 // as published by the Free Software Foundation; either version 3 of the License, or any later version.
00010 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
00011 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00012 // See the GNU General Public License for more details <http://www.gnu.org/licenses/>.
00013 // Besides, you can negotiate about other options of licenses instead of GPL.
00014 // If you would like to get other licenses, please contact us<yuki@katsura.sd.keio.ac.jp>.
00015 
00016 #ifndef GRAPHPLOT2D
00017 #define GRAPHPLOT2D
00018 
00019 #include <string>
00020 #include <curses.h>
00021 #include "FrameGraphics.hh"
00022 
00023 class GraphPlot2D {
00024         // �シ呈ャ。蜈�繧ー繝ゥ繝墓緒逕サ繧ッ繝ゥ繧ケ
00025         private:
00026                 GraphPlot2D(const GraphPlot2D&);                                        // 繧ウ繝斐�シ繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ菴ソ逕ィ遖∵ュ「
00027                 const GraphPlot2D& operator=(const GraphPlot2D&);       // 莉」蜈・貍皮ョ怜ュ蝉スソ逕ィ遖∵ュ「
00028                 FrameGraphics *pFG;                     // 繝輔Ξ繝シ繝�繧ー繝ゥ繝輔ぅ繝�繧ッ繧ケ繧ッ繝ゥ繧ケ縺ク縺ョ繝昴う繝ウ繧ソ
00029                 const char *Name;                       // 邵ヲ霆ク縺ョ蜷榊燕
00030                 int Xcur, Ycur;                         // 繧ー繝ゥ繝募キヲ荳翫�ョ繧ォ繝シ繧ス繝ォ蠎ァ讓�
00031                 int Hcur, Wcur;                         // 繧ー繝ゥ繝輔�ョ蟷�縺ィ鬮倥&(繧ォ繝シ繧ス繝ォ蠎ァ讓�)
00032                 int X, Y;                                       // 繧ー繝ゥ繝募キヲ荳翫�ョ蠎ァ讓�(繝斐け繧サ繝ォ)
00033                 int H, W;                                       // 繧ー繝ゥ繝輔�ョ鬮倥&縺ィ蟷�(繝斐け繧サ繝ォ)
00034                 int Ymax, Ymid, Ymin;           // 邵ヲ霆ク縺ョ譛�螟ァ蛟、�シ檎クヲ霆ク縺ョ逵溘s荳ュ縺ョ蛟、�シ檎クヲ霆ク縺ョ譛�蟆丞�、
00035                 int YmaxLab, YminLab;           // 邵ヲ霆ク縺ョ譛�螟ァ蛟、縺ョ繝ゥ繝吶Ν�シ檎クヲ霆ク縺ョ譛�蟆丞�、縺ョ繝ゥ繝吶Ν
00036                 int NumOfVar;                           // 螟画焚縺ョ螟ァ縺阪&
00037                 int x1[8],y1[8],x2[8],y2[8];// 繧ー繝ゥ繝墓緒逕サ逕ィ 蠎ァ讓呎�シ邏榊、画焚
00038                 int VerMax;                                     // 邵ヲ霆ク譛�螟ァ蛟、繝ゥ繝吶Ν縺ョ繧ォ繝シ繧ス繝ォ邵ヲ菴咲スョ
00039                 int VerMid;                                     // 邵ヲ霆ク荳ュ螟ョ蛟、繝ゥ繝吶Ν縺ョ繧ォ繝シ繧ス繝ォ邵ヲ菴咲スョ
00040                 int VerMin;                                     // 邵ヲ霆ク譛�蟆丞�、繝ゥ繝吶Ν縺ョ繧ォ繝シ繧ス繝ォ邵ヲ菴咲スョ
00041                 int HorMax;                                     // 讓ェ霆ク譛�螟ァ蛟、繝ゥ繝吶Ν縺ョ繧ォ繝シ繧ス繝ォ讓ェ菴咲スョ
00042                 int HorMid;                                     // 讓ェ霆ク荳ュ螟ョ蛟、繝ゥ繝吶Ν縺ョ繧ォ繝シ繧ス繝ォ讓ェ菴咲スョ
00043                 int HorMin;                                     // 讓ェ霆ク譛�蟆丞�、繝ゥ繝吶Ν縺ョ繧ォ繝シ繧ス繝ォ讓ェ菴咲スョ
00044                 short LineColor[8];                     // 繧ー繝ゥ繝輔�ョ邱壹�ョ濶イ縺ョ險ュ螳夂畑
00045                 double Ax;                                      // RealXTOX逕ィ縺ョ謠帷ョ嶺ソよ焚
00046                 double Ay,By;                           // RealYToY逕ィ縺ョ謠帷ョ嶺ソよ焚
00047                 int Hlaboffset;                         // 讓ェ霆ク繝ゥ繝吶Ν繧ェ繝輔そ繝�繝�
00048                 void DrawAxis(int Hoffset);     // 邵ヲ霆ク縺ィ讓ェ霆ク縺ョ謠冗判繧定。後≧髢「謨ー
00049                 int Round(double x);            // 蝗帶昏莠泌�・繧偵☆繧矩未謨ー
00050                 int RealXToX(double u);         // 讓ェ霆ク縺ョ螳滓焚蛟、縺九i逕サ髱「蠎ァ讓�(繝斐け繧サ繝ォ)縺ォ螟画鋤縺吶k髢「謨ー
00051                 int RealYToY(double u);         // 邵ヲ霆ク縺ョ螳滓焚蛟、縺九i逕サ髱「蠎ァ讓�(繝斐け繧サ繝ォ)縺ォ螟画鋤縺吶k髢「謨ー
00052                 int YLimitter(int y);           // 邵ヲ霆ク繝励Ο繝�繝医Μ繝溘ャ繧ソ (逕サ髱「蠎ァ讓�) 繧ー繝ゥ繝暮�伜沺繧偵�ッ縺ソ蜃コ縺ェ縺�繧医≧縺ォ縺吶k縺溘a縺ョ髢「謨ー
00053                 
00054         public:
00055                 GraphPlot2D();                  // 繧ウ繝ウ繧ケ繝医Λ繧ッ繧ソ
00056                 ~GraphPlot2D();                 // 繝�繧ケ繝医Λ繧ッ繧ソ
00057                 // 繧ー繝ゥ繝戊サク縺ョ險ュ螳壹r陦後≧髢「謨ー FG 繝輔Ξ繝シ繝�繧ー繝ゥ繝輔ぅ繝�繧ッ繧ケ繧ッ繝ゥ繧ケ縺ク縺ョ繝昴う繝ウ繧ソ�シ窟xisName 陦ィ遉コ蜷搾シ�
00058                 // PositionX 繧ー繝ゥ繝輔�ョ讓ェ菴咲スョ(繧ォ繝シ繧ス繝ォ蠎ァ讓�)�シ訓ositionY 繧ー繝ゥ繝輔�ョ邵ヲ菴咲スョ(繧ォ繝シ繧ス繝ォ蠎ァ讓�)
00059                 // Height 鬮倥&(繧ォ繝シ繧ス繝ォ蠎ァ讓�)�シ係idth 蟷�(繧ォ繝シ繧ス繝ォ蠎ァ讓�)�シ檎クヲ霆ク譛�螟ァ蛟、�シ檎クヲ霆ク譛�蟆丞�、�シ後�励Ο繝�繝医☆繧句、画焚縺ョ謨ー
00060                 void SetAxis(FrameGraphics &FG,const char *AxisName, int PositionX, int PositionY, int Height, int Width, int YmaxLabel, int YminLabel, int NumOfVariables);
00061                 // 豕「蠖「縺ョ謠冗判繧定。後≧髢「謨ー t�シ帶凾蛻サ�シ祁ar�シ帙�励Ο繝�繝医☆繧句、画焚
00062                 void DrawWave(volatile double t, double Var[8]);        
00063                 // 蜃。萓九r謠冗判縺吶k髢「謨ー N0�ス�7�シ帛、画焚蜷�
00064                 void Legend(const std::string VarName[8]);
00065 };
00066 
00067 
00068 #endif
00069 
 All Classes Files