Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Ilwis::Location< CrdType, useDouble > Class Template Reference

#include <location.h>

Public Member Functions

 Location ()
 
 Location (CrdType d1, CrdType d2, CrdType d3=Location::undefined())
 
template<typename U >
 Location (const Location< U > &p)
 
 Location (const Location< CrdType > &p)
 
 Location (Location< CrdType > &&crd)
 
 Location (const std::vector< CrdType > &v)
 
bool isValid () const
 
bool is0 () const
 
bool is3D () const
 
 operator std::vector< CrdType > ()
 
Ilwis::Location< CrdType > & operator= (const Ilwis::Location< CrdType > &p2)
 
Ilwis::Location< CrdType > & operator= (const Ilwis::Location< CrdType > &&p2)
 
Location< CrdType > & operator+= (const std::vector< CrdType > &vec)
 
Location< CrdType > & operator-= (const std::vector< CrdType > &vec)
 
double distance (const Location< CrdType > &crd)
 
Location< CrdType > & operator*= (const std::vector< CrdType > &vec)
 
Location< CrdType > & operator*= (CrdType v)
 
Location< CrdType > & operator/= (CrdType v)
 
bool operator== (const Location< CrdType > &pnt) const
 
bool operator!= (const Location< CrdType > &pnt)
 

Static Public Member Functions

static double undefined ()
 
static quint64 valuetype ()
 

Public Attributes

CrdType x
 
CrdType y
 
CrdType z
 

Detailed Description

template<class CrdType = qint32, bool useDouble = false>
class Ilwis::Location< CrdType, useDouble >

A point in 2D space. It is a derivative of the Point class. As the base class already offer the x,y components no *further implementation of these is needed. The class mostely implements special operations on 2D points

Constructor & Destructor Documentation

template<class CrdType = qint32, bool useDouble = false>
Ilwis::Location< CrdType, useDouble >::Location ( )
inline

default constructor

template<class CrdType = qint32, bool useDouble = false>
Ilwis::Location< CrdType, useDouble >::Location ( CrdType  d1,
CrdType  d2,
CrdType  d3 = Location< CrdType, useDouble >::undefined() 
)
inline

constructs a 2D point from 2 values. The values must not be undefined() else the point remains not valid

Parameters
d1first value
d2second value

Member Function Documentation

template<class CrdType = qint32, bool useDouble = false>
bool Ilwis::Location< CrdType, useDouble >::isValid ( ) const
inline

a point is valid if both its x and y have a valid value;

Returns
template<class CrdType = qint32, bool useDouble = false>
bool Ilwis::Location< CrdType, useDouble >::operator!= ( const Location< CrdType > &  pnt)
inline

compares the coordinates of 2 points to see if they are not equal. comparision with non valid points always leads to true

Parameters
pnt,pointto be compared
Returns
true if the points are not at the same location.
template<class CrdType = qint32, bool useDouble = false>
Location<CrdType>& Ilwis::Location< CrdType, useDouble >::operator*= ( const std::vector< CrdType > &  vec)
inline

operator *= multiplies a point with a factor contained in the vector, shifting it in 2D space. Using undefined() values in the vector may lead to unpredictable results

Parameters
avector with a pair of values
Returns
a reference to a shifted 2D point
template<class CrdType = qint32, bool useDouble = false>
Location<CrdType>& Ilwis::Location< CrdType, useDouble >::operator*= ( CrdType  v)
inline

operator *= multipliesthe x,y values with a single factor , shifting it in 2D space. Using undefined() values may lead to unpredictable results

Parameters
multiplier
Returns
a reference to a shifted 2D point
template<class CrdType = qint32, bool useDouble = false>
Location<CrdType>& Ilwis::Location< CrdType, useDouble >::operator+= ( const std::vector< CrdType > &  vec)
inline

operator += addes a vector of 2 values to a point shifting it in 2D space. Using undefined() values in the vector may lead to unpredictable results

Parameters
avector with a pair of values
Returns
a reference to a shifted 2D point
template<class CrdType = qint32, bool useDouble = false>
Location<CrdType>& Ilwis::Location< CrdType, useDouble >::operator/= ( CrdType  v)
inline

operator /= divides the coordinates of a point with a fixed value. The value must not be zero. If it is zero nothing happens Using undefined() values may lead to unpredictable results

Parameters
v
Returns
template<class CrdType = qint32, bool useDouble = false>
bool Ilwis::Location< CrdType, useDouble >::operator== ( const Location< CrdType > &  pnt) const
inline

compares the coordinates of 2 points to see if they are equal. comparision with non valid points always leads to false

Parameters
pnt,pointto be compared
Returns
true if the points are at the same location.

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