CreateMathTransform Constructor

WRAPPER_API static MathTransform *CreateMathTransform(ClassType classType)

 

Description

The CreateMathTransform constructor creates a new instance of the MathTransform class.  It takes a single argument, which specifies the type of the MathTransform, according to the ClassType enumeration.

 

Example

void MathTransform_CreateMathTransform(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;

}