CCGridDirect Method

WRAPPER_API bool CCGridDirect(const GeodeticPoint &refPoint, const BmgChar *locationString, GeodeticPoint &contactPoint) const;

 

Description

The CCGridDirect method calculates the coordinates of the point whose position is described relative to a reference point.  The method accepts three arguments, the first of which is the reference point.  The second argument is a string that uses the Cartesian Coordinate Grid (CCG) system to describe the location of the desired point relative to the reference point.  The location of the calculated point is stored in the third argument, and the method returns a boolean value indicating if the operation was successful.

If a three-dimensional GeodeticPoint is used, this method will ignore the Height coordinate on the input point.  The Height of the point will be assumed to be 0, so that the calculations occur on the surface of the Ellipsoid.  The Height of the output point will be equal to the Height of the input point.

 

Example

void Ellipsoid_CCGridDirect(GEOCALCPBW_NAMESPACE::DataSource & dataSource)

{

GEOCALCPBW_NAMESPACE::Ellipsoid * ell = dataSource.GetEllipsoid(L"BMG", L"WGS84");

GEOCALCPBW_NAMESPACE::GeodeticPoint * refPt = dataSource.GetGeodeticPoint(L"BMG", L"GEODETIC_POINT_DEGREES");

GEOCALCPBW_NAMESPACE::GeodeticPoint * contactPt = dataSource.GetGeodeticPoint(L"BMG", L"GEODETIC_POINT_DEGREES");

BmgChar * ccgString = L"R040/000";

refPt->set_InUnits(-94, 48);

 

if(! ell->CCGridDirect(*refPt, ccgString, *contactPt))

{

AfxMessageBox("CCGridDirect failed");

}

}