Ejemplo n.º 1
0
 uint32_t setGcpPoints(DataElement* pList, uint32_t count, struct Gcp* pPoints)
 {
    GcpList* pGcpList = dynamic_cast<GcpList*>(pList);
    if (pGcpList == NULL || (count > 0 && pPoints == NULL))
    {
       setLastError(SIMPLE_BAD_PARAMS);
       return 0;
    }
    pGcpList->clearPoints();
    if (count == 0)
    {
       setLastError(SIMPLE_NO_ERROR);
       return 0;
    }
    std::list<GcpPoint> points;
    for (uint32_t index = 0; index < count; ++index)
    {
       GcpPoint point;
       memcpy(&point, &pPoints[index], sizeof(struct Gcp));
       points.push_back(point);
    }
    pGcpList->addPoints(points);
    setLastError(SIMPLE_NO_ERROR);
    return pGcpList->getCount();
 }
Ejemplo n.º 2
0
 uint32_t getGcpCount(DataElement* pList)
 {
    GcpList* pGcpList = dynamic_cast<GcpList*>(pList);
    if (pGcpList == NULL)
    {
       setLastError(SIMPLE_BAD_PARAMS);
       return 0;
    }
    setLastError(SIMPLE_NO_ERROR);
    return pGcpList->getCount();
 }
Ejemplo n.º 3
0
 struct Gcp getGcpPoint(DataElement* pList, uint32_t index)
 {
    GcpList* pGcpList = dynamic_cast<GcpList*>(pList);
    if (pGcpList == NULL || index >= static_cast<uint32_t>(pGcpList->getCount()))
    {
       setLastError(SIMPLE_BAD_PARAMS);
       return Gcp();
    }
    const std::list<GcpPoint>& points = pGcpList->getSelectedPoints();
    std::list<GcpPoint>::const_iterator point = points.begin();
    while (index-- > 0) ++point;
    struct Gcp rval;
    memcpy(&rval, &*point, sizeof(struct Gcp));
    setLastError(SIMPLE_NO_ERROR);
    return rval;
 }