Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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::JTripod 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...
 
 operator JPosition3D () const
 Type conversion operator. 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 JNullType &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

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  {}
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  {}
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

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  }
Data structure for UTM position.
Definition: JUTMPosition.hh:34
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  }
JUTM::JUTMPosition::operator JPosition3D ( ) const
inline

Type conversion operator.

Returns
position

Definition at line 104 of file JUTMPosition.hh.

105  {
106  return getPosition();
107  }
JPosition3D getPosition() const
Get position.
Definition: JUTMPosition.hh:93
double JUTM::JUTMPosition::getUTMEast ( ) const
inline

Get UTM east.

Returns
UTM East

Definition at line 115 of file JUTMPosition.hh.

116  {
117  return this->east;
118  }
double JUTM::JUTMPosition::getUTMNorth ( ) const
inline

Get UTM north.

Returns
UTM North

Definition at line 126 of file JUTMPosition.hh.

127  {
128  return this->north;
129  }
double JUTM::JUTMPosition::getUTMZ ( ) const
inline

Get UTM Z.

Returns
UTM Z

Definition at line 137 of file JUTMPosition.hh.

138  {
139  return this->z;
140  }
JUTMPosition& JUTM::JUTMPosition::negate ( )
inline

Negate UTM position.

Returns
this UTM position

Definition at line 148 of file JUTMPosition.hh.

149  {
150  east = -east;
151  north = -north;
152  z = -z;
153 
154  return *this;
155  }
JUTMPosition& JUTM::JUTMPosition::add ( const JUTMPosition pos)
inline

Add UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 164 of file JUTMPosition.hh.

165  {
166  east += pos.getUTMEast();
167  north += pos.getUTMNorth();
168  z += pos.getUTMZ();
169 
170  return *this;
171  }
double getUTMEast() const
Get UTM east.
double getUTMZ() const
Get UTM Z.
double getUTMNorth() const
Get UTM north.
JUTMPosition& JUTM::JUTMPosition::sub ( const JUTMPosition pos)
inline

Subtract UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 180 of file JUTMPosition.hh.

181  {
182  east -= pos.getUTMEast();
183  north -= pos.getUTMNorth();
184  z -= pos.getUTMZ();
185 
186  return *this;
187  }
double getUTMEast() const
Get UTM east.
double getUTMZ() const
Get UTM Z.
double getUTMNorth() const
Get UTM north.
JUTMPosition& JUTM::JUTMPosition::mul ( const double  factor)
inline

Scale UTM position.

Parameters
factormultiplication factor
Returns
this UTM position

Definition at line 196 of file JUTMPosition.hh.

197  {
198  east *= factor;
199  north *= factor;
200  z *= factor;
201 
202  return *this;
203  }
JUTMPosition& JUTM::JUTMPosition::div ( const double  factor)
inline

Scale UTM position.

Parameters
factordivision factor
Returns
this UTM position

Definition at line 212 of file JUTMPosition.hh.

213  {
214  east /= factor;
215  north /= factor;
216  z /= factor;
217 
218  return *this;
219  }
JUTMPosition & JMATH::JMath< JUTMPosition , JNullType >::mul ( const JNullType 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  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18

Friends And Related Function Documentation

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 229 of file JUTMPosition.hh.

230  {
231  return in >> pos.east >> pos.north >> pos.z;
232  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
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 242 of file JUTMPosition.hh.

243  {
244  return out << pos.east << ' ' << pos.north << ' ' << pos.z;
245  }
JReader& operator>> ( JReader in,
JUTMPosition pos 
)
friend

Read UTM position from input.

Parameters
ininput stream
posUTM position
Returns
input stream

Definition at line 256 of file JUTMPosition.hh.

257  {
258  return in >> pos.east >> pos.north >> pos.z;
259  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
JWriter& operator<< ( JWriter out,
const JUTMPosition pos 
)
friend

Write UTM position to output.

Parameters
outoutput stream
posUTM position
Returns
output stream

Definition at line 269 of file JUTMPosition.hh.

270  {
271  return out << pos.east << pos.north << pos.z;
272  }

Member Data Documentation

double JUTM::JUTMPosition::east
protected

Definition at line 276 of file JUTMPosition.hh.

double JUTM::JUTMPosition::north
protected

Definition at line 277 of file JUTMPosition.hh.

double JUTM::JUTMPosition::z
protected

Definition at line 278 of file JUTMPosition.hh.


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