OGS
FileIO::Gocad::CoordinateSystem Class Referencefinal

Detailed Description

#include <CoordinateSystem.h>

Public Types

enum class  ZPOSITIVE { Depth , Elevation }

Public Member Functions

bool parse (std::istream &in)

Public Attributes

std::string name
std::string projection
std::string datum
std::string axis_name_u
std::string axis_name_v
std::string axis_name_w
std::string axis_unit_u
std::string axis_unit_v
std::string axis_unit_w
ZPOSITIVE z_positive = ZPOSITIVE::Elevation

Member Enumeration Documentation

◆ ZPOSITIVE

Enumerator
Depth 
Elevation 

Definition at line 19 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

20 {
21 Depth, // z is increasing downwards
22 Elevation // z is increasing upwards
23 };

Member Function Documentation

◆ parse()

bool FileIO::Gocad::CoordinateSystem::parse ( std::istream & in)

Definition at line 33 of file Applications/FileIO/GocadIO/CoordinateSystem.cpp.

34{
35 std::string line; // string used for reading a line
36 boost::char_separator<char> sep("-;| \"\r");
37
38 std::getline(in, line); // NAME name
39 boost::tokenizer<boost::char_separator<char>> tok(line, sep);
40 auto it(tok.begin());
41 if (*it != "NAME")
42 {
43 return false;
44 }
45 name = parseName(line);
46 projection = "";
47 datum = "";
48
49 while (std::getline(in, line))
50 {
51 tok.assign(line);
52 it = tok.begin();
53 if (*it == "AXIS_NAME")
54 {
55 ++it;
56 axis_name_u = *it;
57 ++it;
58 axis_name_v = *it;
59 ++it;
60 axis_name_w = *it;
61 }
62 else if (*it == "AXIS_UNIT")
63 {
64 ++it;
65 axis_unit_u = *it;
66 ++it;
67 axis_unit_v = *it;
68 ++it;
69 axis_unit_w = *it;
70 }
71 else if (*it == "ZPOSITIVE")
72 {
73 ++it;
74 if (*it == "Depth")
75 {
77 }
78 else
79 {
81 }
82 }
83 else if (*it == "PROJECTION")
84 {
85 projection = parseName(line);
86 }
87 else if (*it == "DATUM")
88 {
89 datum = parseName(line);
90 }
91 else if (*it == "END_ORIGINAL_COORDINATE_SYSTEM")
92 {
93 return true;
94 }
95 else
96 {
97 WARN("CoordinateSystem::parse() - Unknown keyword found: {:s}",
98 line);
99 }
100 }
101 ERR("Error: Unexpected end of file.");
102 return false;
103}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:34
std::string parseName(std::string const &str)

References axis_name_u, axis_name_v, axis_name_w, axis_unit_u, axis_unit_v, axis_unit_w, datum, Depth, Elevation, ERR(), name, FileIO::Gocad::parseName(), projection, WARN(), and z_positive.

Referenced by FileIO::Gocad::GocadAsciiReader::readData().

Member Data Documentation

◆ axis_name_u

std::string FileIO::Gocad::CoordinateSystem::axis_name_u

Definition at line 28 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

Referenced by parse().

◆ axis_name_v

std::string FileIO::Gocad::CoordinateSystem::axis_name_v

Definition at line 28 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

Referenced by parse().

◆ axis_name_w

std::string FileIO::Gocad::CoordinateSystem::axis_name_w

Definition at line 28 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

Referenced by parse().

◆ axis_unit_u

std::string FileIO::Gocad::CoordinateSystem::axis_unit_u

Definition at line 29 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

Referenced by parse().

◆ axis_unit_v

std::string FileIO::Gocad::CoordinateSystem::axis_unit_v

Definition at line 29 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

Referenced by parse().

◆ axis_unit_w

std::string FileIO::Gocad::CoordinateSystem::axis_unit_w

Definition at line 29 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

Referenced by parse().

◆ datum

std::string FileIO::Gocad::CoordinateSystem::datum

Definition at line 27 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

Referenced by parse().

◆ name

std::string FileIO::Gocad::CoordinateSystem::name

Definition at line 25 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

Referenced by parse().

◆ projection

std::string FileIO::Gocad::CoordinateSystem::projection

Definition at line 26 of file Applications/FileIO/GocadIO/CoordinateSystem.h.

Referenced by parse().

◆ z_positive

ZPOSITIVE FileIO::Gocad::CoordinateSystem::z_positive = ZPOSITIVE::Elevation

The documentation for this class was generated from the following files: