Jpp
Public Member Functions | Protected Attributes | Friends | List of all members
JUTM::JUTMPosition Class Reference

Data structure for UTM position. More...

#include <JUTMPosition.hh>

Inheritance diagram for JUTM::JUTMPosition:
JMATH::JMath< JUTMPosition > JDETECTOR::JDetectorHeader JDETECTOR::JDetector JDETECTOR::JMonteCarloDetector

Public Member Functions

 JUTMPosition ()
 Default constructor. More...
 
 JUTMPosition (const JVector3D &pos)
 Constructor. More...
 
 JUTMPosition (const double east, const double north, const double z)
 Constructor. More...
 
const JUTMPositiongetUTMPosition () const
 Get UTM position. More...
 
JPosition3D getPosition () const
 Get position. More...
 
double getUTMEast () const
 Get UTM east. More...
 
double getUTMNorth () const
 Get UTM north. More...
 
double getUTMZ () const
 Get UTM Z. More...
 
JUTMPositionnegate ()
 Negate UTM position. More...
 
JUTMPositionadd (const JUTMPosition &pos)
 Add UTM position. More...
 
JUTMPositionsub (const JUTMPosition &pos)
 Subtract UTM position. More...
 
JUTMPositionmul (const double factor)
 Scale UTM position. More...
 
JUTMPositiondiv (const double factor)
 Scale UTM position. More...
 
JUTMPositionmul (const JSecond_t &object)
 Multiply with object. More...
 

Protected Attributes

double east
 
double north
 
double z
 

Friends

std::istream & operator>> (std::istream &in, JUTMPosition &pos)
 Read UTM position from input. More...
 
std::ostream & operator<< (std::ostream &out, const JUTMPosition &pos)
 Write UTM position to output. More...
 
JReaderoperator>> (JReader &in, JUTMPosition &pos)
 Read UTM position from input. More...
 
JWriteroperator<< (JWriter &out, const JUTMPosition &pos)
 Write UTM position to output. More...
 

Detailed Description

Data structure for UTM position.

The z-coordinate corresponds to the depth where z = 0 is at sea level.

Definition at line 34 of file JUTMPosition.hh.

Constructor & Destructor Documentation

◆ JUTMPosition() [1/3]

JUTM::JUTMPosition::JUTMPosition ( )
inline

Default constructor.

Definition at line 41 of file JUTMPosition.hh.

41  :
42  east (0.0),
43  north(0.0),
44  z (0.0)
45  {}

◆ JUTMPosition() [2/3]

JUTM::JUTMPosition::JUTMPosition ( const JVector3D pos)
inline

Constructor.

Parameters
posUTM position

Definition at line 53 of file JUTMPosition.hh.

53  :
54  east (pos.getX()),
55  north(pos.getY()),
56  z (pos.getZ())
57  {}

◆ JUTMPosition() [3/3]

JUTM::JUTMPosition::JUTMPosition ( const double  east,
const double  north,
const double  z 
)
inline

Constructor.

Parameters
eastUTM East
northUTM North
zUTM Z

Definition at line 67 of file JUTMPosition.hh.

70  {
71  this->east = east;
72  this->north = north;
73  this->z = z;
74  }

Member Function Documentation

◆ getUTMPosition()

const JUTMPosition& JUTM::JUTMPosition::getUTMPosition ( ) const
inline

Get UTM position.

Returns
position

Definition at line 82 of file JUTMPosition.hh.

83  {
84  return static_cast<const JUTMPosition&>(*this);
85  }

◆ getPosition()

JPosition3D JUTM::JUTMPosition::getPosition ( ) const
inline

Get position.

Returns
position

Definition at line 93 of file JUTMPosition.hh.

94  {
95  return JPosition3D(east, north, z);
96  }

◆ getUTMEast()

double JUTM::JUTMPosition::getUTMEast ( ) const
inline

Get UTM east.

Returns
UTM East

Definition at line 104 of file JUTMPosition.hh.

105  {
106  return this->east;
107  }

◆ getUTMNorth()

double JUTM::JUTMPosition::getUTMNorth ( ) const
inline

Get UTM north.

Returns
UTM North

Definition at line 115 of file JUTMPosition.hh.

116  {
117  return this->north;
118  }

◆ getUTMZ()

double JUTM::JUTMPosition::getUTMZ ( ) const
inline

Get UTM Z.

Returns
UTM Z

