예제 #1
0
int OGRDB2GeometryValidator::ValidateGeometry(OGRGeometry* poGeom)
{
    if (!poGeom)
        return FALSE;

    switch (poGeom->getGeometryType())
    {
    case wkbPoint:
    case wkbPoint25D:
        return ValidatePoint((OGRPoint*)poGeom);
    case wkbLineString:
    case wkbLineString25D:
        return ValidateLineString((OGRLineString*)poGeom);
    case wkbPolygon:
    case wkbPolygon25D:
        return ValidatePolygon((OGRPolygon*)poGeom);
    case wkbMultiPoint:
    case wkbMultiPoint25D:
        return ValidateMultiPoint((OGRMultiPoint*)poGeom);
    case wkbMultiLineString:
    case wkbMultiLineString25D:
        return ValidateMultiLineString((OGRMultiLineString*)poGeom);
    case wkbMultiPolygon:
    case wkbMultiPolygon25D:
        return ValidateMultiPolygon((OGRMultiPolygon*)poGeom);
    case wkbGeometryCollection:
    case wkbGeometryCollection25D:
        return ValidateGeometryCollection((OGRGeometryCollection*)poGeom);
    case wkbLinearRing:
        return ValidateLinearRing((OGRLinearRing*)poGeom);
    default:
        return FALSE;
    }
}
void AsdkAcUiDialogSample::OnOK() 
{
    if (!ValidatePoint()) {
        AfxMessageBox("Sorry, Point out of desired range. Try again or Cancel");
        m_ctrlXPtEdit.SetFocus();
        return;
    } 
    
    if (!ValidateAngle()) {
        AfxMessageBox("Sorry, Angle out of desired range. Try again or Cancel");
        m_ctrlAngleEdit.SetFocus();
        return;
    }

    CAcUiDialog::OnOK();

    // Store the data into the registry
    SetDialogData("ANGLE", m_strAngle);
    SetDialogData("POINTX", m_strXPt);
    SetDialogData("POINTY", m_strYPt);
    SetDialogData("POINTZ", m_strZPt);

}