Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
JDETECTOR::JCompass Class Reference

Data structure for comapss in three dimensions. More...

#include <JCompass.hh>

Inheritance diagram for JDETECTOR::JCompass:
JMATH::JMath< JCompass >

Public Member Functions

 JCompass ()
 Default constructor. More...
 
 JCompass (const double pitch, const double roll, const double yaw)
 Constructor. More...
 
const JCompassgetCompass () const
 Get compass. More...
 
void setCompass (const JCompass &compass)
 Set compass. More...
 
JCompassnegate ()
 Negate compass. More...
 
JCompassadd (const JCompass &compass)
 Add compass. More...
 
JCompasssub (const JCompass &compass)
 Subtract compass. More...
 
JCompassmul (const double factor)
 Scale compass. More...
 
JCompassdiv (const double factor)
 Scale compass. More...
 
double getPitch () const
 Get pitch compass. More...
 
double getRoll () const
 Get roll compass. More...
 
double getYaw () const
 Get yaw compass. More...
 
JCompassmul (const JNullType &object)
 Multiply with object. More...
 

Protected Attributes

double __pitch
 
double __roll
 
double __yaw
 

Friends

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

Detailed Description

Data structure for comapss in three dimensions.

This class implements the JMATH::JMath interface.

Definition at line 31 of file JCompass.hh.

Constructor & Destructor Documentation

JDETECTOR::JCompass::JCompass ( )
inline

Default constructor.

Definition at line 38 of file JCompass.hh.

38  :
39  __pitch(0.0),
40  __roll (0.0),
41  __yaw (0.0)
42  {}
JDETECTOR::JCompass::JCompass ( const double  pitch,
const double  roll,
const double  yaw 
)
inline

Constructor.

Parameters
pitchpitch angle [rad]
rollroll angle [rad]
yawyaw angle [rad]

Definition at line 52 of file JCompass.hh.

54  :
55  __pitch(pitch),
56  __roll (roll),
57  __yaw (yaw)
58  {}

Member Function Documentation

const JCompass& JDETECTOR::JCompass::getCompass ( ) const
inline

Get compass.

Returns
this compass

Definition at line 66 of file JCompass.hh.

67  {
68  return static_cast<const JCompass&>(*this);
69  }
Data structure for comapss in three dimensions.
Definition: JCompass.hh:31
void JDETECTOR::JCompass::setCompass ( const JCompass compass)
inline

Set compass.

Parameters
compasscompass

Definition at line 77 of file JCompass.hh.

78  {
79  static_cast<JCompass&>(*this) = compass;
80  }
Data structure for comapss in three dimensions.
Definition: JCompass.hh:31
JCompass& JDETECTOR::JCompass::negate ( )
inline

Negate compass.

Returns
this compass

Definition at line 88 of file JCompass.hh.

89  {
90  __pitch = -__pitch;
91  __roll = -__roll;
92  __yaw = -__yaw;
93 
94  return *this;
95  }
JCompass& JDETECTOR::JCompass::add ( const JCompass compass)
inline

Add compass.

Parameters
compasscompass
Returns
this compass

Definition at line 104 of file JCompass.hh.

105  {
106  __pitch += compass.getPitch();
107  __roll += compass.getRoll();
108  __yaw += compass.getYaw();
109 
110  return *this;
111  }
double getRoll() const
Get roll compass.
Definition: JCompass.hh:178
double getYaw() const
Get yaw compass.
Definition: JCompass.hh:189
double getPitch() const
Get pitch compass.
Definition: JCompass.hh:167
JCompass& JDETECTOR::JCompass::sub ( const JCompass compass)
inline

Subtract compass.

Parameters
compasscompass
Returns
this compass

Definition at line 120 of file JCompass.hh.

121  {
122  __pitch -= compass.getPitch();
123  __roll -= compass.getRoll();
124  __yaw -= compass.getYaw();
125 
126  return *this;
127  }
double getRoll() const
Get roll compass.
Definition: JCompass.hh:178
double getYaw() const
Get yaw compass.
Definition: JCompass.hh:189
double getPitch() const
Get pitch compass.
Definition: JCompass.hh:167
JCompass& JDETECTOR::JCompass::mul ( const double  factor)
inline

Scale compass.

Parameters
factormultiplication factor
Returns
this compass

Definition at line 136 of file JCompass.hh.

137  {
138  __pitch *= factor;
139  __roll *= factor;
140  __yaw *= factor;
141 
142  return *this;
143  }
JCompass& JDETECTOR::JCompass::div ( const double  factor)
inline

Scale compass.

Parameters
factordivision factor
Returns
this compass

Definition at line 152 of file JCompass.hh.

153  {
154  __pitch /= factor;
155  __roll /= factor;
156  __yaw /= factor;
157 
158  return *this;
159  }
double JDETECTOR::JCompass::getPitch ( ) const
inline

Get pitch compass.

Returns
pitch compass

Definition at line 167 of file JCompass.hh.

168  {
169  return __pitch;
170  }
double JDETECTOR::JCompass::getRoll ( ) const
inline

Get roll compass.

Returns
roll compass

Definition at line 178 of file JCompass.hh.

179  {
180  return __roll;
181  }
double JDETECTOR::JCompass::getYaw ( ) const
inline

Get yaw compass.

Returns
yaw compass

Definition at line 189 of file JCompass.hh.

190  {
191  return __yaw;
192  }
JCompass & JMATH::JMath< JCompass , 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,
JCompass compass 
)
friend

Read compasss from input.

Parameters
ininput stream
compasscompasss
Returns
input stream

Definition at line 202 of file JCompass.hh.

203  {
204  in >> compass.__pitch >> compass.__roll >> compass.__yaw;
205 
206  return in;
207  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
std::ostream& operator<< ( std::ostream &  out,
const JCompass compass 
)
friend

Write compasss to output.

Parameters
outoutput stream
compasscompass
Returns
output stream

Definition at line 217 of file JCompass.hh.

218  {
219  out << compass.getPitch() << ' ' << compass.getRoll() << ' ' << compass.getYaw();
220 
221  return out;
222  }
double getRoll() const
Get roll compass.
Definition: JCompass.hh:178
double getYaw() const
Get yaw compass.
Definition: JCompass.hh:189
double getPitch() const
Get pitch compass.
Definition: JCompass.hh:167
JReader& operator>> ( JReader in,
JCompass compass 
)
friend

Read compasss from input.

Parameters
inreader
compasscompasss
Returns
reader

Definition at line 232 of file JCompass.hh.

233  {
234  in >> compass.__pitch;
235  in >> compass.__roll;
236  in >> compass.__yaw;
237 
238  return in;
239  }
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
JWriter& operator<< ( JWriter out,
const JCompass compass 
)
friend

Write compasss to output.

Parameters
outwriter
compasscompasss
Returns
writer

Definition at line 249 of file JCompass.hh.

250  {
251  out << compass.__pitch;
252  out << compass.__roll;
253  out << compass.__yaw;
254 
255  return out;
256  }

Member Data Documentation

double JDETECTOR::JCompass::__pitch
protected

Definition at line 260 of file JCompass.hh.

double JDETECTOR::JCompass::__roll
protected

Definition at line 261 of file JCompass.hh.

double JDETECTOR::JCompass::__yaw
protected

Definition at line 262 of file JCompass.hh.


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