Definition at line 126 of file JUTMPosition.hh.

127  {
128  return this->z;
129  }

◆ negate()

JUTMPosition& JUTM::JUTMPosition::negate ( )
inline

Negate UTM position.

Returns
this UTM position

Definition at line 137 of file JUTMPosition.hh.

138  {
139  east = -east;
140  north = -north;
141  z = -z;
142 
143  return *this;
144  }

◆ add()

JUTMPosition& JUTM::JUTMPosition::add ( const JUTMPosition pos)
inline

Add UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 153 of file JUTMPosition.hh.

154  {
155  east += pos.getUTMEast();
156  north += pos.getUTMNorth();
157  z += pos.getUTMZ();
158 
159  return *this;
160  }

◆ sub()

JUTMPosition& JUTM::JUTMPosition::sub ( const JUTMPosition pos)
inline

Subtract UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 169 of file JUTMPosition.hh.

170  {
171  east -= pos.getUTMEast();
172  north -= pos.getUTMNorth();
173  z -= pos.getUTMZ();
174 
175  return *this;
176  }

◆ mul() [1/2]

JUTMPosition& JUTM::JUTMPosition::mul ( const double  factor)
inline

Scale UTM position.

Parameters
factormultiplication factor
Returns
this UTM position

Definition at line 185 of file JUTMPosition.hh.

186  {
187  east *= factor;
188  north *= factor;
189  z *= factor;
190 
191  return *this;
192  }

◆ div()

JUTMPosition& JUTM::JUTMPosition::div ( const double  factor)
inline

Scale UTM position.

Parameters
factordivision factor
Returns
this UTM position

Definition at line 201 of file JUTMPosition.hh.

202  {
203  east /= factor;
204  north /= factor;
205  z /= factor;
206 
207  return *this;
208  }

◆ mul() [2/2]

JUTMPosition & JMATH::JMath< JUTMPosition , JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }

Friends And Related Function Documentation

◆ operator>> [1/2]

std::istream& operator>> ( std::istream &  in,
JUTMPosition pos 
)
friend

Read UTM position from input.

Parameters
ininput stream
posUTM position
Returns
input stream

Definition at line 218 of file JUTMPosition.hh.

219  {
220  return in >> pos.east >> pos.north >> pos.z;
221  }

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  out,
const JUTMPosition pos 
)
friend

Write UTM position to output.

Parameters
outoutput stream
posUTM position
Returns
output stream

Definition at line 231 of file JUTMPosition.hh.

232  {
233  return out << pos.east << ' ' << pos.north << ' ' << pos.z;
234  }

◆ operator>> [2/2]

JReader& operator>> ( JReader in,
JUTMPosition pos 
)
friend

Read UTM position from input.

Parameters
ininput stream
posUTM position
Returns
input stream

Definition at line 245 of file JUTMPosition.hh.

246  {
247  return in >> pos.east >> pos.north >> pos.z;
248  }

◆ operator<< [2/2]

JWriter& operator<< ( JWriter out,
const JUTMPosition pos 
)
friend

Write UTM position to output.

Parameters
outoutput stream
posUTM position
Returns
output stream

Definition at line 258 of file JUTMPosition.hh.

259  {
260  return out << pos.east << pos.north << pos.z;
261  }

Member Data Documentation

◆ east

double JUTM::JUTMPosition::east
protected

Definition at line 265 of file JUTMPosition.hh.

◆ north

double JUTM::JUTMPosition::north
protected

Definition at line 266 of file JUTMPosition.hh.

◆ z

double JUTM::JUTMPosition::z
protected

Definition at line 267 of file JUTMPosition.hh.


The documentation for this class was generated from the following file:
JUTM::JUTMPosition::east
double east
Definition: JUTMPosition.hh:265
JUTM::JUTMPosition::getUTMZ
double getUTMZ() const
Get UTM Z.
Definition: JUTMPosition.hh:126
JUTM::JUTMPosition::getUTMNorth
double getUTMNorth() const
Get UTM north.
Definition: JUTMPosition.hh:115
JMATH::JCalculator
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JUTM::JUTMPosition::north
double north
Definition: JUTMPosition.hh:266
JUTM::JUTMPosition::z
double z
Definition: JUTMPosition.hh:267
JUTM::JUTMPosition::getUTMEast
double getUTMEast() const
Get UTM east.
Definition: JUTMPosition.hh:104