Exemplo n.º 1
0
// See if there's any overlap between the two MBRs
bool trpgMBR::Overlap(const trpg2dPoint &ill, const trpg2dPoint &iur) const
{
    if (!isValid()) return false;

    trpg2dPoint ilr = trpg2dPoint(iur.x,ill.y);
    trpg2dPoint iul = trpg2dPoint(ill.x,iur.y);

    // B MBR falls within A
    if (Within(ill) || Within(iur) || Within(ilr) || Within(iul))
        return true;

    // A MBR falls within B
    if ((inRange(ill.x,iur.x,ll.x) && inRange(ill.y,iur.y,ll.y)) ||
        (inRange(ill.x,iur.x,ur.x) && inRange(ill.y,iur.y,ll.y)) ||
        (inRange(ill.x,iur.x,ur.x) && inRange(ill.y,iur.y,ur.y)) ||
        (inRange(ill.x,iur.x,ll.x) && inRange(ill.y,iur.y,ur.y)))
        return true;

    if ((inRange(ll.x,ur.x,ill.x) && ill.y < ll.y && iur.y > ur.y) ||
        (inRange(ll.y,ur.y,ill.y) && ill.x < ll.x && iur.x > ur.x))
        return true;

    return false;
}
Exemplo n.º 2
0
// Reset contents
void trpgHeader::Reset()
{
    // Initialize to a default state
    verMinor = TRPG_VERSION_MINOR;
    verMajor = TRPG_VERSION_MAJOR;
    dbVerMinor = 0;
    dbVerMajor = 0;
    origin = trpg3dPoint(0,0,0);
    sw = ne = trpg2dPoint(0,0);
    tileType = DatabaseLocal;

    numLods = 0;
    lodSizes.resize(0);
    lodRanges.resize(0);
    tileSize.resize(0);
    maxGroupID = -1;
    flags = 0;
    errMess[0] = '\0';
    cols = -1;
    rows = -1;
}