13 #include <vapor/MyBase.h>
14 #include <vapor/BlkMemMgr.h>
15 #include <vapor/common.h>
16 #include <vapor/RegularGrid.h>
17 #include <vapor/LayeredGrid.h>
18 #include <vapor/SphericalGrid.h>
19 #include <vapor/StretchedGrid.h>
52 VAR3D, VAR2D_XY, VAR2D_XZ, VAR2D_YZ
73 virtual void GetDim(
size_t dim[3],
int reflevel = 0)
const {
74 return(_GetDim(dim, reflevel));
83 virtual vector <size_t>
GetCRatios()
const {
return( _GetCRatios()); }
88 return(_GetCoordSystemType());
93 virtual string GetGridType()
const {
return(_GetGridType()); };
97 virtual vector<double> GetExtents(
size_t ts = 0);
107 return(_GetMapProjection());
110 virtual vector <string> GetVariableNames()
const;
114 virtual vector <string> GetVariables3D()
const;
118 virtual vector <string> GetVariables2DXY()
const;
122 virtual vector <string> GetVariables2DXZ()
const;
126 virtual vector <string> GetVariables2DYZ()
const;
131 return(_GetCoordinateVariables());
137 return(_GetPeriodicBoundary());
143 return(_GetGridPermutation());
149 return(_GetTSUserTime(ts));
155 return(_GetTSUserTimeStamp(ts, s));
266 size_t ts,
const char *varname,
float range[2],
267 int reflevel = 0,
int lod = 0
298 virtual int VariableExists(
306 size_t ts,
const char *varname,
int req_reflevel,
int req_lod,
307 int &reflevel,
int &lod
330 int NewPipeline(
PipeLine *pipeline);
339 void RemovePipeline(
string name);
349 bool IsVariableDerived(
string varname)
const;
360 bool IsVariableNative(
string varname)
const;
362 virtual VarType_T GetVarType(
const string &varname)
const;
364 bool GetMissingValue(
string varname,
float &value)
const;
372 void PurgeVariable(
string varname);
403 virtual void MapUserToVox(
405 const double vcoord0[3],
size_t vcoord1[3],
int reflevel = 0,
int lod = 0
432 virtual void MapVoxToUser(
434 const size_t vcoord0[3],
double vcoord1[3],
int ref_level = 0,
int lod=0
454 virtual void GetEnclosingRegion(
455 size_t ts,
const double minu[3],
const double maxu[3],
456 size_t min[3],
size_t max[3],
457 int reflevel = 0,
int lod = 0
470 virtual bool IsCoordinateVariable(
string varname)
const;
476 void PrintCache(std::ostream &o);
503 virtual void _GetDim(
size_t dim[3],
int reflevel = 0)
const = 0;
521 virtual void _GetBlockSize(
size_t bs[3],
int reflevel)
const = 0;
532 virtual int _GetNumTransforms()
const = 0;
546 vector <size_t> cr; cr.push_back(1);
return(cr);
582 virtual vector<double> _GetExtents(
size_t ts = 0)
const = 0;
600 vector <double> empty;
return(empty);
606 vector <double> empty;
return(empty);
612 vector <double> empty;
return(empty);
620 virtual long _GetNumTimeSteps()
const = 0;
637 virtual vector <string> _GetVariables3D()
const = 0;
645 virtual vector <string> _GetVariables2DXY()
const = 0;
653 virtual vector <string> _GetVariables2DXZ()
const = 0;
661 virtual vector <string> _GetVariables2DYZ()
const = 0;
678 v.push_back(
"NONE"); v.push_back(
"NONE"); v.push_back(
"ELEVATION");
689 virtual vector<long> _GetPeriodicBoundary()
const = 0;
698 vector <long> v; v.push_back(0); v.push_back(1); v.push_back(2);
return(v);
716 virtual double _GetTSUserTime(
size_t ts)
const = 0;
732 virtual void _GetTSUserTimeStamp(
size_t ts,
string &s)
const = 0;
750 virtual int _VariableExists(
795 virtual int _OpenVariableRead(
820 virtual void _GetValidRegion(
821 size_t min[3],
size_t max[3],
int reflevel
867 virtual int _BlockReadRegion(
868 const size_t bmin[3],
const size_t bmax[3],
876 virtual int _CloseVariable() = 0;
894 list <region_t> _regionsList;
896 BlkMemMgr *_blk_mem_mgr;
898 vector <PipeLine *> _PipeLines;
911 size_t ts,
string varname,
int ref,
int lod,
float range[2]
914 size_t ts,
string varname,
int ref,
int lod,
const float range[2]
917 size_t ts,
string varname,
int ref,
int lod
924 size_t ts,
string varname,
int ref,
size_t min[3],
size_t max[3]
927 size_t ts,
string varname,
int ref,
const size_t min[3],
931 size_t ts,
string varname,
int ref
938 size_t ts,
string varname,
int ref,
int lod,
bool &exist
940 void SetExist(
size_t ts,
string varname,
int ref,
int lod,
bool exist);
941 void PurgeExist(
size_t ts,
string varname,
int ref,
int lod);
943 void PurgeVariable(
string varname);
944 void Clear() {_cache.clear(); }
951 map <size_t, bool> exist;
952 map <size_t, vector <size_t> > region;
953 map <size_t, vector <float> > range;
956 var_info *get_var_info(
size_t ts,
string varname)
const;
958 map <size_t, map <string, var_info> > _cache;
961 VarInfoCache _VarInfoCache;
962 std::map <size_t, vector <double> > _extentsCache;
964 float *get_region_from_cache(
974 float *get_region_from_fs(
985 size_t ts,
string varname,
int reflevel,
int lod,
986 const size_t min[3],
const size_t max[3],
bool lock,
bool *ondisk
989 void unlock_blocks(
const float *blks);
1008 const size_t min[3],
1012 void free_var(
const string &,
int do_native);
1016 int _DataMgr(
size_t mem_size);
1019 size_t ts,
string varname,
int reflevel,
int lod,
1020 const size_t min[3],
const size_t max[3],
bool lock,
1021 float *xcblks,
float *ycblks,
float *zcblks
1027 const map <
string, vector <string> > &graph,
1029 const vector <string> &depends
1035 const PipeLine *a,
const PipeLine *b
1038 vector <string> get_native_variables()
const;
1039 vector <string> get_derived_variables()
const;
1041 PipeLine *get_pipeline_for_var(
string varname)
const;
1044 const vector <double> &xin, vector <double> &xout,
size_t ldelta
1047 void map_vox_to_user_regular(
1048 size_t timestep,
const size_t vcoord0[3],
double vcoord1[3],
int reflevel
1051 void map_vox_to_blk(
1052 const size_t vcoord[3],
size_t bcoord[3],
int reflevel = -1
1055 void get_dim_blk(
size_t bdim[3],
int reflevel)
const;
1058 size_t ts,
string varname,
int reflevel,
int lod,
1059 const size_t bmin[3],
const size_t bmax[3],
1060 float *blocks,
float *xcblocks,
float *ycblocks,
float *zcblocks
1087 vector <string> inputs,
1088 vector <pair <string, DataMgr::VarType_T> > outputs
1105 virtual int Calculate (
1106 vector <const RegularGrid *> input_grids,
1107 vector <RegularGrid *> output_grids,
1119 const vector <string> &
GetInputs()
const {
return (_inputs); };
1123 const vector <pair <string, DataMgr::VarType_T> > &
GetOutputs()
const {
1130 vector <string> _inputs;
1131 vector<pair<string, DataMgr::VarType_T> > _outputs;
1137 #endif // _DataMgr_h_
virtual string GetGridType() const
int GetNumTransforms() const
const vector< string > emptyVec
virtual void GetDim(size_t dim[3], int reflevel=0) const
const vector< pair< string, DataMgr::VarType_T > > & GetOutputs() const
Returns the PipeLine outputs.
virtual double GetTSUserTime(size_t ts) const
A cache based data reader.
virtual vector< double > _GetTSXCoords(size_t ts) const
const vector< string > & GetInputs() const
Returns the PipeLine inputs.
virtual string GetCoordSystemType() const
This class implements a 2D or 3D regular grid: a tessellation of Euculidean space by rectangles (2D) ...
virtual string GetMapProjection() const
int UnlockRegion(const float *)
virtual vector< long > GetGridPermutation() const
virtual string _GetMapProjection() const
virtual string _GetGridType() const
virtual string _GetCoordSystemType() const
virtual vector< long > GetPeriodicBoundary() const
virtual vector< size_t > _GetCRatios() const
virtual bool _GetMissingValue(string varname, float &value) const
PipeLine(string name, vector< string > inputs, vector< pair< string, DataMgr::VarType_T > > outputs)
const string & GetName() const
Returns the PipeLine stages name.
virtual vector< long > _GetGridPermutation() const
virtual vector< double > _GetTSZCoords(size_t ts) const
virtual const float * _GetDataRange() const
virtual vector< size_t > GetCRatios() const
virtual vector< string > _GetCoordinateVariables() const
virtual void GetTSUserTimeStamp(size_t ts, string &s) const
virtual vector< string > GetCoordinateVariables() const
virtual long GetNumTimeSteps() const
virtual vector< double > _GetTSYCoords(size_t ts) const