OGS
GeoLib::StationBorehole Class Reference

Detailed Description

A borehole as a geometric object.

A borehole inherits Station but has some additional information such as a date, a borehole profile, etc.

Definition at line 31 of file StationBorehole.h.

#include <StationBorehole.h>

Inheritance diagram for GeoLib::StationBorehole:
[legend]
Collaboration diagram for GeoLib::StationBorehole:
[legend]

Public Member Functions

 StationBorehole (double x, double y, double z, double const depth, const std::string &name, int date)
 
 ~StationBorehole () override
 
double getDepth () const
 
double getDate () const
 Returns the date entry for the borehole.
 
const std::vector< Point * > & getProfile () const
 
const std::vector< std::string > & getSoilNames () const
 
void setDepth (double depth)
 Sets the depth of the borehole.
 
void addSoilLayer (double thickness, const std::string &soil_name)
 Add a soil layer to the boreholes stratigraphy.
 
void addSoilLayer (double x, double y, double z, const std::string &soil_name)
 
- Public Member Functions inherited from GeoLib::Station
 Station (double x=0.0, double y=0.0, double z=0.0, std::string name="")
 Constructor.
 
 Station (Point const *coords, std::string name="")
 
 Station (Station const &src)
 
std::string const & getName () const
 Returns the name of the station.
 
void setName (std::string const &name)
 
double getStationValue () const
 Returns the specific value for this station.
 
void setStationValue (double station_value)
 
void addSensorDataFromCSV (const std::string &file_name)
 Allows to add sensor data from a CSV file to the observation site.
 
const SensorDatagetSensorData () const
 Returns all the sensor data for this observation site.
 
