00001 #ifndef PARTICLEEDITOR_H_ 00002 #define PARTICLEEDITOR_H_ 00003 00004 #include <gtk/gtk.h> 00005 #include <string> 00006 #include <cmath> 00007 #include "igl.h" 00008 #include "ParticlePreview.h" 00009 00010 namespace ui 00011 { 00012 class ParticleEditor 00013 { 00014 private: 00015 00016 // Main dialog widget 00017 GtkWidget* _widget; 00018 00019 // Model preview widget 00020 ParticlePreview _particlePreview; 00021 00022 // Show the dialog and block 00023 void showAndBlock (); 00024 00025 GtkWidget* createButtons (); 00026 GtkWidget* createPreviewPanel (); 00027 00028 // Initialise the GL widget, to avoid doing this every frame 00029 void initialisePreview (); 00030 00031 /* GTK CALLBACKS */ 00032 00033 static void callbackOK (GtkWidget*, ParticleEditor*); 00034 static void callbackCancel (GtkWidget*, ParticleEditor*); 00035 00036 public: 00037 00038 ParticleEditor (); 00039 00040 virtual ~ParticleEditor (); 00041 00042 std::string save (); 00043 00044 void showAndBlock (const std::string& particleID); 00045 }; 00046 } 00047 00048 #endif /* PARTICLEEDITOR_H_ */