1.3.0
CCC
 
convert.cpp File Reference
#include "geoslib_f.h"
#include "geoslib_old_f.h"
#include "geoslib_f_private.h"
#include "geoslib_define.h"
#include "Basic/AException.hpp"
#include "Basic/Utilities.hpp"
#include "Basic/File.hpp"
#include "Basic/String.hpp"
#include "Basic/ASerializable.hpp"
#include "Basic/VectorHelper.hpp"
#include "Db/Db.hpp"
#include "OutputFormat/GridEclipse.hpp"
#include "OutputFormat/GridIfpEn.hpp"
#include "OutputFormat/GridXYZ.hpp"
#include "OutputFormat/GridZycor.hpp"
#include "OutputFormat/GridIrap.hpp"
#include "OutputFormat/GridBmp.hpp"
#include "OutputFormat/GridArcGis.hpp"
#include "OutputFormat/GridF2G.hpp"
#include "OutputFormat/FileVTK.hpp"
#include "OutputFormat/FileLAS.hpp"
#include "OutputFormat/vtk.h"
#include <string.h>
#include <sstream>
#include <string>
#include <stdio.h>
#include <algorithm>

Functions

int db_grid_write_XYZ (const char *filename, DbGrid *db, int icol)
 
int db_grid_write_zycor (const char *filename, DbGrid *db, int icol)
 
DbGriddb_grid_read_zycor (const char *filename, int)
 
int db_grid_write_arcgis (const char *filename, DbGrid *db, int icol)
 
int db_grid_write_bmp (const char *filename, DbGrid *db, int icol, int nsamplex, int nsampley, int nmult, int ncolor, int flag_low, int flag_high, double valmin, double valmax, int *red, int *green, int *blue, int mask_red, int mask_green, int mask_blue, int ffff_red, int ffff_green, int ffff_blue, int low_red, int low_green, int low_blue, int high_red, int high_green, int high_blue)
 
DbGriddb_grid_read_bmp (const char *filename, int)
 
int db_grid_write_irap (const char *filename, DbGrid *db, int icol, int nsamplex, int nsampley)
 
int db_grid_write_ifpen (const char *filename, DbGrid *db, int ncol, int *icols)
 
DbGriddb_grid_read_ifpen (const char *filename, int)
 
int db_grid_write_eclipse (const char *filename, DbGrid *db, int icol)
 
int db_write_vtk (const char *filename, DbGrid *db, const VectorInt &cols)
 
Dbdb_well_read_las (const char *filename, double xwell, double ywell, double cwell, int)
 
DbGriddb_grid_read_f2g (const char *filename, int)
 
void csv_print_double (double value)
 
int csv_manage (const char *filename, const CSVformat &csv, int mode, int nitem, bool flagInteger, bool verbose)
 
int db_write_csv (Db *db, const char *filename, const CSVformat &csvfmt, int flag_allcol, int flag_coor, bool flagInteger)
 
int csv_table_read (const String &filename, const CSVformat &csvfmt, int verbose, int ncol_max, int nrow_max, int *ncol_arg, int *nrow_arg, VectorString &names, VectorDouble &tab)
 

Function Documentation

int csv_manage ( const char *  filename,
const CSVformat csv,
int  mode,
int  nitem,
bool  flagInteger,
bool  verbose 
)

Manage the Utility to write into a CSV file

Returns
Error return code
Parameters
[in]filenameName of the CSV file
[in]csvCSVFormat description
[in]mode1 for opening File; -1 for closing File
[in]nitemNumber of items per line
[in]flagIntegertrue if the numerical values must be printed as integer
[in]verboseVerbose flag
Remarks
: This procedure manages an internal structure (declared as static)
: When opened, you can use csv_print_string() or csv_print_double()
: in order to store items in the file
: Do not forget to use csv_manage(-1,...) to close the file
void csv_print_double ( double  value)

Write a DOUBLE element into the (opened) CSV file

Parameters
[in]valueReal value to be written
Remarks
: This function uses CSV_ENCODING static structure
: which must have been initiated beforehand
int csv_table_read ( const String filename,
const CSVformat csvfmt,
int  verbose,
int  ncol_max,
int  nrow_max,
int *  ncol_arg,
int *  nrow_arg,
VectorString names,
VectorDouble tab 
)

Read the Data frame from a CSV file. Reserved for numerical data frame.

Returns
Error return code
Parameters
[in]filenameName of the CSV file
[in]csvfmtCSVformat structure
[in]verbose1 for a verbose output; 0 otherwise
[in]ncol_maxMaximum number of columns (or -1)
[in]nrow_maxMaximum number of rows (or -1)
[out]ncol_argNumber of columns
[out]nrow_argNumber of rows
[out]namesArray containing the variable names
[out]tabArray of values
Remarks
The returned array 'tab' is organized by sample
DbGrid* db_grid_read_bmp ( const char *  filename,
int   
)
DbGrid* db_grid_read_f2g ( const char *  filename,
int   
)
DbGrid* db_grid_read_ifpen ( const char *  filename,
int   
)
DbGrid* db_grid_read_zycor ( const char *  filename,
int   
)
int db_grid_write_arcgis ( const char *  filename,
DbGrid db,
int  icol 
)
int db_grid_write_bmp ( const char *  filename,
DbGrid db,
int  icol,
int  nsamplex,
int  nsampley,
int  nmult,
int  ncolor,
int  flag_low,
int  flag_high,
double  valmin,
double  valmax,
int *  red,
int *  green,
int *  blue,
int  mask_red,
int  mask_green,
int  mask_blue,
int  ffff_red,
int  ffff_green,
int  ffff_blue,
int  low_red,
int  low_green,
int  low_blue,
int  high_red,
int  high_green,
int  high_blue 
)
int db_grid_write_eclipse ( const char *  filename,
DbGrid db,
int  icol 
)
int db_grid_write_ifpen ( const char *  filename,
DbGrid db,
int  ncol,
int *  icols 
)
int db_grid_write_irap ( const char *  filename,
DbGrid db,
int  icol,
int  nsamplex,
int  nsampley 
)
int db_grid_write_XYZ ( const char *  filename,
DbGrid db,
int  icol 
)

Read / Write a File (Grid or Not) according to different format

Returns
Error return code
int db_grid_write_zycor ( const char *  filename,
DbGrid db,
int  icol 
)
Db* db_well_read_las ( const char *  filename,
double  xwell,
double  ywell,
double  cwell,
int   
)
int db_write_csv ( Db db,
const char *  filename,
const CSVformat csvfmt,
int  flag_allcol,
int  flag_coor,
bool  flagInteger 
)

Write the Data frame into a CSV file. Reserved for numerical data frame.

Returns
Error return code
Parameters
[in]dbName of the Db
[in]filenameName of the CSV file
[in]csvfmtCSVformat structure
[in]flag_allcol1 if all the columns available must be dumped out
[in]flag_coor1 if the coordinates must be dumped out
[in]flagIntegertrue if the numerical values must be printed as integer
Remarks
: This procedure dumps the Z-variables and optionally the X-variables
int db_write_vtk ( const char *  filename,
DbGrid db,
const VectorInt cols 
)