39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
// Functions to read/write a 2D grid of 3D points.
|
|
|
|
#ifndef GRID2DIO_H
|
|
#define GRID2DIO_H
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "grid2DPoints3D.h"
|
|
|
|
// Header string used in grid2D files.
|
|
extern const std::string GRID2D_POINTS3D_HEADER;
|
|
|
|
/// Return true if line equals the grid2D file header.
|
|
bool IsHeader(const std::string& line);
|
|
|
|
/// Return true if line is a comment line (starts with '#') or blank.
|
|
bool IsCommentOrBlankLine(const std::string& line);
|
|
|
|
/// Read grid2D from an open input stream.
|
|
void ReadGrid2DPoints3D(std::istream& infile, GRID2D_POINTS3D& grid2D);
|
|
|
|
/// Open filename and read grid2D from it.
|
|
void OpenReadGrid2DPoints3D(const std::string& filename,
|
|
GRID2D_POINTS3D& grid2D);
|
|
|
|
/// Write grid2D to an open output stream.
|
|
void WriteGrid2DPoints3D(std::ostream& outfile,
|
|
const GRID2D_POINTS3D& grid2D,
|
|
const std::vector<std::string>& comment_list = {});
|
|
|
|
/// Open filename and write grid2D to it.
|
|
void OpenWriteGrid2DPoints3D(const std::string& filename,
|
|
const GRID2D_POINTS3D& grid2D,
|
|
const std::vector<std::string>& comment_list = {});
|
|
|
|
#endif // GRID2DIO_H
|