World Ocean Simulation System (WOSS) library
woss::Location Class Reference

Class that stores the coordinates of moving entity. More...

#include <location-definitions.h>

Inheritance diagram for woss::Location:
Inheritance graph
Collaboration diagram for woss::Location:
Collaboration graph

Public Member Functions

 Location (const CoordZ &coordz=CoordZ(), double dist=LOCATION_COMPARISON_DISTANCE)
 
 Location (double latitude, double longitude, double depth=0, double dist=LOCATION_COMPARISON_DISTANCE)
 
virtual ~Location ()
 
virtual Locationcreate (double latitude, double longitude, double depth=0, double dist=LOCATION_COMPARISON_DISTANCE) const
 
virtual Locationcreate (const CoordZ &coordz=CoordZ(), double dist=LOCATION_COMPARISON_DISTANCE) const
 
virtual Locationclone () const
 
virtual bool isValid () const
 
virtual bool isEquivalentTo (const woss::CoordZ &coordz)
 
virtual void setLocation (const CoordZ &coordz)
 
virtual void setLatitude (double lat)
 
virtual void setLongitude (double lon)
 
virtual void setDepth (double depth)
 
virtual void setVerticalOrientation (double angle)
 
virtual void setHorizontalOrientation (double angle)
 
virtual CoordZ getLocation ()
 
virtual double getLatitude ()
 
virtual double getLongitude ()
 
virtual double getDepth ()
 
virtual double getX ()
 
virtual double getY ()
 
virtual double getZ ()
 
virtual double getVerticalOrientation ()
 
virtual double getHorizontalOrientation ()
 
virtual double getBearing ()
 
friend::std::ostream & operator<< (::std::ostream &os, const Location &instance)
 

Protected Attributes

double comparison_distance
 
CoordZ curr_coordz
 
double vertical_orientation
 
double horizontal_orientation
 
double bearing
 

Detailed Description

Class that stores the coordinates of moving entity.

The woss::Location class has the task of storing the geographical coordinates of a moving entity

Constructor & Destructor Documentation

◆ Location() [1/2]

Location::Location ( const CoordZ coordz = CoordZ(),
double  dist = LOCATION_COMPARISON_DISTANCE 
)

Location default constructor

Parameters
coordzcoordinates
distdistance comparison precision [m]

◆ Location() [2/2]

Location::Location ( double  latitude,
double  longitude,
double  depth = 0,
double  dist = LOCATION_COMPARISON_DISTANCE 
)

Location constructor

Parameters
latitudelatitude value [decimal degrees]
longitudelongitude value [decimal degrees]
depthdepth value [m]
distdistance comparison precision [m]

◆ ~Location()

virtual woss::Location::~Location ( )
inlinevirtual

Location destructor

Member Function Documentation

◆ clone()

virtual Location * woss::Location::clone ( ) const
inlinevirtual

Location virtual factory method

Returns
a heap-allocated copy of this instance

Reimplemented in WossPosition.

Referenced by woss::WossCreatorContainer< Data * >::get().

◆ create() [1/2]

virtual Location * woss::Location::create ( const CoordZ coordz = CoordZ(),
double  dist = LOCATION_COMPARISON_DISTANCE 
) const
inlinevirtual

Location virtual factory method

Parameters
coordzcoordinates
distdistance comparison precision [m]
Returns
a heap-allocated Location object

Reimplemented in WossPosition.

◆ create() [2/2]

virtual Location * woss::Location::create ( double  latitude,
double  longitude,
double  depth = 0,
double  dist = LOCATION_COMPARISON_DISTANCE 
) const
inlinevirtual

Location virtual factory method

Parameters
latitudelatitude value [decimal degrees]
longitudelongitude value [decimal degrees]
depthdepth value [m]
distdistance comparison precision [m]
Returns
a heap-allocated Location object

Reimplemented in WossPosition.

◆ getBearing()

double Location::getBearing ( )
virtual

Gets current bearing in [-pi,pi]

Returns
bearing [dec degrees]

Reimplemented in WossWpPosition.

References bearing.

◆ getDepth()

double Location::getDepth ( )
virtual

Gets current depth

Returns
valid depth [m]

Reimplemented in WossPosition.

References woss::CoordZ::getDepth(), and getLocation().

Referenced by WossPosition::getDepth().

Here is the call graph for this function:

◆ getHorizontalOrientation()

double Location::getHorizontalOrientation ( )
virtual

Gets current horizontal orientation from reference line (0 degrees = parallel to direction of current movement ) positive values are counter-clockwise rotations, while negative ones are clockwise rotations

Returns
difference angle [dec degrees]

References horizontal_orientation.

◆ getLatitude()

double Location::getLatitude ( )
virtual

Gets current latitude

Returns
valid latitude [decimal degrees]

Reimplemented in WossPosition.

References woss::Coord::getLatitude(), and getLocation().

Referenced by WossPosition::getLatitude().

Here is the call graph for this function:

◆ getLocation()

CoordZ Location::getLocation ( )
virtual

Gets current coordinates

Returns
valid woss::CoordZ

Reimplemented in WossWpPosition.

References curr_coordz.

Referenced by getDepth(), getLatitude(), WossWpPosition::getLocation(), getLongitude(), getX(), getY(), getZ(), and isEquivalentTo().

◆ getLongitude()

