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)
 
 Location (const Location &copy)=default
 
 Location (Location &&tmp)=default
 
virtual ~Location ()=default
 
Locationoperator= (const Location &copy)=default
 
Locationoperator= (Location &&tmp)=default
 
virtual std::unique_ptr< Locationcreate (double latitude, double longitude, double depth=0, double dist=LOCATION_COMPARISON_DISTANCE) const
 
virtual std::unique_ptr< Locationcreate (const CoordZ &coordz=CoordZ(), double dist=LOCATION_COMPARISON_DISTANCE) const
 
virtual std::unique_ptr< 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 ()
 

Protected Attributes

double comparison_distance
 
CoordZ curr_coordz
 
double vertical_orientation
 
double horizontal_orientation
 
double bearing
 

Friends

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

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/4]

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

Location default constructor

Parameters
coordzcoordinates
distdistance comparison precision [m]

◆ Location() [2/4]

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() [3/4]

woss::Location::Location ( const Location copy)
default

◆ Location() [4/4]

woss::Location::Location ( Location &&  tmp)
default

◆ ~Location()

virtual woss::Location::~Location ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr< Location > woss::Location::clone ( ) const
inlinevirtual

Location virtual factory method

Returns
a std::unique_ptr to heap-allocated copy of this instance

Reimplemented in WossPosition.

◆ create() [1/2]

virtual std::unique_ptr< 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 std::unique_ptr to heap-allocated Location object

Reimplemented in WossPosition.

◆ create() [2/2]

virtual std::unique_ptr< 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 std::unique_ptr to 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::getAltitude(), and 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()

◆ 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=() [1/2]

Location & woss::Location::operator= ( const Location copy)
default

◆ operator=() [2/2]

Location & woss::Location::operator= ( Location &&  tmp)
default

◆ 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::setAltitude(), and 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.

Referenced by WossWpPosition::command(), and WossWpPosition::update().

◆ 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.

Friends And Related Symbol Documentation

◆ operator<<

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

<< operator

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

Member Data Documentation

◆ bearing

double woss::Location::bearing
protected

◆ comparison_distance

double woss::Location::comparison_distance
protected

◆ 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(), setVerticalOrientation(), WossWpPosition::updateVerticalOrientation(), WossPosition::WossPosition(), and WossPosition::WossPosition().


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