00001
00007 #pragma once
00008
00009 #include <string>
00010 #include <vector>
00011
00012 #include <vmmlib\vmmlib.hpp>
00013
00014 #include "Tools/Exception.hpp"
00015 #include "LoadingDialog.h"
00016 #include "DataFrame.hpp"
00017
00018 typedef Tool::Exception FlowDataException;
00019
00021 class FlowData {
00022 private:
00023 std::string name;
00024 std::string path;
00025
00026 unsigned size[3];
00027 int num_sets;
00028 int num_timestep;
00029 float d_timestep;
00030
00031 std::vector<float> grid;
00032 std::vector<DataFrame> dataframes;
00033
00034 void loadGrid(const std::string &gridfile);
00035 void loadData(CLoadingDialog &dlg,const std::string &name, const std::string &path);
00036
00037 public:
00038 FlowData();
00039 ~FlowData();
00040
00042 void load(CLoadingDialog &dlg,const std::string &gridfile);
00043 void unload();
00044 bool isLoaded() const;
00045
00047 void normalise();
00048
00050 float *getGridArray();
00051 const unsigned *getXYZGridSize() const;
00052 const unsigned getGridSize() const;
00053
00054 const float getLength();
00055 const float getWidth();
00056 const float getHeight();
00057
00058 DataFrame &getDataFrame(const unsigned &index);
00059 const unsigned &getNumFrames();
00060 const float &getFrameTime() const;
00061
00062 vmml::vec3f getPosition(const unsigned &u,const unsigned &v,const unsigned &w);
00063
00064 std::vector<float> FlowData::getHistogram(const unsigned &layer, const int &size);
00065 };