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. More...
 
 Point (const Point &right)
 Copy Constructor. More...
 
 ~Point ()
 destructor More...
 
Pointoperator= (const Point &rhs)
 assignment operator More...
 
void setUserProj (const std::vector< std::string > &projArgs)
 set user projection information More...
 
bool isUserProjLatLong () const
 return true if user projection is a lat/lon system More...
 
virtual void setXY (const std::vector< double > &mPosition)
 set mercator projection (XY) position More...
 
virtual const std::vector< double > & getXY ()
 get mercator projection (XY) position More...
 
virtual const std::vector< double > & getUserCoords ()
 get user position More...
 
virtual void setUserCoords (const std::vector< double > &uPosition)
 set user position More...
 
virtual PointClone ()
 Clone Self. More...
 

Private Member Functions

void mercToUser ()
 
void userToMerc ()
 

Private Attributes

std::vector< double > theMerc
 
bool mercDirty
 
std::vector< double > theUserCoords
 
bool userDirty
 
projPJ userProj
 
projPJ mercProj
 

Constructor & Destructor Documentation

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.

Here is the caller graph for this function:

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

Copy Constructor.

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

destructor

Reimplemented from DFLib::Abstract::Point.

Member Function Documentation

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 call graph for this function:

Here is the caller graph for this function:

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:

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:

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

return true if user projection is a lat/lon system

Primarily useful for deciding how to display coordinates (as for example whether to display them in sexigesimal or decimal representation)

void DFLib::Proj::Point::mercToUser ( )
private

Here is the caller graph for this function:

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

assignment operator

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.

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:

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:

void DFLib::Proj::Point::userToMerc ( )
private

Here is the caller graph for this function:

Member Data Documentation

bool DFLib::Proj::Point::mercDirty
private
projPJ DFLib::Proj::Point::mercProj
private
std::vector<double> DFLib::Proj::Point::theMerc
private
std::vector<double> DFLib::Proj::Point::theUserCoords
private
bool DFLib::Proj::Point::userDirty
private
projPJ DFLib::Proj::Point::userProj
private

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