double Location::getLongitude ( )
virtual

Gets current longitude

Returns
valid longitude [decimal degrees]

Reimplemented in WossPosition.

References getLocation(), and woss::Coord::getLongitude().

Referenced by WossPosition::getLongitude().

Here is the call graph for this function:

◆ getVerticalOrientation()

double Location::getVerticalOrientation ( )
virtual

Gets current vertical orientation from reference line (0 degrees = parallel to sea surface / bottom ). Negative values are towards the surface, while positive ones are towards sea bottom

Returns
difference angle [dec degrees]

Reimplemented in WossWpPosition.

References vertical_orientation.

◆ getX()

double Location::getX ( )
virtual

Gets current cartesian x-axis value

Returns
x value

Reimplemented in WossPosition.

References woss::CoordZ::getCartX(), and getLocation().

Referenced by WossPosition::getX().

Here is the call graph for this function:

◆ getY()

double Location::getY ( )
virtual

Gets current cartesian y-axis value

Returns
y value

Reimplemented in WossPosition.

References woss::CoordZ::getCartY(), and getLocation().

Referenced by WossPosition::getY().

Here is the call graph for this function:

◆ getZ()

double Location::getZ ( )
virtual

Gets current cartesian z-axis value

Returns
z value

Reimplemented in WossPosition.

References woss::CoordZ::getCartZ(), and getLocation().

Referenced by WossPosition::getZ().

Here is the call graph for this function:

◆ isEquivalentTo()

bool Location::isEquivalentTo ( const woss::CoordZ coordz)
virtual

Checks if the woss::CoordZ given is equivalent to this Location

Parameters
coordzvalid woss::CoordZ to check
Returns
true if assumption is valid, false otherwise

Reimplemented in WossWpPosition.

References comparison_distance, woss::CoordZ::getCartDistance(), getLocation(), and woss::CoordZ::isValid().

Here is the call graph for this function:

◆ isValid()

virtual bool woss::Location::isValid ( ) const
inlinevirtual

Checks the validity of Location

Returns
true if curr_coordz is valid, false otherwise

References curr_coordz, and woss::CoordZ::isValid().

Here is the call graph for this function:

◆ operator<<()

friend::std::ostream & woss::Location::operator<< ( ::std::ostream &  os,
const Location instance 
)
inline

<< operator

Parameters
osleft operand ostream reference
instanceright operand const Location reference
Returns
os reference after the operation

References curr_coordz, woss::CoordZ::getDepth(), woss::Coord::getLatitude(), and woss::Coord::getLongitude().

Here is the call graph for this function:

◆ setDepth()

void Location::setDepth ( double  depth)
virtual

Sets initial depth

Parameters
latvalid depth [m]

Reimplemented in WossPosition.

References curr_coordz, and woss::CoordZ::setDepth().

Referenced by WossPosition::setDepth().

Here is the call graph for this function:

◆ setHorizontalOrientation()

void Location::setHorizontalOrientation ( double  angle)
virtual

Gets current horizontal orientation from reference line (0 degrees = parallel to direction of current movement ) positive values are counter-clockwise rotations, while negative ones are clockwise rotations

Parameters
angledelta angle [dec degrees]

References horizontal_orientation.

◆ setLatitude()

void Location::setLatitude ( double  lat)
virtual

Sets initial latitude

Parameters
latvalid latitude [decimal degrees]

Reimplemented in WossPosition.

References curr_coordz, and woss::Coord::setLatitude().

Referenced by WossPosition::setLatitude().

Here is the call graph for this function:

◆ setLocation()

void Location::setLocation ( const CoordZ coordz)
virtual

Sets initial coordinates

Parameters
coordzvalid woss::CoordZ

References curr_coordz.

◆ setLongitude()

void Location::setLongitude ( double  lon)
virtual

Sets initial longitude

Parameters
latvalid longitude [decimal degrees]

Reimplemented in WossPosition.

References curr_coordz, and woss::Coord::setLongitude().

Referenced by WossPosition::setLongitude().

Here is the call graph for this function:

◆ setVerticalOrientation()

void Location::setVerticalOrientation ( double  angle)
virtual

Sets current vertical orientation from reference line (0 degrees = parallel to sea surface / bottom ). Negative values are towards the surface, while positive ones are towards sea bottom

Parameters
angledelta angle [dec degrees]

References vertical_orientation.

Member Data Documentation

◆ bearing

double woss::Location::bearing
protected

current bearing

Referenced by getBearing(), and WossWpPosition::getBearing().

◆ comparison_distance

double woss::Location::comparison_distance
protected

Comparison distance [m]

Referenced by isEquivalentTo(), and WossWpPosition::isEquivalentTo().

◆ curr_coordz

CoordZ woss::Location::curr_coordz
protected

◆ horizontal_orientation

double woss::Location::horizontal_orientation
protected

current horizontal orientation. It's the delta angle from reference direction (0 degrees = parallel to movement's direction )

Referenced by getHorizontalOrientation(), and setHorizontalOrientation().

◆ vertical_orientation

double woss::Location::vertical_orientation
protected

current vertical orientation. It's the delta angle from reference direction (0 degrees = parallel to sea surface / bottom )

Referenced by getVerticalOrientation(), WossWpPosition::getVerticalOrientation(), and setVerticalOrientation().


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