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

Data structure for anchor position on sea bed. More...

#include <JAnchor.hh>

Inheritance diagram for JDETECTOR::JAnchor:
JLANG::JObjectID JGEOMETRY2D::JPosition2D JLANG::JComparable< JObjectID, int > JGEOMETRY2D::JVector2D JMATH::JMath< JVector2D >

Public Member Functions

 JAnchor ()
 Default constructor. More...
 
 JAnchor (const int id, const double x, const double y)
 Constructor. More...
 
int getID () const
 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 JPosition2DgetPosition () const
 Get position. More...
 
JPosition2DgetPosition ()
 Get position. More...
 
void setPosition (const JVector2D &pos)
 Set position. More...
 
 operator JAngle2D () const
 Type conversion operator. More...
 
 operator JVersor2D () const
 Type conversion operator. More...
 
JPosition2Drotate (const JRotation2D &R)
 Rotate. More...
 
JPosition2Drotate_back (const JRotation2D &R)
 Rotate back. More...
 
double getDot (const JAngle2D &angle) const
 Get dot product. More...
 
double getDot (const JVersor2D &versor) const
 Get dot product. More...
 
double getDot (const JVector2D &point) const
 Get dot product. More...
 
double getPerpDot (const JAngle2D &angle) const
 Get perpendicular dot product. More...
 
double getPerpDot (const JVersor2D &dir) const
 Get perpendicular dot product. More...
 
double getPerpDot (const JVector2D &point) const
 Get perpendicular dot product. More...
 
double getX () const
 Get x position. More...
 
double getY () const
 Get y position. More...
 
JVector2Dnegate ()
 Negate vector. More...
 
JVector2Dadd (const JVector2D &vector)
 Add vector. More...
 
JVector2Dsub (const JVector2D &vector)
 Subtract vector. More...
 
JVector2Dmul (const double factor)
 Scale vector. More...
 
JVector2Dmul (const JNullType &object)
 Multiply with object. More...
 
JVector2Ddiv (const double factor)
 Scale vector. More...
 
JVector2Dtransform (const JMatrix2D &T)
 Transform. More...
 
bool equals (const JVector2D &vector) const
 Check equality. More...
 
double getLengthSquared () const
 Get length squared. More...
 
double getLength () const
 Get length. More...
 
double getDistanceSquared (const JVector2D &point) const
 Get squared of distance to point. More...
 
double getDistance (const JVector2D &point) const
 Get distance to point. More...
 

Protected Attributes

int __id
 
double __x
 
double __y
 

Friends

std::istream & operator>> (std::istream &in, JAnchor &anchor)
 Read JAnchor from input. More...
 
std::ostream & operator<< (std::ostream &out, const JAnchor &anchor)
 Write JAnchor to output. More...
 

Detailed Description

Data structure for anchor position on sea bed.

Definition at line 24 of file JAnchor.hh.

Constructor & Destructor Documentation

JDETECTOR::JAnchor::JAnchor ( )
inline

Default constructor.

Definition at line 32 of file JAnchor.hh.

32  :
33  JObjectID(),
34  JPosition2D()
35  {}
JPosition2D()
Default constructor.
Definition: JPosition2D.hh:43
JObjectID()
Default constructor.
Definition: JObjectID.hh:34
JDETECTOR::JAnchor::JAnchor ( const int  id,
const double  x,
const double  y 
)
inline

Constructor.

Parameters
ididentifier
xx position
yy position

Definition at line 45 of file JAnchor.hh.

47  :
48  JObjectID(id),
49  JPosition2D(x, y)
50  {}
JPosition2D()
Default constructor.
Definition: JPosition2D.hh:43
JObjectID()
Default constructor.
Definition: JObjectID.hh:34

Member Function Documentation

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

Get identifier.

Returns
identifier

Definition at line 54 of file JObjectID.hh.

55  {
56  return __id;
57  }
void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 65 of file JObjectID.hh.

66  {
67  this->__id = id;
68  }
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 77 of file JObjectID.hh.

78  {
79  return this->getID() < object.getID();
80  }
int getID() const
Get identifier.
Definition: JObjectID.hh:54
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 89 of file JObjectID.hh.

90  {
91  return this->getID() < id;
92  }
int getID() const
Get identifier.
Definition: JObjectID.hh:54
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 101 of file JObjectID.hh.

102  {
103  return this->getID() > id;
104  }
int getID() const
Get identifier.
Definition: JObjectID.hh:54
const JPosition2D& JGEOMETRY2D::JPosition2D::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 97 of file JPosition2D.hh.

98  {
99  return static_cast<const JPosition2D&>(*this);
100  }
Data structure for position in two dimensions.
Definition: JPosition2D.hh:30
JPosition2D& JGEOMETRY2D::JPosition2D::getPosition ( )
inlineinherited

Get position.

Returns
position

Definition at line 108 of file JPosition2D.hh.

109  {
110  return static_cast<JPosition2D&>(*this);
111  }
Data structure for position in two dimensions.
Definition: JPosition2D.hh:30
void JGEOMETRY2D::JPosition2D::setPosition ( const JVector2D pos)
inlineinherited

