gctl/lib/io/dsv_io.h

712 lines
18 KiB
C
Raw Normal View History

2024-09-10 15:45:07 +08:00
/********************************************************
*
*
*
*
*
*
* Geophysical Computational Tools & Library (GCTL)
*
* Copyright (c) 2023 Yi Zhang (yizhang-geo@zju.edu.cn)
*
* GCTL is distributed under a dual licensing scheme. You can redistribute
* it and/or modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either version 2
* of the License, or (at your option) any later version. You should have
* received a copy of the GNU Lesser General Public License along with this
* program. If not, see <http://www.gnu.org/licenses/>.
*
* If the terms and conditions of the LGPL v.2. would prevent you from using
* the GCTL, please consider the option to obtain a commercial license for a
* fee. These licenses are offered by the GCTL's original author. As a rule,
* licenses are provided "as-is", unlimited in time for a one time fee. Please
* send corresponding requests to: yizhang-geo@zju.edu.cn. Please do not forget
* to include some description of your company and the realm of its activities.
* Also add information on how to contact you by electronic and paper mail.
******************************************************/
2024-12-17 09:59:06 +08:00
#ifndef _GCTL_DSV_IO_H
#define _GCTL_DSV_IO_H
2024-09-10 15:45:07 +08:00
#include "../core.h"
#include "../utility.h"
2024-12-15 11:22:25 +08:00
#include "../geometry.h"
2024-12-30 22:09:39 +08:00
#include "regex.h"
2024-09-10 15:45:07 +08:00
namespace gctl
{
2024-12-17 09:59:06 +08:00
struct table_cell
2024-11-04 16:03:39 +08:00
{
2024-12-30 22:09:39 +08:00
std::string str_; // 单元格的内容 统一保存为字符串
bool out_ok_; // 是否可输出到文件
table_cell()
{
str_ = "";
out_ok_ = true;
}
2024-11-04 16:03:39 +08:00
template <typename T> T value()
{
2024-12-13 11:02:59 +08:00
// 如果输出也是字符串 就直接赋值即可避免l_str中含有空格会出现bug
if constexpr (std::is_same<T, std::string>::value) return str_;
else
{
T out;
str2type(str_, out);
return out;
}
2024-11-04 16:03:39 +08:00
}
2024-12-16 09:31:46 +08:00
template <typename T> void value(const T &in, int p = 6)
2024-11-04 16:03:39 +08:00
{
2024-12-16 09:31:46 +08:00
// 对于double类型 可以设置转换的有效数字位数(精度)
if constexpr (std::is_same<T, double>::value)
{
std::stringstream ss;
ss.precision(p);
ss << in;
ss >> str_;
}
2024-12-19 09:45:55 +08:00
else if constexpr (std::is_same<T, std::string>::value) str_ = in;
2024-12-16 09:31:46 +08:00
else str_ = std::to_string(in);
2024-11-04 16:03:39 +08:00
return;
}
};
2024-12-15 21:14:12 +08:00
/**
* @brief
*
*/
enum table_headtype_e
2024-12-12 23:23:55 +08:00
{
2024-12-15 21:14:12 +08:00
NoHead, // 没有表头
BothHead, // 同时有行与列表头
ColumnHead, // 只有列表头
RowHead, // 只有行表头
2024-12-12 23:23:55 +08:00
};
2024-12-13 10:11:47 +08:00
/**
2024-12-17 09:59:06 +08:00
* @brief DSV文本读写类
2024-12-13 10:11:47 +08:00
*
*
* 1. '#'
* 2. '#!'
* 3. n行头信息
2024-12-15 21:14:12 +08:00
* 4. row*col大小的表格
2024-12-30 22:09:39 +08:00
* 5.
* 6. 使R<id>C<id>
2024-12-13 10:11:47 +08:00
*/
2024-12-15 21:14:12 +08:00
class dsv_io
2024-09-10 15:45:07 +08:00
{
2024-12-15 11:22:25 +08:00
protected:
2024-12-30 22:09:39 +08:00
// 文件名
2024-12-16 09:31:46 +08:00
std::string file_;
2024-12-30 22:09:39 +08:00
// 头信息行数 表格行数(不包括表头) 表格列数(不包括表头)
2024-12-12 16:55:06 +08:00
int head_num_, row_num_, col_num_;
2024-09-10 15:45:07 +08:00
// 注释行起始符 标记行起始符 分割符
char att_sym_, tag_sym_, deli_sym_;
2024-11-04 16:03:39 +08:00
// 头信息行 注释行 标记行
std::vector<std::string> heads_, annotates_, tags_;
2024-12-30 22:09:39 +08:00
// 内容表格大小为row_num_+1 * col_num_+1
2024-12-17 09:59:06 +08:00
std::vector<std::vector<table_cell> > table_;
2024-09-10 15:45:07 +08:00
2024-12-13 10:11:47 +08:00
public:
2024-09-10 15:45:07 +08:00
/**
* @brief Construct a new text content object
*
*/
2024-12-15 21:14:12 +08:00
dsv_io();
2024-09-10 15:45:07 +08:00
/**
* @brief Destroy the text content object
*
*/
2024-12-15 21:14:12 +08:00
~dsv_io();
2024-09-10 15:45:07 +08:00
/**
* @brief Construct a new text descriptor object and load text file
*
* @param filename
* @param file_exten
2024-12-30 22:09:39 +08:00
* @param t
2024-09-10 15:45:07 +08:00
*/
2024-12-15 21:14:12 +08:00
dsv_io(std::string filename, std::string file_exten = ".txt", table_headtype_e t = NoHead);
2024-12-12 23:23:55 +08:00
/**
2024-12-31 09:29:54 +08:00
* @brief
*
*/
void clear();
2024-09-10 15:45:07 +08:00
2024-12-13 10:11:47 +08:00
/**
* @brief
*
* @return
*/
int head_number(){return head_num_;}
/**
2024-12-30 22:09:39 +08:00
* @brief
2024-12-13 10:11:47 +08:00
*
* @return
*/
int row_number(){return row_num_;}
/**
2024-12-30 22:09:39 +08:00
* @brief
2024-12-13 10:11:47 +08:00
*
* @return
*/
int col_number(){return col_num_;}
/**
* @brief
*
* @return
*/
const std::vector<std::string>& get_head_records(){return heads_;}
/**
* @brief
*
* @return
*/
const std::vector<std::string>& get_annotoations(){return annotates_;}
/**
* @brief
*
* @return
*/
const std::vector<std::string>& get_tags(){return tags_;}
2024-12-31 09:29:54 +08:00
/**
* @brief
*
* @param names
*/
void get_row_names(std::vector<std::string> &names);
/**
* @brief
*
* @param names
*/
void get_column_names(std::vector<std::string> &names);
/**
* @brief
*
* @param deli_sym
*/
void set_delimeter(char deli_sym){deli_sym_ = deli_sym;}
/**
* @brief
*
* @param num
*/
void set_head_number(char num){head_num_ = num;}
/**
* @brief
*
* @param att_sym
*/
void set_annotation_symbol(char att_sym){att_sym_ = att_sym;}
/**
* @brief
*
* @param tag_sym
*/
void set_tag_symbol(char tag_sym){tag_sym_ = tag_sym;}
2024-12-13 10:11:47 +08:00
/**
* @brief
*
* @param heads
*/
2024-12-31 09:29:54 +08:00
void set_head_records(const std::vector<std::string> &heads){heads_ = heads; head_num_ = heads_.size();}
2024-12-13 10:11:47 +08:00
/**
* @brief
*
* @param att
*/
2024-12-31 09:29:54 +08:00
void set_annotoations(const std::vector<std::string> &att){annotates_ = att;}
2024-12-13 10:11:47 +08:00
/**
* @brief
*
* @param tags
*/
2024-12-31 09:29:54 +08:00
void set_tags(const std::vector<std::string> &tags){tags_ = tags;}
2024-12-13 10:11:47 +08:00
2024-12-30 22:09:39 +08:00
/**
* @brief
*
* @param names
*/
void set_row_names(const std::vector<std::string> &names);
/**
* @brief
*
* @param names
*/
void set_column_names(const std::vector<std::string> &names);
2024-09-10 15:45:07 +08:00
/**
* @brief
*
* @param filename
* @param file_exten
2024-12-30 22:09:39 +08:00
* @param t
2024-09-10 15:45:07 +08:00
*/
2024-12-15 21:14:12 +08:00
void load_text(std::string filename, std::string file_exten = ".txt", table_headtype_e t = NoHead);
2024-12-13 10:11:47 +08:00
/**
* @brief CSV文件
*
* @param filename
*/
2024-12-15 21:14:12 +08:00
void load_csv(std::string filename, table_headtype_e t = ColumnHead);
2024-09-10 15:45:07 +08:00
/**
2024-12-13 10:11:47 +08:00
* @brief
2024-09-10 15:45:07 +08:00
*
* @param filename
* @param file_exten
*/
2024-12-16 09:31:46 +08:00
void save_text(std::string filename, std::string file_exten = ".txt");
2024-12-12 16:55:06 +08:00
2024-12-13 10:11:47 +08:00
/**
* @brief CSV文件
*
* @param filename
*/
2024-12-16 09:31:46 +08:00
void save_csv(std::string filename);
2024-12-13 10:11:47 +08:00
2024-12-12 23:23:55 +08:00
/**
* @brief
*
2024-12-30 22:09:39 +08:00
* @param row
* @param col
2024-12-12 23:23:55 +08:00
*/
2024-12-15 21:14:12 +08:00
void init_table(int row, int col, table_headtype_e t = ColumnHead);
2024-12-12 23:23:55 +08:00
2024-12-16 09:31:46 +08:00
/**
* @brief
*
2024-12-31 09:29:54 +08:00
* @param t
2024-12-16 09:31:46 +08:00
*/
2024-12-31 09:29:54 +08:00
void info(table_headtype_e t = ColumnHead);
2024-12-16 09:31:46 +08:00
2024-12-17 09:59:06 +08:00
/**
2024-12-31 09:29:54 +08:00
* @brief name和R<id>C<id>
2024-12-17 09:59:06 +08:00
*
2024-12-31 09:29:54 +08:00
* @param name R<id>C<id>
* @param iter_row name参数为R<id>C<id>
* @return 1 -1
2024-12-17 09:59:06 +08:00
*/
int name_index(std::string name, bool iter_row = false);
2024-12-28 09:42:02 +08:00
/**
2024-12-28 13:47:25 +08:00
* @brief 使
2024-12-28 09:42:02 +08:00
*
2024-12-30 22:09:39 +08:00
* @param idx 1
2024-12-28 13:47:25 +08:00
* @param s
2024-12-28 09:42:02 +08:00
*/
2024-12-28 13:47:25 +08:00
void column_output(int idx, switch_type_e s = Disable);
2024-12-28 09:42:02 +08:00
/**
2024-12-28 13:47:25 +08:00
* @brief 使
2024-12-28 09:42:02 +08:00
*
* @param name
2024-12-28 13:47:25 +08:00
* @param s
2024-12-28 09:42:02 +08:00
*/
2024-12-28 13:47:25 +08:00
void column_output(std::string name, switch_type_e s = Disable);
2024-12-28 09:42:02 +08:00
/**
2024-12-28 13:47:25 +08:00
* @brief 使
2024-12-28 09:42:02 +08:00
*
2024-12-30 22:09:39 +08:00
* @param idx 1
2024-12-28 13:47:25 +08:00
* @param s
2024-12-28 09:42:02 +08:00
*/
2024-12-28 13:47:25 +08:00
void row_output(int idx, switch_type_e s = Disable);
2024-12-28 09:42:02 +08:00
/**
2024-12-28 13:47:25 +08:00
* @brief 使
2024-12-28 09:42:02 +08:00
*
* @param name
2024-12-28 13:47:25 +08:00
* @param s
2024-12-28 09:42:02 +08:00
*/
2024-12-28 13:47:25 +08:00
void row_output(std::string name, switch_type_e s = Disable);
2025-01-01 17:14:19 +08:00
/**
* @brief
*
* @param name
*/
void add_column(std::string name = "");
/**
* @brief idx的列后添加一个空白列
*
* @param idx 0
* @param name
*/
void add_column(int idx, std::string name = "");
/**
* @brief id_name的列后添加一个空白列
*
* @param id_name
* @param name
*/
void add_column(std::string id_name, std::string name = "");
2024-12-28 09:42:02 +08:00
2024-12-27 12:28:17 +08:00
/**
* @brief
*
* @tparam T
2024-12-30 22:09:39 +08:00
* @param data
2024-12-27 12:28:17 +08:00
* @param p
*/
template <typename T> void fill_table(const matrix<T> &data, int p = 6);
/**
* @brief
*
* @tparam T
* @param data
*/
template <typename T> void get_table(matrix<T> &data);
2024-12-12 23:23:55 +08:00
/**
* @brief
*
* @tparam T
2024-12-30 22:09:39 +08:00
* @param idx 1
2024-12-12 23:23:55 +08:00
* @param data
2024-12-27 12:28:17 +08:00
* @param p
2024-12-12 23:23:55 +08:00
*/
2025-01-01 17:14:19 +08:00
template <typename T> void fill_column(const array<T> &data, int idx, int p = 6);
2024-12-12 23:23:55 +08:00
2024-12-13 10:11:47 +08:00
/**
* @brief
*
* @tparam T
* @param name
* @param data
2024-12-27 12:28:17 +08:00
* @param p
2024-12-13 10:11:47 +08:00
*/
2025-01-01 17:14:19 +08:00
template <typename T> void fill_column(const array<T> &data, std::string name, int p = 6);
2024-12-13 10:11:47 +08:00
2024-12-12 23:23:55 +08:00
/**
* @brief
*
* @tparam T
2024-12-30 22:09:39 +08:00
* @param idx 1
2024-12-12 23:23:55 +08:00
* @param data
2024-12-27 12:28:17 +08:00
* @param p
2024-12-12 23:23:55 +08:00
*/
2025-01-01 17:14:19 +08:00
template <typename T> void fill_row(const array<T> &data, int idx, int p = 6);
2024-12-12 23:23:55 +08:00
2024-12-15 21:14:12 +08:00
/**
* @brief
*
* @tparam T
* @param name
* @param data
2024-12-27 12:28:17 +08:00
* @param p
2024-12-15 21:14:12 +08:00
*/
2025-01-01 17:14:19 +08:00
template <typename T> void fill_row(const array<T> &data, std::string name, int p = 6);
2024-12-15 21:14:12 +08:00
2024-12-12 23:23:55 +08:00
/**
* @brief
*
* @tparam T
2024-12-30 22:09:39 +08:00
* @param idx 1
2024-12-12 23:23:55 +08:00
* @param data
*/
2025-01-01 17:14:19 +08:00
template <typename T> void get_column(array<T> &data, int idx);
2024-12-13 10:11:47 +08:00
/**
* @brief
*
* @tparam T
* @param name
* @param data
*/
2025-01-01 17:14:19 +08:00
template <typename T> void get_column(array<T> &data, std::string name);
2024-12-12 23:23:55 +08:00
/**
* @brief
*
* @tparam T
2024-12-30 22:09:39 +08:00
* @param idx 1
2024-12-12 23:23:55 +08:00
* @param data
*/
2025-01-01 17:14:19 +08:00
template <typename T> void get_row(array<T> &data, int idx);
2024-12-15 21:14:12 +08:00
/**
* @brief
*
* @tparam T
* @param name
* @param data
*/
2025-01-01 17:14:19 +08:00
template <typename T> void get_row(array<T> &data, std::string name);
2024-12-13 10:11:47 +08:00
/**
* @brief
*
* @tparam T
2024-12-30 22:09:39 +08:00
* @param r 0
* @param c 0
2024-12-13 10:11:47 +08:00
* @return T
*/
template <typename T> T cell(int r, int c){return table_[r][c].value<T>();}
/**
* @brief
*
* @tparam T
2024-12-30 22:09:39 +08:00
* @param r 0
* @param c 0
2024-12-13 10:11:47 +08:00
* @param d
2024-12-27 12:28:17 +08:00
* @param p
2024-12-13 10:11:47 +08:00
*/
2025-01-01 17:14:19 +08:00
template <typename T> void cell(T d, int r, int c, int p = 6){table_[r][c].value(d, p); return;}
2024-12-12 16:55:06 +08:00
};
2024-12-27 12:28:17 +08:00
template <typename T>
void dsv_io::fill_table(const matrix<T> &data, int p)
{
2024-12-30 22:09:39 +08:00
for (size_t i = 1; i <= std::min(row_num_, (int) data.row_size()); i++)
2024-12-27 12:28:17 +08:00
{
2024-12-30 22:09:39 +08:00
for (size_t j = 1; j <= std::min(col_num_, (int) data.col_size()); j++)
2024-12-27 12:28:17 +08:00
{
2024-12-30 22:09:39 +08:00
table_[i][j].value(data[i - 1][j - 1], p);
2024-12-27 12:28:17 +08:00
}
}
return;
}
template <typename T>
void dsv_io::get_table(matrix<T> &data)
{
2024-12-30 22:09:39 +08:00
data.resize(row_num_, col_num_);
for (size_t i = 1; i <= row_num_; i++)
2024-12-27 12:28:17 +08:00
{
2024-12-30 22:09:39 +08:00
for (size_t j = 1; j <= col_num_; j++)
2024-12-27 12:28:17 +08:00
{
2024-12-30 22:09:39 +08:00
data[i -1][j - 1] = table_[i][j].value<T>();
2024-12-27 12:28:17 +08:00
}
}
return;
}
2024-12-12 16:55:06 +08:00
template <typename T>
2025-01-01 17:14:19 +08:00
void dsv_io::fill_column(const array<T> &data, int idx, int p)
2024-12-12 16:55:06 +08:00
{
2024-12-30 22:09:39 +08:00
if (idx > col_num_ || idx <= 0)
2024-12-12 23:23:55 +08:00
{
2024-12-17 09:59:06 +08:00
throw std::runtime_error("[gctl::dsv_io] Invalid column index.");
2024-12-12 23:23:55 +08:00
}
2024-12-30 22:09:39 +08:00
for (size_t i = 1; i <= std::min(row_num_, (int) data.size()); i++)
2024-12-16 09:31:46 +08:00
{
2024-12-30 22:09:39 +08:00
table_[i][idx].value(data[i - 1], p);
2024-12-16 09:31:46 +08:00
}
2024-12-12 16:55:06 +08:00
return;
}
2024-12-12 23:23:55 +08:00
2024-12-13 10:11:47 +08:00
template <typename T>
2025-01-01 17:14:19 +08:00
void dsv_io::fill_column(const array<T> &data, std::string name, int p)
2024-12-13 10:11:47 +08:00
{
2025-01-01 17:14:19 +08:00
fill_column(data, name_index(name, false), p);
2024-12-13 10:11:47 +08:00
return;
}
2024-12-12 23:23:55 +08:00
template <typename T>
2025-01-01 17:14:19 +08:00
void dsv_io::fill_row(const array<T> &data, int idx, int p)
2024-12-12 23:23:55 +08:00
{
2024-12-30 22:09:39 +08:00
if (idx > row_num_ || idx <= 0)
2024-12-12 23:23:55 +08:00
{
2024-12-17 09:59:06 +08:00
throw std::runtime_error("[gctl::dsv_io] Invalid row index.");
2024-12-12 23:23:55 +08:00
}
2024-12-15 11:22:25 +08:00
2024-12-30 22:09:39 +08:00
for (size_t i = 1; i <= std::min(col_num_, (int) data.size()); i++)
2024-12-15 11:22:25 +08:00
{
2024-12-30 22:09:39 +08:00
table_[idx][i].value(data[i - 1], p);
2024-12-12 23:23:55 +08:00
}
return;
}
template <typename T>
2025-01-01 17:14:19 +08:00
void dsv_io::fill_row(const array<T> &data, std::string name, int p)
2024-12-15 21:14:12 +08:00
{
2025-01-01 17:14:19 +08:00
fill_row(data, name_index(name, true), p);
2024-12-19 09:45:55 +08:00
return;
2024-12-15 21:14:12 +08:00
}
template <typename T>
2025-01-01 17:14:19 +08:00
void dsv_io::get_column(array<T> &data, int idx)
2024-12-12 23:23:55 +08:00
{
2024-12-30 22:09:39 +08:00
if (idx > col_num_ || idx <= 0)
2024-12-12 23:23:55 +08:00
{
2024-12-17 09:59:06 +08:00
throw std::runtime_error("[gctl::dsv_io] Invalid column index.");
2024-12-12 23:23:55 +08:00
}
2024-12-16 09:31:46 +08:00
2024-12-30 22:09:39 +08:00
data.resize(row_num_);
for (size_t i = 1; i <= row_num_; i++)
2024-12-16 09:31:46 +08:00
{
2024-12-30 22:09:39 +08:00
data[i - 1] = table_[i][idx].value<T>();
2024-12-12 23:23:55 +08:00
}
return;
}
2024-12-13 10:11:47 +08:00
template <typename T>
2025-01-01 17:14:19 +08:00
void dsv_io::get_column(array<T> &data, std::string name)
2024-12-13 10:11:47 +08:00
{
2025-01-01 17:14:19 +08:00
get_column(data, name_index(name, false));
2024-12-19 09:45:55 +08:00
return;
2024-12-13 10:11:47 +08:00
}
2024-12-12 23:23:55 +08:00
template <typename T>
2025-01-01 17:14:19 +08:00
void dsv_io::get_row(array<T> &data, int idx)
2024-12-12 23:23:55 +08:00
{
2024-12-30 22:09:39 +08:00
if (idx > row_num_ || idx <= 0)
2024-12-12 23:23:55 +08:00
{
2024-12-17 09:59:06 +08:00
throw std::runtime_error("[gctl::dsv_io] Invalid row index.");
2024-12-12 23:23:55 +08:00
}
2024-12-16 09:31:46 +08:00
2024-12-30 22:09:39 +08:00
data.resize(col_num_);
for (size_t i = 1; i <= col_num_; i++)
2024-12-16 09:31:46 +08:00
{
2024-12-30 22:09:39 +08:00
data[i - 1] = table_[idx][i].value<T>();
2024-12-12 23:23:55 +08:00
}
return;
}
2024-12-15 11:22:25 +08:00
2024-12-15 21:14:12 +08:00
template <typename T>
2025-01-01 17:14:19 +08:00
void dsv_io::get_row(array<T> &data, std::string name)
2024-12-15 21:14:12 +08:00
{
2025-01-01 17:14:19 +08:00
get_row(data, name_index(name, true));
2024-12-19 09:45:55 +08:00
return;
2024-12-15 21:14:12 +08:00
}
2024-12-17 09:59:06 +08:00
/**
* @brief DSV文件读写类
*
*/
2024-12-15 21:14:12 +08:00
class geodsv_io : public dsv_io
2024-12-15 11:22:25 +08:00
{
public:
2024-12-17 09:59:06 +08:00
/**
* @brief Construct a new geodsv_io object
*
*/
2024-12-16 09:31:46 +08:00
geodsv_io();
2024-12-17 09:59:06 +08:00
/**
* @brief Destroy the geodsv_io object
*
*/
2024-12-16 09:31:46 +08:00
~geodsv_io();
/**
* @brief Construct a new text descriptor object and load text file
*
* @param filename
* @param file_exten
*/
geodsv_io(std::string filename, std::string file_exten = ".txt", table_headtype_e t = NoHead);
2024-12-15 11:22:25 +08:00
2024-12-17 09:59:06 +08:00
/**
* @brief
*
2024-12-30 22:09:39 +08:00
* @param xid x坐标列索引 1
* @param yid y坐标列索引 1
2024-12-17 09:59:06 +08:00
* @param data
* @param p
*/
2025-01-01 17:14:19 +08:00
void fill_column_point2dc(const array<point2dc> &data, int xid, int yid, int p = 6);
2024-12-15 11:22:25 +08:00
2024-12-17 09:59:06 +08:00
/**
* @brief
*
* @param xname x坐标列名称
* @param yname y坐标列名称
* @param data
* @param p
*/
2025-01-01 17:14:19 +08:00
void fill_column_point2dc(const array<point2dc> &data, std::string xname, std::string yname, int p = 6);
2024-12-17 09:59:06 +08:00
/**
* @brief
*
2024-12-30 22:09:39 +08:00
* @param xid x坐标列索引 1
* @param yid y坐标列索引 1
* @param zid z坐标列索引 1
2024-12-17 09:59:06 +08:00
* @param data
* @param p
*/
2025-01-01 17:14:19 +08:00
void fill_column_point3dc(const array<point3dc> &data, int xid, int yid, int zid, int p = 6);
2024-12-15 11:22:25 +08:00
2024-12-17 09:59:06 +08:00
/**
* @brief
*
* @param xname x坐标列名称
* @param yname y坐标列名称
* @param zname z坐标列名称
* @param data
* @param p
*/
2025-01-01 17:14:19 +08:00
void fill_column_point3dc(const array<point3dc> &data, std::string xname, std::string yname, std::string zname, int p = 6);
2024-12-17 09:59:06 +08:00
/**
* @brief
*
2024-12-30 22:09:39 +08:00
* @param xid x坐标列索引 1
* @param yid y坐标列索引 1
2024-12-17 09:59:06 +08:00
* @param data
*/
2025-01-01 17:14:19 +08:00
void get_column_point2dc(array<point2dc> &data, int xid, int yid);
2024-12-15 11:22:25 +08:00
2024-12-17 09:59:06 +08:00
/**
* @brief
*
* @param xname x坐标列名称
* @param yname y坐标列名称
* @param data
*/
2025-01-01 17:14:19 +08:00
void get_column_point2dc(array<point2dc> &data, std::string xname, std::string yname);
2024-12-17 09:59:06 +08:00
/**
* @brief
*
2024-12-30 22:09:39 +08:00
* @param xid x坐标列索引 1
* @param yid y坐标列索引 1
* @param zid z坐标列索引 1
2024-12-17 09:59:06 +08:00
* @param data
*/
2025-01-01 17:14:19 +08:00
void get_column_point3dc(array<point3dc> &data, int xid, int yid, int zid);
2024-12-17 09:59:06 +08:00
/**
* @brief
*
* @param xname x坐标列名称
* @param yname y坐标列名称
* @param zname z坐标列名称
* @param data
*/
2025-01-01 17:14:19 +08:00
void get_column_point3dc(array<point3dc> &data, std::string xname, std::string yname, std::string zname);
2024-12-15 11:22:25 +08:00
};
2024-09-10 15:45:07 +08:00
}
2024-12-17 09:59:06 +08:00
#endif //_GCTL_DSV_IO_H