亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mitab_mapobjectblock.cpp

?? mitab,讀取MapInfo的地圖文件
?? CPP
?? 第 1 頁 / 共 5 頁
字號(hào):
    return 0;
}

/**********************************************************************
 *                   TABMAPObjectBlock::ReadCoord()
 *
 * Read the next pair of integer coordinates value from the block, and
 * apply the translation relative to to the center of the data block
 * if bCompressed=TRUE.
 *
 * This means that the returned coordinates are always absolute integer
 * coordinates, even when the source coords are in compressed form.
 *
 * Returns 0 if succesful or -1 if an error happened, in which case 
 * CPLError() will have been called.
 **********************************************************************/
int     TABMAPObjectBlock::ReadIntCoord(GBool bCompressed, 
                                        GInt32 &nX, GInt32 &nY)
{
    if (bCompressed)
    {   
        nX = m_nCenterX + ReadInt16();
        nY = m_nCenterY + ReadInt16();
    }
    else
    {
        nX = ReadInt32();
        nY = ReadInt32();
    }

    if (CPLGetLastErrorNo() != 0)
        return -1;

    return 0;
}

/**********************************************************************
 *                   TABMAPObjectBlock::WriteIntCoord()
 *
 * Write a pair of integer coordinates values to the current position in the
 * the block.  If bCompr=TRUE then the coordinates are written relative to
 * the object block center... otherwise they're written as 32 bits int.
 *
 * This function does not maintain the block's MBR and center... it is 
 * assumed to have been set before the first call to WriteIntCoord()
 *
 * Returns 0 if succesful or -1 if an error happened, in which case 
 * CPLError() will have been called.
 **********************************************************************/
int     TABMAPObjectBlock::WriteIntCoord(GInt32 nX, GInt32 nY,
                                         GBool bCompressed /*=FALSE*/)
{

    /*-----------------------------------------------------------------
     * Write coords to the file.
     *----------------------------------------------------------------*/
    if ((!bCompressed && (WriteInt32(nX) != 0 || WriteInt32(nY) != 0 ) ) ||
        (bCompressed && (WriteInt16(nX - m_nCenterX) != 0 ||
                         WriteInt16(nY - m_nCenterY) != 0) ) )
    {
        return -1;
    }

    return 0;
}

/**********************************************************************
 *                   TABMAPObjectBlock::WriteIntMBRCoord()
 *
 * Write 2 pairs of integer coordinates values to the current position 
 * in the the block after making sure that min values are smaller than
 * max values.  Use this function to write MBR coordinates for an object.
 *
 * If bCompr=TRUE then the coordinates are written relative to
 * the object block center... otherwise they're written as 32 bits int.
 *
 * This function does not maintain the block's MBR and center... it is 
 * assumed to have been set before the first call to WriteIntCoord()
 *
 * Returns 0 if succesful or -1 if an error happened, in which case 
 * CPLError() will have been called.
 **********************************************************************/
int     TABMAPObjectBlock::WriteIntMBRCoord(GInt32 nXMin, GInt32 nYMin,
                                            GInt32 nXMax, GInt32 nYMax,
                                            GBool bCompressed /*=FALSE*/)
{
    if (WriteIntCoord(MIN(nXMin, nXMax), MIN(nYMin, nYMax),
                      bCompressed) != 0 ||
        WriteIntCoord(MAX(nXMin, nXMax), MAX(nYMin, nYMax), 
                      bCompressed) != 0 )
    {
        return -1;
    }

    return 0;
}


/**********************************************************************
 *                   TABMAPObjectBlock::UpdateMBR()
 *
 * Update the block's MBR and center.
 *
 * Returns 0 if succesful or -1 if an error happened, in which case 
 * CPLError() will have been called.
 **********************************************************************/
int     TABMAPObjectBlock::UpdateMBR(GInt32 nX, GInt32 nY)
{

    if (nX < m_nMinX)
        m_nMinX = nX;
    if (nX > m_nMaxX)
        m_nMaxX = nX;

    if (nY < m_nMinY)
        m_nMinY = nY;
    if (nY > m_nMaxY)
        m_nMaxY = nY;
    
    m_nCenterX = (m_nMinX + m_nMaxX) /2;
    m_nCenterY = (m_nMinY + m_nMaxY) /2;
    
    return 0;
}

