AddPointList Method

WRAPPER_API long AddPointList(const CoordPointCollection &sourceList, const CoordPointCollection &targetList)

 

Description

The AddPointList method adds a set of control points and a set of observed points to the list of points that will be used to Solve this MathTransform.  In order to Solve, there must be at least three pairs of linearly independent control and observed points.  This method takes two arguments, the first of which is the collection of control points or source points, and the second of which is the collection of observed points or target points.  The method returns an integer value giving the number of control and observed point pairs that were added to the collection.

 

Example

void MathTransform_AddPointList(GEOCALCPBW_NAMESPACE::CoordPointCollection & controlCPC, GEOCALCPBW_NAMESPACE::CoordPointCollection & observedCPC)

{

GEOCALCPBW_NAMESPACE::MathTransform::ClassType mtType = GEOCALCPBW_NAMESPACE::MathTransform::ClassType::SecondOrderPolynomial;

GEOCALCPBW_NAMESPACE::MathTransform * mt = GEOCALCPBW_NAMESPACE::MathTransform::CreateMathTransform(mtType);

if(mt->AddPointList(controlCPC, observedCPC) < controlCPC.get_Count())

{

AfxMessageBox("MathTransform::AddPointList : Not all points could be added");

}

try

{

if(! mt->Solve())

{

AfxMessageBox("Solve failed");

}

}

catch(GEOCALCPBW_NAMESPACE::GeoCalcException & ex)

{

if(ex.get_ErrorCode() == GEOCALCPBW_NAMESPACE::GeoCalcException::Code::InsufficientPoints)

{

AfxMessageBox("Insufficent points to Solve the MathTransform");

}

else

{

AfxMessageBox(_tochar(ex.get_FullMessage()).c_str());

}

}

delete mt;

}