OGS
FileIO::Gocad::CoordinateSystem Class Referencefinal

Detailed Description

Definition at line 20 of file CoordinateSystem.h.

#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 25 of file CoordinateSystem.h.

26 {
27 Depth, // z is increasing downwards
28 Elevation // z is increasing upwards
29 };

Member Function Documentation

◆ parse()

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

Definition at line 39 of file CoordinateSystem.cpp.

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

Member Data Documentation

◆ axis_name_u

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

Definition at line 34 of file CoordinateSystem.h.

Referenced by parse().

◆ axis_name_v

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

Definition at line 34 of file CoordinateSystem.h.

Referenced by parse().

◆ axis_name_w

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

Definition at line 34 of file CoordinateSystem.h.

Referenced by parse().

◆ axis_unit_u

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

Definition at line 35 of file CoordinateSystem.h.

Referenced by parse().

◆ axis_unit_v

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

Definition at line 35 of file CoordinateSystem.h.

Referenced by parse().

◆ axis_unit_w

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

Definition at line 35 of file CoordinateSystem.h.

Referenced by parse().

◆ datum

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

Definition at line 33 of file CoordinateSystem.h.

Referenced by parse().

◆ name

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

Definition at line 31 of file CoordinateSystem.h.

Referenced by parse().

◆ projection

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

Definition at line 32 of file CoordinateSystem.h.

Referenced by parse().

◆ z_positive

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

Definition at line 36 of file CoordinateSystem.h.

Referenced by parse(), and FileIO::Gocad::GocadAsciiReader::readData().


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