/**********************************************************************
 *                   TABMAPObjectBlock::AddCoordBlockRef()
 *
 * Update the first/last coord block fields in this object to contain
 * the specified block address.
 **********************************************************************/
void     TABMAPObjectBlock::AddCoordBlockRef(GInt32 nNewBlockAddress)
{
    /*-----------------------------------------------------------------
     * Normally, new blocks are added to the end of the list, except
     * the first one which is the beginning and the end of the list at 
     * the same time.
     *----------------------------------------------------------------*/
    if (m_nFirstCoordBlock == 0)
        m_nFirstCoordBlock = nNewBlockAddress;

    m_nLastCoordBlock = nNewBlockAddress;
}

/**********************************************************************
 *                   TABMAPObjectBlock::SetMBR()
 *
 * Set the MBR for the current block.
 **********************************************************************/
void TABMAPObjectBlock::SetMBR(GInt32 nXMin, GInt32 nYMin, 
                               GInt32 nXMax, GInt32 nYMax)
{
    m_nMinX = nXMin;
    m_nMinY = nYMin;
    m_nMaxX = nXMax;
    m_nMaxY = nYMax; 

    m_nCenterX = (m_nMinX + m_nMaxX) /2;
    m_nCenterY = (m_nMinY + m_nMaxY) /2;
}

/**********************************************************************
 *                   TABMAPObjectBlock::GetMBR()
 *
 * Return the MBR for the current block.
 **********************************************************************/
void TABMAPObjectBlock::GetMBR(GInt32 &nXMin, GInt32 &nYMin, 
                               GInt32 &nXMax, GInt32 &nYMax)
{
    nXMin = m_nMinX;
    nYMin = m_nMinY;
    nXMax = m_nMaxX;
    nYMax = m_nMaxY; 
}


/**********************************************************************
 *                   TABMAPObjectBlock::PrepareNewObject()
 *
 * Prepare this block to receive this new object. We only reserve space for
 * it in this call. Actual data will be written only when CommitNewObject()
 * is called.
 *
 * Returns the position at which the new object starts
 **********************************************************************/
int     TABMAPObjectBlock::PrepareNewObject(TABMAPObjHdr *poObjHdr)
{
    int nStartAddress = 0;

    // Nothing to do for NONE objects
    if (poObjHdr->m_nType == TAB_GEOM_NONE)
    {
        return 0;
    }

    // Maintain MBR of this object block.
    UpdateMBR(poObjHdr->m_nMinX, poObjHdr->m_nMinY);
    UpdateMBR(poObjHdr->m_nMaxX, poObjHdr->m_nMaxY);
   
    /*-----------------------------------------------------------------
     * Keep track of object type, ID and start address for use by
     * CommitNewObject()
     *----------------------------------------------------------------*/
    nStartAddress = GetFirstUnusedByteOffset();
    GotoByteInFile(nStartAddress);
    m_nCurObjectOffset = nStartAddress - GetStartAddress();

    m_nCurObjectType = poObjHdr->m_nType;
    m_nCurObjectId   = poObjHdr->m_nId;

    return nStartAddress;
}

/**********************************************************************
 *                   TABMAPObjectBlock::CommitCurObjData()
 *
 * Write the ObjHdr to this block. This is usually called after 
 * PrepareNewObject() once all members of the ObjHdr have
 * been set.
 *
 * Returns 0 if succesful or -1 if an error happened, in which case 
 * CPLError() will have been called.
 **********************************************************************/
int     TABMAPObjectBlock::CommitNewObject(TABMAPObjHdr *poObjHdr)
{
    int nStatus = 0;

    // Nothing to do for NONE objects
    if (poObjHdr->m_nType == TAB_GEOM_NONE)
    {
        return 0;
    }

    CPLAssert(m_nCurObjectId == poObjHdr->m_nId);
    GotoByteInBlock(m_nCurObjectOffset);

    nStatus = poObjHdr->WriteObj(this);

    if (nStatus == 0)
        m_numDataBytes = m_nSizeUsed - MAP_OBJECT_HEADER_SIZE;

    return nStatus;
}

