Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
JDETECTOR::JTripod Class Reference

Data structure for tripod. More...

#include <JTripod.hh>

Inheritance diagram for JDETECTOR::JTripod:
JLANG::JObjectID JUTM::JUTMPosition JLANG::JComparable< JObjectID > JLANG::JComparable< JObjectID, int > JMATH::JMath< JFirst_t, JSecond_t >

Public Member Functions

 JTripod ()
 Default constructor. More...
 
 JTripod (const int id, const JUTMPosition &position)
 Constructor. More...
 
int getID () const
 Get identifier. More...
 
int & getID ()
 Get identifier. More...
 
void setID (const int id)
 Set identifier. More...
 
bool less (const JObjectID &object) const
 Less than method. More...
 
bool less (const int id) const
 Less than method. More...
 
bool more (const int id) const
 More than method. More...
 
const JUTMPositiongetUTMPosition () const
 Get UTM position. More...
 
void setUTMPosition (const JUTMPosition &position)
 Set 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...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
JUTMPositiondiv (const double factor)
 Scale UTM position. More...
 
double getDisplacement (const JUTMPosition &position) const
 Get displacement to position. More...
 

Protected Attributes

int __id
 
double east
 
double north
 
double z
 

Friends

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

Detailed Description

Data structure for tripod.

Definition at line 32 of file JTripod.hh.

Constructor & Destructor Documentation

JDETECTOR::JTripod::JTripod ( )
inline

Default constructor.

Definition at line 40 of file JTripod.hh.

41  {}
JDETECTOR::JTripod::JTripod ( const int  id,
const JUTMPosition position 
)
inline

Constructor.

Parameters
ididentifier
positionUTM positiom

Definition at line 50 of file JTripod.hh.

51  :
52  JObjectID(id),
53  JUTMPosition(position)
54  {}
JUTMPosition()
Default constructor.
Definition: JUTMPosition.hh:43
JObjectID()
Default constructor.
Definition: JObjectID.hh:30

Member Function Documentation

int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 50 of file JObjectID.hh.

51  {
52  return __id;
53  }
int& JLANG::JObjectID::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 61 of file JObjectID.hh.

62  {
63  return __id;
64  }
void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 72 of file JObjectID.hh.

73  {
74  this->__id = id;
75  }
bool JLANG::JObjectID::less ( const JObjectID object) const
inlineinherited

Less than method.

Parameters
objectobject identifier
Returns
true if this identifier less than given identifier; else false

Definition at line 84 of file JObjectID.hh.

