AddFront Method

WRAPPER_API DatumShift *AddFront(DatumShift::ClassType classType)

WRAPPER_API DatumShift *AddFront(const DatumShift &value)

 

Description

The AddFront method adds a DatumShift to the first position of this collection.  There are two signatures for this method.  The first signature takes a member of the DatumShift::ClassType enumeration as argument and adds a new DatumShift of this type to the collection.  The second signature takes a DatumShift as argument and adds it to the collection.  This method returns a pointer to the DatumShift just added to the collection.  It is the user's responsibility to free the returned DatumShift.

 

Example

void DatumShiftCollection_AddFront(GeoCalcPBW::DataSource & data)

{

GeoCalcPBW::DatumShiftCollection dsc;

GeoCalcPBW::DatumShift * ds = data.GetDatumShift(L"BMG", L"NAD27_to_WGS84");

dsc.AddFront(*ds);

delete ds;

ds = data.GetDatumShift(L"BMG", L"NAD83_to_WGS84");

ds->set_ReverseUsage(true);

dsc.AddBack(*ds);

delete ds;

GeoCalcPBW::GeodeticPoint sourcePt;

sourcePt.set_InUnits(-75.667, 45.031);

GeoCalcPBW::GeodeticPoint targetPt;

if(! dsc.ShiftForward(sourcePt, targetPt))

{

AfxMessageBox("ShiftForward failed");

}

}