/**********************************************************************
 *                   TABMAPObjectBlock::Dump()
 *
 * Dump block contents... available only in DEBUG mode.
 **********************************************************************/
#ifdef DEBUG

void TABMAPObjectBlock::Dump(FILE *fpOut, GBool bDetails)
{
    CPLErrorReset();

    if (fpOut == NULL)
        fpOut = stdout;

    fprintf(fpOut, "----- TABMAPObjectBlock::Dump() -----\n");
    if (m_pabyBuf == NULL)
    {
        fprintf(fpOut, "Block has not been initialized yet.");
    }
    else
    {
        fprintf(fpOut,"Object Data Block (type %d) at offset %d.\n", 
                                                m_nBlockType, m_nFileOffset);
        fprintf(fpOut,"  m_numDataBytes        = %d\n", m_numDataBytes);
        fprintf(fpOut,"  m_nCenterX            = %d\n", m_nCenterX);
        fprintf(fpOut,"  m_nCenterY            = %d\n", m_nCenterY);
        fprintf(fpOut,"  m_nFirstCoordBlock    = %d\n", m_nFirstCoordBlock);
        fprintf(fpOut,"  m_nLastCoordBlock     = %d\n", m_nLastCoordBlock);
    }

    if (bDetails)
    {
        /* We need the mapfile's header block */
        TABRawBinBlock *poBlock;
        TABMAPHeaderBlock *poHeader;
        TABMAPObjHdr *poObjHdr;

        poBlock = TABCreateMAPBlockFromFile(m_fp, 0, 512);
        if (poBlock==NULL || poBlock->GetBlockClass() != TABMAP_HEADER_BLOCK)
        {
            CPLError(CE_Failure, CPLE_AssertionFailed, 
                     "Failed reading header block.");
            return;
        }
        poHeader = (TABMAPHeaderBlock *)poBlock;

        Rewind();
        while((poObjHdr = TABMAPObjHdr::ReadNextObj(this, poHeader)) != NULL)
        {
            fprintf(fpOut, 
                    "   object id=%d, type=%d, offset=%d (%d), size=%d\n"
                    "          MBR=(%d, %d, %d, %d)\n",
                    m_nCurObjectId, m_nCurObjectType, m_nCurObjectOffset,
                    m_nFileOffset + m_nCurObjectOffset,
                    poHeader->GetMapObjectSize( m_nCurObjectType ),
                    poObjHdr->m_nMinX, poObjHdr->m_nMinY,
                    poObjHdr->m_nMaxX,poObjHdr->m_nMaxY);
            delete poObjHdr;
        }

        delete poHeader;
    }

    fflush(fpOut);
}

#endif // DEBUG



/*=====================================================================
 *                      class TABMAPObjHdr and family
 *====================================================================*/

/**********************************************************************
 *                   class TABMAPObjHdr
 *
 * Virtual base class... contains static methods used to allocate instance
 * of the derived classes.
 *
 **********************************************************************/


/**********************************************************************
 *                    TABMAPObjHdr::NewObj()
 *
 * Alloc a new object of specified type or NULL for NONE types or if type 
 * is not supported.
 **********************************************************************/