Set position.

Parameters
posposition

Definition at line 119 of file JPosition2D.hh.

120  {
121  static_cast<JVector2D&>(*this) = pos;
122  }
Data structure for vector in two dimensions.
Definition: JVector2D.hh:30
JGEOMETRY2D::JPosition2D::operator JAngle2D ( ) const
inlineinherited

Type conversion operator.

Returns
angle

Definition at line 130 of file JPosition2D.hh.

131  {
132  return JAngle2D(getX(), getY());
133  }
Data structure for angle in two dimensions.
Definition: JAngle2D.hh:30
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
JGEOMETRY2D::JPosition2D::operator JVersor2D ( ) const
inlineinherited

Type conversion operator.

Returns
direction

Definition at line 141 of file JPosition2D.hh.

142  {
143  return JVersor2D(getX(), getY());
144  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
Data structure for normalised vector in two dimensions.
Definition: JVersor2D.hh:19
double getX() const
Get x position.
Definition: JVector2D.hh:61
JPosition2D& JGEOMETRY2D::JPosition2D::rotate ( const JRotation2D R)
inlineinherited

Rotate.

Parameters
Rrotation matrix
Returns
this position

Definition at line 153 of file JPosition2D.hh.

154  {
155  R.rotate(__x, __y);
156 
157  return *this;
158  }
void rotate(double &__x, double &__y) const
Rotate.
Definition: JRotation2D.hh:96
JPosition2D& JGEOMETRY2D::JPosition2D::rotate_back ( const JRotation2D R)
inlineinherited

Rotate back.

Parameters
Rrotation matrix
Returns
this position

Definition at line 167 of file JPosition2D.hh.

168  {
169  R.rotate_back(__x, __y);
170 
171  return *this;
172  }
void rotate_back(double &__x, double &__y) const
Rotate back.
Definition: JRotation2D.hh:112
double JGEOMETRY2D::JPosition2D::getDot ( const JAngle2D angle) const
inlineinherited

Get dot product.

Parameters
angleangle
Returns
dot product

Definition at line 181 of file JPosition2D.hh.

182  {
183  return
184  getX() * angle.getDX() +
185  getY() * angle.getDY();
186  }
double getDX() const
Get x direction.
Definition: JAngle2D.hh:80
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
double getDY() const
Get y direction.
Definition: JAngle2D.hh:91
double JGEOMETRY2D::JPosition2D::getDot ( const JVersor2D versor) const
inlineinherited

Get dot product.

Parameters
versorversor
Returns
dot product

Definition at line 195 of file JPosition2D.hh.

196  {
197  return
198  getX() * versor.getDX() +
199  getY() * versor.getDY();
200  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getDX() const
Get x direction.
Definition: JVersor2D.hh:52
double getX() const
Get x position.
Definition: JVector2D.hh:61
double getDY() const
Get y direction.
Definition: JVersor2D.hh:63
double JGEOMETRY2D::JVector2D::getDot ( const JVector2D point) const
inlineinherited

Get dot product.

Parameters
pointvector
Returns
dot product

Definition at line 231 of file JVector2D.hh.

232  {
233  return
234  getX() * point.getX() +
235  getY() * point.getY();
236  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
double JGEOMETRY2D::JPosition2D::getPerpDot ( const JAngle2D angle) const
inlineinherited

Get perpendicular dot product.

Parameters
angleangle
Returns
perpendicular dot product

Definition at line 209 of file JPosition2D.hh.

210  {
211  return
212  getX() * angle.getDY() -
213  getY() * angle.getDX();
214  }
double getDX() const
Get x direction.
Definition: JAngle2D.hh:80
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
double getDY() const
Get y direction.
Definition: JAngle2D.hh:91
double JGEOMETRY2D::JPosition2D::getPerpDot ( const JVersor2D dir) const
inlineinherited

Get perpendicular dot product.

Parameters
dirdirection
Returns
perpendicular dot product

Definition at line 223 of file JPosition2D.hh.

224  {
225  return
226  getX() * dir.getDY() -
227  getY() * dir.getDX();
228  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getDX() const
Get x direction.
Definition: JVersor2D.hh:52
double getX() const
Get x position.
Definition: JVector2D.hh:61
double getDY() const
Get y direction.
Definition: JVersor2D.hh:63
double JGEOMETRY2D::JVector2D::getPerpDot ( const JVector2D point) const
inlineinherited

Get perpendicular dot product.

Parameters
pointvector
Returns
perpendicular dot product

Definition at line 245 of file JVector2D.hh.

246  {
247  return
248  getX() * point.getY() -
249  getY() * point.getX();
250  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
double JGEOMETRY2D::JVector2D::getX ( ) const
inlineinherited

Get x position.

Returns
x position

Definition at line 61 of file JVector2D.hh.

62  {
63  return __x;
64  }
double JGEOMETRY2D::JVector2D::getY ( ) const
inlineinherited

Get y position.

Returns
y position

Definition at line 72 of file JVector2D.hh.

73  {
74  return __y;
75  }
JVector2D& JGEOMETRY2D::JVector2D::negate ( )
inlineinherited

Negate vector.

Returns
this vector

Definition at line 83 of file JVector2D.hh.

84  {
85  __x = -__x;
86  __y = -__y;
87 
88  return *this;
89  }
JVector2D& JGEOMETRY2D::JVector2D::add ( const JVector2D vector)
inlineinherited

Add vector.

Parameters
vectorvector
Returns
this vector

Definition at line 98 of file JVector2D.hh.

99  {
100  __x += vector.getX();
101  __y += vector.getY();
102 
103  return *this;
104  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
JVector2D& JGEOMETRY2D::JVector2D::sub ( const JVector2D vector)
inlineinherited

Subtract vector.

Parameters
vectorvector
Returns
this vector

Definition at line 113 of file JVector2D.hh.

114  {
115  __x -= vector.getX();
116  __y -= vector.getY();
117 
118  return *this;
119  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
JVector2D& JGEOMETRY2D::JVector2D::mul ( const double  factor)
inlineinherited

Scale vector.

Parameters
factormultiplication factor
Returns
this vector

Definition at line 128 of file JVector2D.hh.

129  {
130  __x *= factor;
131  __y *= factor;
132 
133  return *this;
134  }
JVector2D & JMATH::JMath< JVector2D , 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 product evaluation of objects.
Definition: JCalculator.hh:18
JVector2D& JGEOMETRY2D::JVector2D::div ( const double  factor)
inlineinherited

Scale vector.

Parameters
factordivision factor
Returns
this vector

Definition at line 143 of file JVector2D.hh.

144  {
145  __x /= factor;
146  __y /= factor;
147 
148  return *this;
149  }
JVector2D& JGEOMETRY2D::JVector2D::transform ( const JMatrix2D T)
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this vector

Definition at line 158 of file JVector2D.hh.

159  {
160  T.transform(__x, __y);
161 
162  return *this;
163  }
bool JGEOMETRY2D::JVector2D::equals ( const JVector2D vector) const
inlineinherited

Check equality.

Parameters
vectorvector
Returns
true if vectors are equal; else false

Definition at line 172 of file JVector2D.hh.

173  {
174  return (getX() == vector.getX() &&
175  getY() == vector.getY());
176  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
double JGEOMETRY2D::JVector2D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 184 of file JVector2D.hh.

185  {
186  return getX()*getX() + getY()*getY();
187  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
double JGEOMETRY2D::JVector2D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 195 of file JVector2D.hh.

196  {
197  return sqrt(getLengthSquared());
198  }
double getLengthSquared() const
Get length squared.
Definition: JVector2D.hh:184
double JGEOMETRY2D::JVector2D::getDistanceSquared ( const JVector2D point) const
inlineinherited

Get squared of distance to point.

Parameters
pointpoint
Returns
square of distance

Definition at line 207 of file JVector2D.hh.

208  {
209  return JVector2D(point).sub(*this).getLengthSquared();
210  }
JVector2D()
Default constructor.
Definition: JVector2D.hh:37
double JGEOMETRY2D::JVector2D::getDistance ( const JVector2D point) const
inlineinherited

Get distance to point.

Parameters
pointpoint
Returns
distance

Definition at line 219 of file JVector2D.hh.

220  {
221  return sqrt(getDistanceSquared(point));
222  }
double getDistanceSquared(const JVector2D &point) const
Get squared of distance to point.
Definition: JVector2D.hh:207

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JAnchor anchor 
)
friend

Read JAnchor from input.

Parameters
ininput stream
anchorJAnchor
Returns
input stream

Definition at line 60 of file JAnchor.hh.

61  {
62  int id;
63  double x, y;
64 
65  if (in >> id >> x >> y)
66  anchor = JAnchor(id, x, y);
67 
68  return in;
69  }
JAnchor()
Default constructor.
Definition: JAnchor.hh:32
std::ostream& operator<< ( std::ostream &  out,
const JAnchor anchor 
)
friend

Write JAnchor to output.

Parameters
outoutput stream
anchorJAnchor
Returns
output stream

Definition at line 79 of file JAnchor.hh.

80  {
81  out << anchor.getID();
82  out << ' ';
83  out << anchor.getX();
84  out << ' ';
85  out << anchor.getY();
86 
87  return out;
88  }
double getY() const
Get y position.
Definition: JVector2D.hh:72
double getX() const
Get x position.
Definition: JVector2D.hh:61
int getID() const
Get identifier.
Definition: JObjectID.hh:54

Member Data Documentation

int JLANG::JObjectID::__id
protectedinherited

Definition at line 159 of file JObjectID.hh.

double JGEOMETRY2D::JVector2D::__x
protectedinherited

Definition at line 253 of file JVector2D.hh.

double JGEOMETRY2D::JVector2D::__y
protectedinherited

Definition at line 254 of file JVector2D.hh.


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