Jpp
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 > 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 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 getPerpDot (const JVector2D &point) const
 Get perpendicular dot product. More...
 
JVector2Dtransform (const JMatrix2D &T)
 Transform. More...
 
JVector2Dtransform (const JMatrix2D &T)
 Transform. 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 JSecond_t &object)
 Multiply with object. More...
 
JVector2Ddiv (const double factor)
 Scale vector. More...
 
bool equals (const JVector2D &vector, const double precision=std::numeric_limits< double >::min()) 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

◆ JAnchor() [1/2]

JDETECTOR::JAnchor::JAnchor ( )
inline

Default constructor.

Definition at line 32 of file JAnchor.hh.

32  :
33  JObjectID(),
34  JPosition2D()
35  {}

◆ JAnchor() [2/2]

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

Member Function Documentation

◆ getID()

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

Get identifier.

Returns
identifier

Definition at line 55 of file JObjectID.hh.

56  {
57  return __id;
58  }

◆ setID()

void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 66 of file JObjectID.hh.

67  {
68  this->__id = id;
69  }

◆ less() [1/2]

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 78 of file JObjectID.hh.

79  {
80  return this->getID() < object.getID();
81  }

◆ less() [2/2]

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 90 of file JObjectID.hh.

91  {
92  return this->getID() < id;
93  }

◆ more()

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 102 of file JObjectID.hh.

103  {
104  return this->getID() > id;
105  }

◆ getPosition() [1/2]

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  }

◆ getPosition() [2/2]

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  }

◆ setPosition()

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  }

◆ operator JAngle2D()

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  }

◆ operator JVersor2D()

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  }

◆ rotate()

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  }

◆ rotate_back()

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  }

◆ getDot() [1/4]

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  }

◆ getDot() [2/4]

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  }

◆ getDot() [3/4]

double JGEOMETRY2D::JVector2D::getDot
inlineinherited

Get dot product.

Parameters
pointvector
Returns
dot product

Definition at line 234 of file JVector2D.hh.

235  {
236  return
237  getX() * point.getX() +
238  getY() * point.getY();
239  }

◆ getDot() [4/4]

double JGEOMETRY2D::JVector2D::getDot ( const JVector2D point) const
inlineinherited

Get dot product.

Parameters
pointvector
Returns
dot product

Definition at line 234 of file JVector2D.hh.

235  {
236  return
237  getX() * point.getX() +
238  getY() * point.getY();
239  }

◆ getPerpDot() [1/4]

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  }

◆ getPerpDot() [2/4]

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  }

◆ getPerpDot() [3/4]

double JGEOMETRY2D::JVector2D::getPerpDot
inlineinherited

Get perpendicular dot product.

Parameters
pointvector
Returns
perpendicular dot product

Definition at line 248 of file JVector2D.hh.

249  {
250  return
251  getX() * point.getY() -
252  getY() * point.getX();
253  }

◆ getPerpDot() [4/4]

double JGEOMETRY2D::JVector2D::getPerpDot ( const JVector2D point) const
inlineinherited

Get perpendicular dot product.

Parameters
pointvector
Returns
perpendicular dot product

Definition at line 248 of file JVector2D.hh.

249  {
250  return
251  getX() * point.getY() -
252  getY() * point.getX();
253  }

◆ transform() [1/2]

JVector2D& JGEOMETRY2D::JVector2D::transform
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this vector

Definition at line 159 of file JVector2D.hh.

160  {
161  T.transform(__x, __y);
162 
163  return *this;
164  }

◆ transform() [2/2]

JVector2D& JGEOMETRY2D::JVector2D::transform ( const JMatrix2D T)
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this vector

Definition at line 159 of file JVector2D.hh.

160  {
161  T.transform(__x, __y);
162 
163  return *this;
164  }

◆ getX()

double JGEOMETRY2D::JVector2D::getX ( ) const
inlineinherited

Get x position.

Returns
x position

Definition at line 62 of file JVector2D.hh.

63  {
64  return __x;
65  }

◆ getY()

double JGEOMETRY2D::JVector2D::getY ( ) const
inlineinherited

Get y position.

Returns
y position

Definition at line 73 of file JVector2D.hh.

74  {
75  return __y;
76  }

◆ negate()

JVector2D& JGEOMETRY2D::JVector2D::negate ( )
inlineinherited

Negate vector.

Returns
this vector

Definition at line 84 of file JVector2D.hh.

85  {
86  __x = -__x;
87  __y = -__y;
88 
89  return *this;
90  }

◆ add()

JVector2D& JGEOMETRY2D::JVector2D::add ( const JVector2D vector)
inlineinherited

Add vector.

Parameters
vectorvector
Returns
this vector

Definition at line 99 of file JVector2D.hh.

100  {
101  __x += vector.getX();
102  __y += vector.getY();
103 
104  return *this;
105  }

◆ sub()

JVector2D& JGEOMETRY2D::JVector2D::sub ( const JVector2D vector)
inlineinherited

Subtract vector.

Parameters
vectorvector
Returns
this vector

Definition at line 114 of file JVector2D.hh.

115  {
116  __x -= vector.getX();
117  __y -= vector.getY();
118 
119  return *this;
120  }

◆ mul() [1/2]

JVector2D& JGEOMETRY2D::JVector2D::mul ( const double  factor)
inlineinherited