- Public Member Functions inherited from GeoLib::Point
 Point ()=default
 
 Point (double x1, double x2, double x3, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point (MathLib::Point3d const &x, std::size_t id)
 
 Point (std::array< double, 3 > const &x, std::size_t id=std::numeric_limits< std::size_t >::max())
 
GEOTYPE getGeoType () const override
 return a geometry type
 
- Public Member Functions inherited from MathLib::Point3dWithID
 Point3dWithID (double x0, double x1, double x2, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point3dWithID (std::array< double, 3 > const &coords, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point3dWithID (MathLib::Point3d const &pnt, std::size_t id=std::numeric_limits< std::size_t >::max())
 
 Point3dWithID ()
 
std::size_t getID () const
 
- Public Member Functions inherited from MathLib::Point3d
 Point3d ()
 
 Point3d (std::array< double, 3 > x)
 
virtual ~Point3d ()=default
 
 Point3d (Point3d const &)=default
 
Point3doperator= (Point3d const &)=default
 
const double & operator[] (std::size_t idx) const
 const access operator The access to the point coordinates is like the access to a field. Code example:
 
double & operator[] (std::size_t idx)
 access operator (see book Effektiv C++ programmieren - subsection 1.3.2 ).
 
const double * data () const
 
double * data ()
 
Eigen::Vector3d const & asEigenVector3d () const
 
Eigen::Vector3d & asEigenVector3d ()
 
- Public Member Functions inherited from GeoLib::GeoObject
virtual ~GeoObject ()=default
 

Static Public Member Functions

static StationBoreholecreateStation (const std::string &name, double x, double y, double z, double depth, const std::string &date="")
 Creates a new borehole object based on the given parameters.
 
- Static Public Member Functions inherited from GeoLib::Station
static StationcreateStation (const std::string &line)
 
static StationcreateStation (const std::string &name, double x, double y, double z)
 Creates a new station object based on the given parameters.
 

Private Attributes

double _depth {0}
 
int _date {0}
 
std::vector< std::string > _soilName
 Contains the names for all the soil layers.
 
std::vector< Point * > _profilePntVec
 Contains the points for the lower boundaries of all layers.
 

Additional Inherited Members

- Protected Member Functions inherited from MathLib::Point3dWithID
void setID (std::size_t id)
 Sets the ID of a node to the given value.
 
- Protected Attributes inherited from GeoLib::Point
friend PointVec
 

Constructor & Destructor Documentation

◆ StationBorehole()

GeoLib::StationBorehole::StationBorehole ( double x,
double y,
double z,
double const depth,
const std::string & name,
int date )
explicit

constructor initialises the borehole with the given coordinates

Definition at line 32 of file StationBorehole.cpp.

35 : Station(x, y, z, name), _depth(depth), _date(date)
36{
37 // add first point of borehole
38 _profilePntVec.push_back(this);
39 _soilName.emplace_back("");
40}
std::vector< Point * > _profilePntVec
Contains the points for the lower boundaries of all layers.
std::vector< std::string > _soilName
Contains the names for all the soil layers.
Station(double x=0.0, double y=0.0, double z=0.0, std::string name="")
Constructor.
Definition Station.cpp:25

References _profilePntVec, and _soilName.

Referenced by createStation().

◆ ~StationBorehole()

GeoLib::StationBorehole::~StationBorehole ( )
override

Definition at line 42 of file StationBorehole.cpp.

43{
44 // deletes profile vector of borehole, starting at layer 1
45 // the first point is NOT deleted as it points to the station object itself
46 for (std::size_t k(1); k < _profilePntVec.size(); k++)
47 {
48 delete _profilePntVec[k];
49 }
50}

References _profilePntVec.

Member Function Documentation

◆ addSoilLayer() [1/2]

void GeoLib::StationBorehole::addSoilLayer ( double thickness,
const std::string & soil_name )

Add a soil layer to the boreholes stratigraphy.

Definition at line 67 of file StationBorehole.cpp.

69{
70 /*
71 // TF - Altmark
72 if (_profilePntVec.empty())
73 addSoilLayer ((*this)[0], (*this)[1], (*this)[2]-thickness, soil_name);
74 else {
75 std::size_t idx (_profilePntVec.size());
76 // read coordinates from last above
77 double x((*_profilePntVec[idx-1])[0]);
78 double y((*_profilePntVec[idx-1])[1]);
79 double z((*_profilePntVec[idx-1])[2]-thickness);
80 addSoilLayer (x, y, z, soil_name);
81 }
82 */
83
84 // KR - Bode
85 if (_profilePntVec.empty())
86 {
87 addSoilLayer((*this)[0], (*this)[1], (*this)[2], soil_name);
88 }
89
90 std::size_t idx(_profilePntVec.size());
91 double x((*_profilePntVec[idx - 1])[0]);
92 double y((*_profilePntVec[idx - 1])[1]);
93 double z((*_profilePntVec[0])[2] - thickness);
94 addSoilLayer(x, y, z, soil_name);
95}
void addSoilLayer(double thickness, const std::string &soil_name)
Add a soil layer to the boreholes stratigraphy.

References _profilePntVec, and addSoilLayer().

Referenced by addSoilLayer(), FileIO::GMSInterface::readBoreholesFromGMS(), and GeoLib::IO::XmlStnInterface::readStratigraphy().

◆ addSoilLayer() [2/2]

void GeoLib::StationBorehole::addSoilLayer ( double x,
double y,
double z,
const std::string & soil_name )

Add a soil layer to the boreholes stratigraphy. Note: The given coordinates always mark THE END of the soil layer. The reason behind this is that the beginning of the first layer is identical with the position of the borehole. For each layer following the beginning is already given by the end of the last layer. This also saves a separate entry in the profile vector for the end of the borehole which in the given notation is just the coordinate given for the last soil layer (i.e. the end of that layer).

Definition at line 97 of file StationBorehole.cpp.

101{
102 _profilePntVec.push_back(new Point(x, y, z));
103 _soilName.push_back(soil_name);
104}
Point()=default

References GeoLib::Point::Point(), _profilePntVec, and _soilName.

◆ createStation()

StationBorehole * GeoLib::StationBorehole::createStation ( const std::string & name,
double x,
double y,
double z,
double depth,
const std::string & date = "" )
static

Creates a new borehole object based on the given parameters.

Definition at line 52 of file StationBorehole.cpp.

58{
59 int integer_date = 0;
60 if (date != "0000-00-00")
61 {
62 integer_date = BaseLib::xmlDate2int(date);
63 }
64 return new StationBorehole(x, y, z, depth, name, integer_date);
65}
StationBorehole(double x, double y, double z, double const depth, const std::string &name, int date)
int xmlDate2int(const std::string &s)

References StationBorehole(), and BaseLib::xmlDate2int().

Referenced by FileIO::GMSInterface::readBoreholesFromGMS(), and GeoLib::IO::XmlStnInterface::readStations().

◆ getDate()

double GeoLib::StationBorehole::getDate ( ) const
inline

Returns the date entry for the borehole.

Definition at line 55 of file StationBorehole.h.

55{ return _date; }

References _date.

Referenced by GeoLib::IO::XmlStnInterface::writeBoreholeData().

◆ getDepth()

double GeoLib::StationBorehole::getDepth ( ) const
inline

Definition at line 52 of file StationBorehole.h.

52{ return _depth; }

References _depth.

Referenced by StratScene::StratScene(), and GeoLib::IO::XmlStnInterface::writeBoreholeData().

◆ getProfile()

const std::vector< Point * > & GeoLib::StationBorehole::getProfile ( ) const
inline

Returns a reference to a vector of Points representing the stratigraphy of the borehole (incl. the station-point itself)

Definition at line 59 of file StationBorehole.h.

59{ return _profilePntVec; }

References _profilePntVec.

Referenced by StratScene::StratScene(), StratBar::paint(), StratBar::totalLogHeight(), GeoLib::IO::XmlStnInterface::writeBoreholeData(), and FileIO::GMSInterface::writeBoreholesToGMS().

◆ getSoilNames()

const std::vector< std::string > & GeoLib::StationBorehole::getSoilNames ( ) const
inline

Returns a reference to a vector of soil names for the stratigraphy of the borehole

Definition at line 63 of file StationBorehole.h.

63{ return _soilName; }

References _soilName.

Referenced by StratScene::StratScene(), StratBar::paint(), and GeoLib::IO::XmlStnInterface::writeBoreholeData().

◆ setDepth()

void GeoLib::StationBorehole::setDepth ( double depth)
inline

Sets the depth of the borehole.

Definition at line 66 of file StationBorehole.h.

66{ _depth = depth; }

References _depth.

Referenced by FileIO::GMSInterface::readBoreholesFromGMS().

Member Data Documentation

◆ _date

int GeoLib::StationBorehole::_date {0}
private

Definition at line 88 of file StationBorehole.h.

88{0}; // date when the borehole has been drilled

Referenced by getDate().

◆ _depth

double GeoLib::StationBorehole::_depth {0}
private

Definition at line 87 of file StationBorehole.h.

87{0}; // depth of the borehole

Referenced by getDepth(), and setDepth().

◆ _profilePntVec

std::vector<Point*> GeoLib::StationBorehole::_profilePntVec
private

Contains the points for the lower boundaries of all layers.

Definition at line 94 of file StationBorehole.h.

Referenced by StationBorehole(), ~StationBorehole(), addSoilLayer(), addSoilLayer(), and getProfile().

◆ _soilName

std::vector<std::string> GeoLib::StationBorehole::_soilName
private

Contains the names for all the soil layers.

Definition at line 91 of file StationBorehole.h.

Referenced by StationBorehole(), addSoilLayer(), and getSoilNames().


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