00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MSL_GUIPLANNER_H
00020 #define MSL_GUIPLANNER_H
00021
00022 #include <math.h>
00023 #include <stdio.h>
00024 #include <fstream.h>
00025 #include <sys/stat.h>
00026 #include <signal.h>
00027
00028 #include "defs.h"
00029
00030 #include "gui.h"
00031 #include "planner.h"
00032 #include "rrt.h"
00033 #include "prm.h"
00034 #include "fdp.h"
00035
00037
00038 class GuiPlanner;
00039 class MSLPlotWindow;
00040
00041 class MSLPlannerWindow : public FXMainWindow {
00042 FXDECLARE(MSLPlannerWindow)
00043 protected:
00044 FXMenubar* menubar;
00045 FXMenubar* vcrbar;
00046 FXMenubar* buttonbar;
00047 FXMenuPane* loadmenu;
00048 FXMenuPane* savemenu;
00049 FXMenuPane* plotmenu;
00050 FXMenuPane* plannermenu;
00051 FXMatrix* matrix;
00052
00053 FXDataTarget plannerdeltat_target;
00054 FXDataTarget numnodes_target;
00055 FXDataTarget drawindexx_target;
00056 FXDataTarget drawindexy_target;
00057 FXDataTarget animationtimescale_target;
00058 FXDataTarget ambientlight_target;
00059
00060 GuiPlanner* GP;
00061
00062 public:
00063 MSLPlannerWindow() {}
00064 MSLPlannerWindow(GuiPlanner* gp);
00065 virtual ~MSLPlannerWindow();
00066
00067 void create();
00068 void Restart();
00069 long onCmdTimer(FXObject*,FXSelector,void*);
00070 long GeneralHandler(FXObject*,FXSelector,void*);
00071
00072 friend class GuiPlanner;
00073 friend class MSLPlotWindow;
00074
00075 };
00076
00077
00078
00079 class MSLPlotWindow : public FXDialogBox {
00080
00081
00082 FXDECLARE(MSLPlotWindow)
00083 private:
00084
00085 FXHorizontalFrame *contents;
00086 FXVerticalFrame *canvasFrame;
00087 FXVerticalFrame *buttonFrame;
00088 FXCanvas *canvas;
00089 int indexx,indexy;
00090
00091 protected:
00092 MSLPlotWindow(){}
00093
00094 MSLPlannerWindow* Owner;
00095 GuiPlanner* GP;
00096
00097 public:
00098
00099
00100 long onPaint(FXObject*,FXSelector,void*);
00101 long onCmdPrint(FXObject*,FXSelector,void*);
00102
00103 MSLPlotWindow(MSLPlannerWindow* owner);
00104
00105 void drawPage(FXDC& dc,FXint w,FXint h,FXint tx = 0,FXint ty = 0);
00106
00107
00108 enum{
00109 ID_CANVAS=FXMainWindow::ID_LAST,
00110 ID_PRINT,
00111 ID_LAST
00112 };
00113 };
00114
00115
00116
00117 class GuiPlanner: public FXApp, public Gui {
00118 protected:
00119 virtual void Init();
00120 virtual void CreateMenuWindow();
00121
00122 MSLPlannerWindow* Window;
00123 public:
00124 virtual void HandleEvents();
00125 virtual void ButtonHandle(int b);
00126 double LineWidth;
00127 double PSLineWidth;
00128 int DrawIndexX,DrawIndexY;
00129 Planner *Pl;
00130 GuiPlanner(Render *render, Planner *planner);
00131 virtual ~GuiPlanner(){};
00132 void ResetPlanner();
00133 void WriteGraphs();
00134 void ReadGraphs();
00135
00136 void ReadAnimationFrames();
00137 void WriteAnimationFrames();
00138 void ReadPath();
00139 void WritePath();
00140 void DrawGraphs();
00141
00142 friend class MSLPlotWindow;
00143 };
00144
00145 #endif