Scale vector.

Parameters
factormultiplication factor
Returns
this vector

Definition at line 129 of file JVector2D.hh.

130  {
131  __x *= factor;
132  __y *= factor;
133 
134  return *this;
135  }

◆ mul() [2/2]

JVector2D & JMATH::JMath< JVector2D , 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  }

◆ div()

JVector2D& JGEOMETRY2D::JVector2D::div ( const double  factor)
inlineinherited

Scale vector.

Parameters
factordivision factor
Returns
this vector

Definition at line 144 of file JVector2D.hh.

145  {
146  __x /= factor;
147  __y /= factor;
148 
149  return *this;
150  }

◆ equals()

bool JGEOMETRY2D::JVector2D::equals ( const JVector2D vector,
const double  precision = std::numeric_limits<double>::min() 
) const
inlineinherited

Check equality.

Parameters
vectorvector
precisionprecision
Returns
true if vectors are equal; else false

Definition at line 174 of file JVector2D.hh.

176  {
177  return (fabs(getX() - vector.getX()) <= precision &&
178  fabs(getY() - vector.getY()) <= precision);
179  }

◆ getLengthSquared()

double JGEOMETRY2D::JVector2D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 187 of file JVector2D.hh.

188  {
189  return getX()*getX() + getY()*getY();
190  }

◆ getLength()

double JGEOMETRY2D::JVector2D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 198 of file JVector2D.hh.

199  {
200  return sqrt(getLengthSquared());
201  }

◆ getDistanceSquared()

double JGEOMETRY2D::JVector2D::getDistanceSquared ( const JVector2D point) const
inlineinherited

Get squared of distance to point.

Parameters
pointpoint
Returns
square of distance

Definition at line 210 of file JVector2D.hh.

211  {
212  return JVector2D(point).sub(*this).getLengthSquared();
213  }

◆ getDistance()

double JGEOMETRY2D::JVector2D::getDistance ( const JVector2D point) const
inlineinherited

Get distance to point.

Parameters
pointpoint
Returns
distance

Definition at line 222 of file JVector2D.hh.

223  {
224  return sqrt(getDistanceSquared(point));
225  }

Friends And Related Function Documentation

◆ operator>>

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  }

◆ operator<<

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  }

Member Data Documentation

◆ __id

int JLANG::JObjectID::__id
protectedinherited

Definition at line 160 of file JObjectID.hh.

◆ __x

double JGEOMETRY2D::JVector2D::__x
protectedinherited

Definition at line 256 of file JVector2D.hh.

◆ __y

double JGEOMETRY2D::JVector2D::__y
protectedinherited

Definition at line 257 of file JVector2D.hh.


The documentation for this class was generated from the following file:
JGEOMETRY2D::JRotation2D::rotate_back
void rotate_back(double &__x, double &__y) const
Rotate back.
Definition: JRotation2D.hh:112
JGEOMETRY2D::JAngle2D::getDX
double getDX() const
Get x direction.
Definition: JAngle2D.hh:81
JGEOMETRY2D::JVector2D::getLengthSquared
double getLengthSquared() const
Get length squared.
Definition: JVector2D.hh:187
JGEOMETRY2D::JPosition2D::JPosition2D
JPosition2D()
Default constructor.
Definition: JPosition2D.hh:43
JDETECTOR::JAnchor::JAnchor
JAnchor()
Default constructor.
Definition: JAnchor.hh:32
JGEOMETRY2D::JVector2D::getDistanceSquared
double getDistanceSquared(const JVector2D &point) const
Get squared of distance to point.
Definition: JVector2D.hh:210
JGEOMETRY2D::JRotation2D::rotate
void rotate(double &__x, double &__y) const
Rotate.
Definition: JRotation2D.hh:96
JGEOMETRY2D::JVector2D::__x
double __x
Definition: JVector2D.hh:256
JLANG::JObjectID::getID
int getID() const
Get identifier.
Definition: JObjectID.hh:55
JGEOMETRY2D::JAngle2D::getDY
double getDY() const
Get y direction.
Definition: JAngle2D.hh:92
JGEOMETRY2D::JAngle2D
Data structure for angle in two dimensions.
Definition: JAngle2D.hh:31
JLANG::JObjectID::__id
int __id
Definition: JObjectID.hh:160
JGEOMETRY2D::JVector2D::JVector2D
JVector2D()
Default constructor.
Definition: JVector2D.hh:38
JLANG::JObjectID::JObjectID
JObjectID()
Default constructor.
Definition: JObjectID.hh:35
JGEOMETRY2D::JVector2D::getX
double getX() const
Get x position.
Definition: JVector2D.hh:62
JGEOMETRY2D::JVersor2D::getDX
double getDX() const
Get x direction.
Definition: JVersor2D.hh:53
JMATH::JCalculator
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JGEOMETRY2D::JVersor2D
Data structure for normalised vector in two dimensions.
Definition: JVersor2D.hh:20
JGEOMETRY2D::JVector2D::getY
double getY() const
Get y position.
Definition: JVector2D.hh:73
JGEOMETRY2D::JVersor2D::getDY
double getDY() const
Get y direction.
Definition: JVersor2D.hh:64
JGEOMETRY2D::JVector2D::__y
double __y
Definition: JVector2D.hh:257