00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef FLOAT3D_H
00019 #define FLOAT3D_H
00020
00021 #include <qgroupbox.h>
00022
00023 #include "float2d.h"
00024
00025
00029 class floatBox3D : public QGroupBox {
00030 Q_OBJECT
00031
00032 public:
00033 floatBox3D(const float *data, float lowbound, float uppbound, long int nx, long int ny, long int nz,
00034 int coarseFactor, QWidget *parent, const char *name,
00035 const float *overlay_map=0, float lowbound_map=0.0, float uppbound_map=0.0, unsigned int nx_map=0, unsigned int ny_map=0, unsigned int nz_map=0, bool map_firescale=false, float map_rectsize=0.8,
00036 bool colormap=false);
00037 ~floatBox3D();
00038
00039
00040 void write_pixmap(const char* fname, const char* format, bool dump_all=false) const;
00041
00042 QLabel* get_map_legend(QWidget* parent) const {return label->get_map_legend(parent);}
00043 void write_map_legend(const char* fname, const char* format) const {label->write_map_legend(fname, format);}
00044
00045
00046 public slots:
00047 void refresh(const float* data, float lowbound, float uppbound);
00048 void refreshMap(const float* map, float lowbound_map, float uppbound_map, float rectsize) {map_cache=map; label->refreshMap(map_cache+onemapsize*get_current_z(),lowbound_map,uppbound_map,rectsize);}
00049
00050 private slots:
00051 void emitClicked(int xposition, int yposition) {emit clicked(xposition,yposition,get_current_z());}
00052 void emitNewProfile(const float *data, int npts, bool horizontal, int position) {emit newProfile(data, npts, horizontal, position);}
00053 void emitNewMask(const float *data) {emit newMask(data,get_current_z());}
00054
00055 protected slots:
00056 void changez(int iz);
00057
00058
00059 signals:
00060 void clicked(int x, int y, int z);
00061 void newProfile(const float *data, int npts, bool horizontal, int position);
00062 void newMask(const float* data, int slice);
00063
00064 protected:
00065
00066 floatLabel2D* label;
00067
00068 int get_current_z() const;
00069
00070 private:
00071
00072 virtual void repaint() {}
00073
00074 void repaint_slice(int iz) const;
00075
00076 GuiSlider* zslider;
00077 QLabel* zval;
00078
00079 GuiGridLayout *grid;
00080
00081 QLabel* maplegend;
00082
00083 const float* data_cache;
00084 unsigned int oneimagesize;
00085 unsigned int nz_cache;
00086 float lowbound_cache;
00087 float uppbound_cache;
00088
00089 const float* map_cache;
00090 float lowbound_map_cache;
00091 float uppbound_map_cache;
00092 float rectsize_map_cache;
00093
00094 unsigned int onemapsize;
00095
00096 float* mask3d;
00097 };
00098
00099 #endif