DFLib Release 1.0.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DFLib::Proj::Point Class Reference

#include <DF_Proj_Point.hpp>

Inheritance diagram for DFLib::Proj::Point:
Inheritance graph
[legend]
Collaboration diagram for DFLib::Proj::Point:
Collaboration graph
[legend]

Public Member Functions

 Point (const std::vector< double > &uPosition, const std::vector< std::string > &projArgs)
 Constructor.
 
 Point (const Point &right)
 Copy Constructor.
 
 ~Point ()
 destructor
 
Pointoperator= (const Point &rhs)
 assignment operator
 
void setUserProj (const std::vector< std::string > &projArgs)
 set user projection information
 
bool isUserProjRadians () const
 return true if user projection expects input in radians
 
virtual void setXY (const std::vector< double > &mPosition)
 set mercator projection (XY) position
 
virtual const std::vector< double > & getXY ()
 get mercator projection (XY) position
 
virtual const std::vector< double > & getUserCoords ()
 get user position
 
virtual void setUserCoords (const std::vector< double > &uPosition)
 set user position
 
virtual PointClone ()
 Clone Self.
 
virtual ~Point ()
 virtual destructor because there should always be one
 
virtual void setXY (const std::vector< double > &aPosition)=0
 Set X-Y coordinates of the point.
 
virtual const std::vector< double > & getXY ()=0
 Get X-Y coordinates of the point.
 
virtual const std::vector< double > & getUserCoords ()=0
 Get coordinates in the user's coordinate system.
 
virtual void setUserCoords (const std::vector< double > &uPosition)=0
 Set coordinates in the user's coordinate system.
 
virtual PointClone ()=0
 Clone Self.
 

Private Member Functions

void mercToUser ()
 
void userToMerc ()
 

Private Attributes

std::vector< double > theMerc
 
bool mercDirty
 
std::vector< double > theUserCoords
 
bool userDirty
 
PJ * convertPJ
 

Constructor & Destructor Documentation

◆ Point() [1/2]

DFLib::Proj::Point::Point ( const std::vector< double > &  uPosition,
const std::vector< std::string > &  projArgs 
)

Constructor.

Parameters
uPositioncoordinates in user's coordinates
projArgsa vector of strings representing the Proj.4 description of the user's coordinate system.

◆ Point() [2/2]

DFLib::Proj::Point::Point ( const Point right)

Copy Constructor.

◆ ~Point()

DFLib::Proj::Point::~Point ( )
virtual

destructor

Reimplemented from DFLib::Abstract::Point.

Member Function Documentation

◆ Clone()

Point * DFLib::Proj::Point::Clone ( )
virtual

Clone Self.

Make a copy of yourself, and return a pointer to the copy. This is useful as a prototype: pass a pointer to any concrete implementation to a function, and that function has a way of making other objects of precisely the same type by cloning.

Returns
pointer to

Implements DFLib::Abstract::Point.

Here is the caller graph for this function:

◆ getUserCoords()

const std::vector< double > & DFLib::Proj::Point::getUserCoords ( )
virtual

get user position

Returns
a vector<double> containing the coordinates of this point in the user's coordinate system.

This method works by converting the mercator coordinates of the point back to the user's coordinate system using the Proj.4 cartographic projection library if the mercator coordinates or user projection have changed since the last call.

Implements DFLib::Abstract::Point.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getXY()

const std::vector< double > & DFLib::Proj::Point::getXY ( )
virtual

get mercator projection (XY) position

Returns
vector of coordinates in mercator projection

Implements DFLib::Abstract::Point.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isUserProjRadians()

bool DFLib::Proj::Point::isUserProjRadians ( ) const

return true if user projection expects input in radians

Here is the caller graph for this function:

◆ mercToUser()

void DFLib::Proj::Point::mercToUser ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

Point & DFLib::Proj::Point::operator= ( const Point rhs)

assignment operator

◆ setUserCoords()

void DFLib::Proj::Point::setUserCoords ( const std::vector< double > &  uPosition)
virtual

set user position

Sets the coordinates of the point in user's coordinate system, marking the mercator coordinates invalid. Mercator coordinates will be updated by conversion with Proj.4 upon the next call to getXY().

Parameters
uPositionvector of doubles with user coordinates.

Implements DFLib::Abstract::Point.

◆ setUserProj()

void DFLib::Proj::Point::setUserProj ( const std::vector< std::string > &  projArgs)

set user projection information

Parameters
projArgsvector of strings representing the new projection

This method can be used to change the coordinate system of a point. When called, the Mercator representation of the point is updated, then the user projection is changed. The next call to getUserCoords will therefore return the point's coordinates in the new coordinate system.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setXY()

void DFLib::Proj::Point::setXY ( const std::vector< double > &  mPosition)
virtual

set mercator projection (XY) position

Parameters
aPositioncoordinates in mercator projection

Implements DFLib::Abstract::Point.

Here is the caller graph for this function:

◆ userToMerc()

void DFLib::Proj::Point::userToMerc ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ convertPJ

PJ* DFLib::Proj::Point::convertPJ
private

◆ mercDirty

bool DFLib::Proj::Point::mercDirty
private

◆ theMerc

std::vector<double> DFLib::Proj::Point::theMerc
private

◆ theUserCoords

std::vector<double> DFLib::Proj::Point::theUserCoords
private

◆ userDirty

bool DFLib::Proj::Point::userDirty
private

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