TABMAPObjHdr *TABMAPObjHdr::NewObj(GByte nNewObjType, GInt32 nId /*=0*/)
{
    TABMAPObjHdr *poObj = NULL;

    switch(nNewObjType)
    {
      case TAB_GEOM_NONE:
        poObj = new TABMAPObjNone;
        break;
      case TAB_GEOM_SYMBOL_C:
      case TAB_GEOM_SYMBOL:
        poObj = new TABMAPObjPoint;
        break;
      case TAB_GEOM_FONTSYMBOL_C:
      case TAB_GEOM_FONTSYMBOL:
        poObj = new TABMAPObjFontPoint;
        break;
      case TAB_GEOM_CUSTOMSYMBOL_C:
      case TAB_GEOM_CUSTOMSYMBOL:
        poObj = new TABMAPObjCustomPoint;
        break;
      case TAB_GEOM_LINE_C:
      case TAB_GEOM_LINE:
        poObj = new TABMAPObjLine;
        break;
      case TAB_GEOM_PLINE_C:
      case TAB_GEOM_PLINE:
      case TAB_GEOM_REGION_C:
      case TAB_GEOM_REGION:
      case TAB_GEOM_MULTIPLINE_C:
      case TAB_GEOM_MULTIPLINE:
      case TAB_GEOM_V450_REGION_C:
      case TAB_GEOM_V450_REGION:
      case TAB_GEOM_V450_MULTIPLINE_C:
      case TAB_GEOM_V450_MULTIPLINE:
      case TAB_GEOM_V800_REGION_C:
      case TAB_GEOM_V800_REGION:
      case TAB_GEOM_V800_MULTIPLINE_C:
      case TAB_GEOM_V800_MULTIPLINE:
        poObj = new TABMAPObjPLine;
        break;
      case TAB_GEOM_ARC_C:
      case TAB_GEOM_ARC:
        poObj = new TABMAPObjArc;
        break;
      case TAB_GEOM_RECT_C:
      case TAB_GEOM_RECT:
      case TAB_GEOM_ROUNDRECT_C:
      case TAB_GEOM_ROUNDRECT:

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲天天做日日做天天谢日日欢| 亚洲人亚洲人成电影网站色| 欧美巨大另类极品videosbest| av电影在线观看一区| 国产精品一区专区| 国产精品一区二区在线观看网站| 久久av资源站| 激情偷乱视频一区二区三区| 久久精品99国产精品| 麻豆成人91精品二区三区| 日本vs亚洲vs韩国一区三区二区| 日韩av电影免费观看高清完整版 | 亚洲丝袜精品丝袜在线| 国产欧美精品一区二区三区四区| 精品电影一区二区| 久久久久久久性| 国产日韩亚洲欧美综合| 亚洲国产精品成人综合色在线婷婷| 久久久精品日韩欧美| 国产精品美女久久久久久2018| 国产精品免费人成网站| 国产精品国产自产拍高清av王其| 中文字幕永久在线不卡| 亚洲人成在线播放网站岛国| 亚洲精品国产高清久久伦理二区| 亚洲一区二区五区| 日本午夜一本久久久综合| 国产麻豆视频精品| 不卡的电影网站| 欧美日韩在线三级| 日韩午夜激情视频| 日本一区二区三区四区在线视频| 成人欧美一区二区三区视频网页| 亚洲精品网站在线观看| 天天综合天天综合色| 精品一区中文字幕| 波多野结衣在线aⅴ中文字幕不卡| 91麻豆国产精品久久| 欧美日韩国产美女| 久久综合狠狠综合久久综合88| 久久久久久久久久久99999| 国产精品国产a级| 天天影视色香欲综合网老头| 久久超碰97中文字幕| 不卡的av网站| 欧美一区二区三区成人| 国产日韩欧美精品综合| 亚洲一区二区精品视频| 久久99九九99精品| 91免费看`日韩一区二区| 91麻豆精品国产自产在线观看一区| 精品久久五月天| 亚洲男人的天堂在线aⅴ视频| 日韩中文字幕1| 成人激情免费视频| 777色狠狠一区二区三区| 国产日本欧洲亚洲| 亚洲成av人片在线观看| 国产成人午夜精品5599| 精品视频一区 二区 三区| 国产欧美一区二区精品婷婷| 亚洲国产日韩一区二区| 国产精品一区二区久激情瑜伽| 欧美系列亚洲系列| 中文字幕欧美日本乱码一线二线| 偷拍与自拍一区| 波波电影院一区二区三区| 欧美大胆人体bbbb| 亚洲自拍偷拍av| 国产91丝袜在线播放| 欧美精品777| 亚洲免费观看高清完整版在线| 精品亚洲成a人| 欧美日韩国产精品自在自线| ...av二区三区久久精品| 国产一区二区三区在线观看免费| 欧美日韩一级片网站| 亚洲欧洲成人av每日更新| 国产一区福利在线| 日韩欧美在线1卡| 午夜在线成人av| 色偷偷一区二区三区| 国产精品日日摸夜夜摸av| 激情综合网av| 欧美电影免费观看高清完整版在线观看 | 国产a精品视频| 欧美肥胖老妇做爰| 亚洲欧美激情小说另类| 久久成人麻豆午夜电影| www.一区二区| 国产欧美日韩不卡| 九九**精品视频免费播放| 色香色香欲天天天影视综合网| 欧美激情中文不卡| 裸体歌舞表演一区二区| 91免费观看国产| 中文字幕在线观看一区| 国产资源精品在线观看| 欧美精选午夜久久久乱码6080| 亚洲国产成人午夜在线一区| 激情综合网av| 欧美电影免费观看完整版| 亚洲国产视频一区| 日本精品一区二区三区高清| 亚洲国产精品黑人久久久| 精品在线视频一区| 日韩欧美亚洲一区二区| 日本午夜精品视频在线观看 | 国产在线精品国自产拍免费| 色综合天天综合在线视频| 久久影视一区二区| 国产东北露脸精品视频| 精品日韩一区二区| 麻豆精品蜜桃视频网站| 制服丝袜av成人在线看| 一区二区三区四区高清精品免费观看| 国产美女主播视频一区| 久久久久久久久久久久久久久99| 精品系列免费在线观看| 日韩欧美国产高清| 日本sm残虐另类| 日韩一区二区电影在线| 日韩电影免费在线观看网站| 色综合一区二区| 午夜精品爽啪视频| 在线成人av网站| 美女精品自拍一二三四| 欧美成人精品1314www| 美腿丝袜亚洲一区| 91精品国产综合久久久蜜臀图片| 蜜桃精品在线观看| 精品国产污网站| 国产综合成人久久大片91| 精品电影一区二区三区| 国产成人午夜片在线观看高清观看| 精品国精品自拍自在线| 成人激情免费网站| 一区二区三区高清在线| 欧美性色欧美a在线播放| 一区二区三区精品| 欧美日韩日日骚| 午夜欧美视频在线观看| 欧美日韩精品一区视频| 美女一区二区三区在线观看| 日韩精品在线一区| 久久成人免费电影| 亚洲日本电影在线| 欧美色综合影院| 人妖欧美一区二区| 国产亚洲精品资源在线26u| 激情小说欧美图片| 一区二区三区中文免费| 欧美日韩成人综合在线一区二区| 日本特黄久久久高潮| 精品99999| aaa欧美大片| 亚洲免费毛片网站| 欧美精品一区二区三区蜜桃| 高清在线成人网| 亚洲一区在线看| 精品成人一区二区三区四区| 高清不卡在线观看| 蜜桃视频免费观看一区| 亚洲国产经典视频| 91福利视频网站| 精品一区二区三区免费| 亚洲色图视频免费播放| 日韩欧美在线1卡| www.性欧美| 麻豆91在线观看| 亚洲免费观看高清完整版在线| 欧美一级日韩免费不卡| 国产麻豆91精品| 日韩高清在线不卡| 国产精品国产三级国产aⅴ中文| 欧美日韩不卡一区二区| 国产1区2区3区精品美女| 亚洲一区二区四区蜜桃| 国产精品久久影院| 日韩一级完整毛片| 99久久er热在这里只有精品15| 视频在线在亚洲| 中文字幕国产精品一区二区| 欧美乱妇20p| 91丨九色丨蝌蚪富婆spa| 蜜臀av性久久久久蜜臀aⅴ四虎| 最近中文字幕一区二区三区| 日韩美女在线视频| 99精品久久只有精品| 久久精品国产澳门| 午夜精品久久久久久久99水蜜桃| 国产色91在线| 欧美怡红院视频| 色悠悠亚洲一区二区| 国产精品一区二区久久不卡| 日韩黄色片在线观看| 亚洲人亚洲人成电影网站色| 欧美一级黄色大片| 91精品国产综合久久久久久久| 99九九99九九九视频精品|