85  {
86  return this->getID() < object.getID();
87  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
bool JLANG::JObjectID::less ( const int  id) const
inlineinherited

Less than method.

Parameters
ididentifier
Returns
true if this identifier less than given identifier; else false

Definition at line 96 of file JObjectID.hh.

97  {
98  return this->getID() < id;
99  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
bool JLANG::JObjectID::more ( const int  id) const
inlineinherited

More than method.

Parameters
ididentifier
Returns
true if this identifier greater than given identifier; else false

Definition at line 108 of file JObjectID.hh.

109  {
110  return this->getID() > id;
111  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
const JUTMPosition& JUTM::JUTMPosition::getUTMPosition ( ) const
inlineinherited

Get UTM position.

Returns
position

Definition at line 84 of file JUTMPosition.hh.

85  {
86  return static_cast<const JUTMPosition&>(*this);
87  }
Data structure for UTM position.
Definition: JUTMPosition.hh:36
void JUTM::JUTMPosition::setUTMPosition ( const JUTMPosition position)
inlineinherited

Set UTM position.

Parameters
positionposition

Definition at line 95 of file JUTMPosition.hh.

96  {
97  static_cast<JUTMPosition&>(*this) = position;
98  }
Data structure for UTM position.
Definition: JUTMPosition.hh:36
JPosition3D JUTM::JUTMPosition::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 106 of file JUTMPosition.hh.

107  {
108  return JPosition3D(east, north, z);
109  }
JUTM::JUTMPosition::operator JPosition3D ( ) const
inlineinherited

Type conversion operator.

Returns
position

Definition at line 117 of file JUTMPosition.hh.

118  {
119  return getPosition();
120  }
JPosition3D getPosition() const
Get position.
double JUTM::JUTMPosition::getUTMEast ( ) const
inlineinherited

Get UTM east.

Returns
UTM East

Definition at line 128 of file JUTMPosition.hh.

129  {
130  return this->east;
131  }
double JUTM::JUTMPosition::getUTMNorth ( ) const
inlineinherited

Get UTM north.

Returns
UTM North

Definition at line 139 of file JUTMPosition.hh.

140  {
141  return this->north;
142  }
double JUTM::JUTMPosition::getUTMZ ( ) const
inlineinherited

Get UTM Z.

Returns
UTM Z

Definition at line 150 of file JUTMPosition.hh.

151  {
152  return this->z;
153  }
JUTMPosition& JUTM::JUTMPosition::negate ( )
inlineinherited

Negate UTM position.

Returns
this UTM position

Definition at line 161 of file JUTMPosition.hh.

162  {
163  east = -east;
164  north = -north;
165  z = -z;
166 
167  return *this;
168  }
JUTMPosition& JUTM::JUTMPosition::add ( const JUTMPosition pos)
inlineinherited

Add UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 177 of file JUTMPosition.hh.

178  {
179  east += pos.getUTMEast();
180  north += pos.getUTMNorth();
181  z += pos.getUTMZ();
182 
183  return *this;
184  }
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)
inlineinherited

Subtract UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 193 of file JUTMPosition.hh.

194  {
195  east -= pos.getUTMEast();
196  north -= pos.getUTMNorth();
197  z -= pos.getUTMZ();
198 
199  return *this;
200  }
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)
inlineinherited

Scale UTM position.

Parameters
factormultiplication factor
Returns
this UTM position

Definition at line 209 of file JUTMPosition.hh.

210  {
211  east *= factor;
212  north *= factor;
213  z *= factor;
214 
215  return *this;
216  }
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JUTMPosition& JUTM::JUTMPosition::div ( const double  factor)
inlineinherited

Scale UTM position.

Parameters
factordivision factor
Returns
this UTM position

Definition at line 225 of file JUTMPosition.hh.

226  {
227  east /= factor;
228  north /= factor;
229  z /= factor;
230 
231  return *this;
232  }
double JUTM::JUTMPosition::getDisplacement ( const JUTMPosition position) const
inlineinherited

Get displacement to position.

The displacement corresponds to the 2D distance in the (East,North) plane.

Parameters
positionposition
Returns
displacement

Definition at line 243 of file JUTMPosition.hh.

244  {
245  const double x = this->getUTMEast() - position.getUTMEast();
246  const double y = this->getUTMNorth() - position.getUTMNorth();
247 
248  return sqrt(x*x + y*y);
249  }
double getUTMEast() const
Get UTM east.
double getUTMNorth() const
Get UTM north.

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JTripod tripod 
)
friend

Read tripod from input.

Parameters
ininput stream
tripodtripod
Returns
input stream

Definition at line 64 of file JTripod.hh.

65  {
66  in >> static_cast<JObjectID&> (tripod);
67  in >> static_cast<JUTMPosition&>(tripod);
68 
69  return in;
70  }
JUTMPosition()
Default constructor.
Definition: JUTMPosition.hh:43
JObjectID()
Default constructor.
Definition: JObjectID.hh:30
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:38
std::ostream& operator<< ( std::ostream &  out,
const JTripod tripod 
)
friend

Write tripod to output.

Parameters
outoutput stream
tripodtripod
Returns
output stream

Definition at line 80 of file JTripod.hh.

81  {
82  out << static_cast<const JObjectID&> (tripod);
83  out << ' ';
84  out << static_cast<const JUTMPosition&>(tripod);
85 
86  return out;
87  }
JReader& operator>> ( JReader in,
JTripod tripod 
)
friend

Read tripod from input.

Parameters
inreader
tripodtripod
Returns
reader

Definition at line 97 of file JTripod.hh.

98  {
99  in >> static_cast<JObjectID&> (tripod);
100  in >> static_cast<JUTMPosition&>(tripod);
101 
102  return in;
103  }
JUTMPosition()
Default constructor.
Definition: JUTMPosition.hh:43
JObjectID()
Default constructor.
Definition: JObjectID.hh:30
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:38
JWriter& operator<< ( JWriter out,
const JTripod tripod 
)
friend

Write tripod to output.

Parameters
outwriter
tripodtripod
Returns
writer

Definition at line 113 of file JTripod.hh.

114  {
115  out << static_cast<const JObjectID&> (tripod);
116  out << static_cast<const JUTMPosition&>(tripod);
117 
118  return out;
119  }

Member Data Documentation

int JLANG::JObjectID::__id
protectedinherited

Definition at line 140 of file JObjectID.hh.

double JUTM::JUTMPosition::east
protectedinherited

Definition at line 311 of file JUTMPosition.hh.

double JUTM::JUTMPosition::north
protectedinherited

Definition at line 312 of file JUTMPosition.hh.

double JUTM::JUTMPosition::z
protectedinherited

Definition at line 313 of file JUTMPosition.hh.


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