pPlotterWindow.h
Go to the documentation of this file.00001
00002 #ifndef __pPlotterWindow_h__
00003 #define __pPlotterWindow_h__
00004
00005
00006
00007
00008
00009
00010 #include <wx/wxprec.h>
00011 #ifdef __BORLANDC__
00012 #pragma hdrstop
00013 #endif
00014 #ifndef WX_PRECOMP
00015 #include <wx/wx.h>
00016 #endif
00017
00018
00019
00020
00021
00022
00023 #include "pPlotterLayer.h"
00024 #include "pGraphicalFunction.h"
00025 #include "mathplot.h"
00026 #include "marTypes.h"
00027
00028
00029
00031 enum
00032 {
00033 pwID_ADDPOINT = 2010,
00034 pwID_DELPOINT,
00035 pwID_SHOWPOINTS,
00036 pwID_STARTDRAWING,
00037 pwID_DELFUNCTION,
00038 pwID_STOPDRAWING,
00039 pwID_ADDNEWPOINT,
00040 pwID_NOSHOWPOINTS,
00041 pwID_MYZOOMIN,
00042 pwID_MYZOOMOUT,
00043 pwID_SPLINE,
00044 pwID_LINE,
00045 pwID_SAVE,
00046 pwID_LOAD,
00047 pwID_CHANGECOLOR,
00048 pwID_TRASLATEACTUALFUNCTION,
00049 pwID_LEFTUP
00050
00051 };
00052
00053 #define MAX_FUNCTIONS 7
00054
00058 #define DEFAULT_SCALE 1
00059
00062 #define MAX_SCALE 2
00063
00066 #define USER_SCALE 3
00067
00068
00069
00070
00071
00072
00073
00074
00075 #define DEFAULT_PLOTTER 1
00076
00077
00078
00079
00080 #define HISTOGRAM_PLOTTER 2
00081
00084
00085
00086
00087
00088
00089 class creaMaracasVisu_EXPORT pPlotterWindow: public mpWindow
00090 {
00091 public:
00095 pPlotterWindow( wxWindow *parent, wxWindowID id,
00096 const wxPoint &pos = wxDefaultPosition,
00097 const wxSize &size = wxDefaultSize,
00098 int flags = 0);
00099 ~pPlotterWindow();
00100
00101
00102
00103
00104
00105
00106
00107 void setPopUpMenu(bool startD,bool stopD,bool smooth,bool line, bool zoomIn,
00108 bool zoomOut,bool showPoints,bool noShowPoints,bool changeColor, bool addP,
00109 bool delPoint,bool load,bool save);
00110
00111
00112
00113
00114
00115
00116
00117
00118 void onLeftUp(wxMouseEvent& event);
00119
00120
00121
00122
00123
00124 void onMoveFunction(wxCommandEvent& aEvent);
00125
00126
00130 void onChangeColor(wxCommandEvent& aEvent);
00131
00132
00136 void onLoad(wxCommandEvent& aEvent);
00137
00141 void onSave(wxCommandEvent& aEvent);
00142
00143
00148 void onLine(wxCommandEvent& aEvent);
00149
00150
00154 void onSplinePoints(wxCommandEvent& aEvent);
00155
00156
00160 void onMyZoomOut(wxCommandEvent& aEvent);
00161
00165 void onMyZoomIn(wxCommandEvent& aEvent);
00166
00171 wxPoint getRealPoint(wxPoint pixelPoint);
00172
00176 void onNoShowPoints(wxCommandEvent& aEvent);
00177
00181 void onStopDrawing(wxCommandEvent& aEvent);
00182
00188 void onAddNewPoint(wxCommandEvent& aEvent);
00189
00193 void onStartDrawing(wxCommandEvent& aEvent);
00194
00198 void onMouseMove(wxMouseEvent& event);
00199
00205 void onChangeActual(wxMouseEvent& event);
00206
00210 void onAddPoint(wxMouseEvent& aEvent);
00211
00215 void onDeletePoint(wxCommandEvent& aEvent);
00216
00220 void onShowPoints(wxCommandEvent& aEvent);
00221
00226 void changeFuntionType(int aTheType, bool aForAll);
00227
00232 int addFunction(pGraphicalFunction * function);
00233
00238 bool DeletePointFunction(pGraphicalFunction* function,wxPoint point);
00239
00243 bool deleteFunction(pGraphicalFunction * f);
00248 void setActualFunction(pGraphicalFunction* newActual);
00252 pGraphicalFunction* getActualFunction();
00253
00257 void InitFunctionForVectors( pGraphicalFunction *ff );
00258 pGraphicalFunction * getFunctionForVectors( double* vectorX, int sizeX,double * vectorY, int sizeY );
00259 pGraphicalFunction * getFunctionForVectors( std::vector<double> *vectorX, std::vector<double> *vectorY );
00260
00261
00262
00263
00264
00265
00266 void setActualScales();
00267
00268
00269
00270
00271
00272 void setmLog(wxTextCtrl *m_log1)
00273 {
00274 m_log=m_log1;
00275 }
00276
00277
00278
00279
00280
00281
00282 void actualizeViewRange(int newMinX, int newMaxX);
00283
00284
00285
00286
00287
00288 void setLineGuidesCondition(bool ifDrawing)
00289 {
00290 drawGuides = ifDrawing;
00291 }
00292
00293
00294
00295
00296
00297
00298 bool drawGuideLines()
00299 {
00300 return drawGuides;
00301 }
00302
00303
00304
00305
00306 void OnGuideLines (wxCommandEvent &event);
00307
00308
00309
00310
00311 void writeInText(wxString &t)
00312 {
00313 t=text;
00314 }
00315
00316
00317
00318
00319 pGraphicalFunction* getFunction(int index);
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330 void moveFunctions(float porcentageMinX,float porcentageMaxX);
00335 int addFunctionToMove(pGraphicalFunction * function);
00336
00337
00338 private:
00339
00343 pGraphicalFunction* actual;
00347 wxList functions;
00348
00352 bool drawing;
00357 int movingPointIndex;
00358
00365 int scaleWay;
00366
00367
00368
00369
00370
00371
00372 wxTextCtrl *m_log;
00373 wxString text;
00374
00375
00376
00377
00378 wxList functionsToMove;
00379
00380
00381
00382 bool movingFunction;
00383
00384
00385 int initialMovingCLick;
00386
00387
00388
00389
00390 std::vector<double> backUpActualVector;
00391
00392
00393
00394 bool movingPoints;
00395
00396 DECLARE_CLASS (pPlotterWindow)
00397
00398
00399
00400 DECLARE_EVENT_TABLE()
00401 };
00402
00403 #endif
00404
00405