00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef JDXWIDGET_H
00019 #define JDXWIDGET_H
00020
00021 #include <qwidget.h>
00022
00023 #include "odinqt.h"
00024
00025
00026 #include <tjutils/tjarray.h>
00027 #include <odinpara/jdxbase.h>
00028
00030
00031 #define _MAX_SLIDER_STEPS_ 100
00032 #define _MAX_LABEL_LENGTH_ 15
00033 #define _FLOAT_DIGITS_ 3
00034
00035 #define _INFOBOX_LINEWIDTH_ 50
00036
00037 #define _MAX_SUBWIDGETS_FOR_ALIGNCENT_ 5
00038
00040
00041
00042 class JcampDxClass;
00043 class intScientSlider;
00044 class intLineBox;
00045 class floatScientSlider;
00046 class floatLineBox;
00047 class enumBox;
00048 class buttonBox;
00049 class floatBox1D;
00050 class floatBox3D;
00051 class complexfloatBox1D;
00052 class stringBox;
00053 class floatLineBox3D;
00054
00055 class JDXwidgetDialog;
00056 class JcampDxBlockWidget;
00057 class JDXeditCaller;
00058
00060
00061
00067 class JDXwidget : public QWidget {
00068 Q_OBJECT
00069
00070 public:
00071
00083 JDXwidget(JcampDxClass& ldr,unsigned int columns=1, QWidget *parent=0, bool doneButton=false, const char* omittext="", bool storeLoadButtons=false);
00084 ~JDXwidget();
00085
00086
00087
00088 void write_pixmap(const char* fname, const char* format, bool dump_all=false) const;
00089 void write_map_legend(const char* fname, const char* format) const;
00090
00091
00092 signals:
00096 void valueChanged();
00097
00101 void doneButtonPressed();
00102
00103
00104 void clicked(int x, int y, int z);
00105 void newProfile(const float *data, int npts, bool horizontal, int position);
00106 void newMask(const float* data, int slice);
00107
00108
00109
00110 void updateSubWidget();
00111 void deleteSubDialogs();
00112
00113 void newintval(int);
00114 void newfloatval(float);
00115 void newenumval(int);
00116 void newboolval(bool);
00117 void newfloatArr1( const float*, int, float, float);
00118
00119 void newfloatArr2( const float*, float, float);
00120 void newfloatArrMap(const float*, float, float, float);
00121 void newcomplexArr( const float*, const float*, int, float, float);
00122 void newfuncval(int);
00123 void newstringval(const char*);
00124 void newfilenameval(const char*);
00125 void newformulaval(const char*);
00126 void newtripleval(float,float,float);
00127
00128
00129 public slots:
00130
00134 void updateWidget();
00135
00139 void deleteDialogs();
00140
00141
00142 private slots:
00143 void emitValueChanged();
00144 void emitDone();
00145 void emitClicked(int x, int y, int z) {emit clicked(x,y,z);}
00146 void emitNewProfile(const float *data, int npts, bool horizontal, int position) {emit newProfile(data, npts, horizontal, position);}
00147 void emitNewMask(const float *data, int slice) {emit newMask(data,slice);}
00148
00149 void changeJDXint( int );
00150 void changeJDXfloat( float );
00151 void changeJDXenum( int );
00152 void changeJDXbool ( bool );
00153 void changeJDXaction();
00154 void changeJDXfunction( int );
00155 void changeJDXstring(const char*);
00156 void changeJDXfileName(const char*);
00157 void browseJDXfileName();
00158 void changeJDXformula(const char*);
00159 void changeJDXtriple(float,float,float);
00160 void infoJDXformula();
00161 void editJDXfunction();
00162 void infoJDXfunction();
00163
00164 public:
00165 STD_string get_label() const;
00166 unsigned int get_rows() const {return rows;}
00167 unsigned int get_cols() const {return cols;}
00168
00169
00170 private:
00171
00172 void set_widget(QWidget *widget, GuiGridLayout::Alignment alignment = GuiGridLayout::Default, bool override_enabled=false);
00173
00174 unsigned int get_sizedfarray_size_and_factor(unsigned int& nx, unsigned int& ny, unsigned int& nz) const;
00175
00176 void create_or_update_floatArrwidget(const farray& arr, bool initial);
00177
00178
00179
00180 GuiGridLayout* grid;
00181
00182 QWidget* widget_cache;
00183
00184 JcampDxBlockWidget* blockwidget;
00185 intScientSlider* intslider;
00186 intLineBox* intedit;
00187 floatScientSlider* floatslider;
00188 floatLineBox* floatedit;
00189 enumBox* enumwidget;
00190 buttonBox* boolwidget;
00191 buttonBox* actionwidget;
00192 QLabel* floatArrempty;
00193 floatBox1D* floatArrwidget1;
00194 floatLineBox* floatArredit;
00195 floatBox3D* floatArrwidget2;
00196 complexfloatBox1D* complexArrwidget;
00197 stringBox* stringwidget;
00198 stringBox* filenamewidget;
00199 enumBox* funcwidget;
00200 stringBox* formulawidget;
00201 floatLineBox3D* triplewidget;
00202
00203
00204 farray sizedfarray;
00205 farray mapfarray;
00206 ndim oldfarraysize;
00207 farray overlay_map;
00208
00209 QWidget* vport;
00210
00211 JcampDxClass& val;
00212 STD_string ldrlabel;
00213 STD_string ldrlabel_uncut;
00214 bool label_cut;
00215
00216 STD_list<JDXwidgetDialog*> subdialogs;
00217
00218 unsigned int rows,cols;
00219
00220 };
00221
00222
00223
00224
00225 #endif