38 #define cimg_plugin  "plugins/add_fileformat.h" 
   39 #define cimg_use_netcdf 
   41 #ifdef cimg_use_netcdf 
   42  #include "../NetCDF.Tool/struct_parameter_NetCDF.h" 
   45  #define     cimg_plugin2 "plugins/netcdf_file_format4CImg2.h" 
   46  #define cimglist_plugin2 "plugins/netcdf_file_format4CImgList2.h" 
   47  #include "../CImg.Tool/CImg_NetCDF.h" 
   51 #include "Cmesh_factory.h" 
   53 #include "CImg_math.h" 
   54 #include "textcolor.h" 
   60 template<
typename T,
typename Timg>
 
   66   std::string class_name;
 
   67   std::string m_type, m_name;
 
   69   std::vector<std::string> m_componentName; 
 
   72   CImgList<int> m_connect; 
 
   74   int _3D, m_threadNB, m_numPix, m_storeMesh;
 
   78   std::vector<int> m_pitch;
 
   79   std::vector<int> m_win;
 
   85       class_name = 
"mesh : mother";
 
   88       {m_threadNB = omp_get_num_threads();}
 
   95     int error = assign(oImage);
 
   99       set_nodes(oImage, m_node); 
 
  100       set_connectivity(oImage, m_node, m_connect);
 
  107   void init(CParameterNetCDF &fp)
 
  114   virtual int get_attributes(CParameterNetCDF &fp)
 
  121     error = fp.loadAttribute(att,m_componentName);
 
  122     if (m_componentName.size() == 3){_3D = 1;}
else{_3D = 0;}
 
  124     if (this->m_verbose){std::cout<<
"\tcomponents : [ ";
for (
int i=0; i<m_componentName.size(); i++){std::cout<<m_componentName[i]<<
" ";}std::cout<<
"]\n";}
 
  128   virtual int cropList(
const Cimage<Timg> &oImage, 
const int &elem, CImg<Timg> &list, std::vector<T> &coord0) 
const = 0;
 
  133     return m_node[0].size();
 
  140     return m_connect.size();
 
  147     return m_componentName.size();
 
  151   virtual int num_mod()
 const 
  154     return m_connect[0].size();
 
  158   virtual int grid_dims(
const int &i) 
const = 0;
 
  159   virtual void set_nodes(
const Cimage<Timg> &oImage, CImgList<T> &nodes) = 0;
 
  160   virtual void set_connectivity(
const Cimage<Timg> &oImage, 
const CImgList<T> &nodes, CImgList<int> &elements) = 0;
 
load image and mask from cdl and store fields. It also creates a resized version of data in the case ...