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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ddfrecordindex.cpp

?? 支持各種柵格圖像和矢量圖像讀取的庫
?? CPP
字號:
/****************************************************************************** * $Id: ddfrecordindex.cpp 10646 2007-01-18 02:38:10Z warmerdam $ * * Project:  S-57 Translator * Purpose:  Implements DDFRecordIndex class.  This class is used to cache *           ISO8211 records for spatial objects so they can be efficiently *           assembled later as features. * Author:   Frank Warmerdam, warmerdam@pobox.com * ****************************************************************************** * Copyright (c) 1999, 2001, Frank Warmerdam * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. ****************************************************************************/#include "s57.h"#include "cpl_conv.h"CPL_CVSID("$Id: ddfrecordindex.cpp 10646 2007-01-18 02:38:10Z warmerdam $");/************************************************************************//*                           DDFRecordIndex()                           *//************************************************************************/DDFRecordIndex::DDFRecordIndex(){    bSorted = FALSE;    nRecordCount = 0;    nRecordMax = 0;    pasRecords = NULL;    nLastObjlPos = 0;             /* rjensen. added for FindRecordByObjl() */    nLastObjl    = 0;             /* rjensen. added for FindRecordByObjl() */}/************************************************************************//*                          ~DDFRecordIndex()                           *//************************************************************************/DDFRecordIndex::~DDFRecordIndex(){    Clear();}/************************************************************************//*                               Clear()                                *//*                                                                      *//*      Clear all entries from the index and deallocate all index       *//*      resources.                                                      *//************************************************************************/void DDFRecordIndex::Clear(){    // It turns out that deleting these records here is very expensive    // due to the linear search in DDFModule::RemoveClone().  For now we    // just leave the clones depending on DDFModule::~DDFModule() to clean    // them up eventually.    //for( int i = 0; i < nRecordCount; i++ )    //  delete pasRecords[i].poRecord;    CPLFree( pasRecords );    pasRecords = NULL;    nRecordCount = 0;    nRecordMax = 0;    nLastObjlPos = 0;             /* rjensen. added for FindRecordByObjl() */    nLastObjl      = 0;             /* rjensen. added for FindRecordByObjl() */    bSorted = FALSE;}/************************************************************************//*                             AddRecord()                              *//*                                                                      *//*      Add a record to the index.  The index will assume ownership     *//*      of the record.  If passing a record just read from a            *//*      DDFModule it is imperitive that the caller Clone()'s the        *//*      record first.                                                   *//************************************************************************/void DDFRecordIndex::AddRecord( int nKey, DDFRecord * poRecord ){    if( nRecordCount == nRecordMax )    {        nRecordMax = (int) (nRecordCount * 1.3 + 100);        pasRecords = (DDFIndexedRecord *)            CPLRealloc( pasRecords, sizeof(DDFIndexedRecord)*nRecordMax );    }    bSorted = FALSE;    pasRecords[nRecordCount].nKey = nKey;    pasRecords[nRecordCount].poRecord = poRecord;    pasRecords[nRecordCount].pClientData = NULL;    nRecordCount++;}/************************************************************************//*                             FindRecord()                             *//*                                                                      *//*      Though the returned pointer is not const, it should be          *//*      considered internal to the index and not modified or freed      *//*      by application code.                                            *//************************************************************************/DDFRecord * DDFRecordIndex::FindRecord( int nKey ){    if( !bSorted )        Sort();/* -------------------------------------------------------------------- *//*      Do a binary search based on the key to find the desired record. *//* -------------------------------------------------------------------- */    int         nMinIndex = 0, nMaxIndex = nRecordCount-1;    while( nMinIndex <= nMaxIndex )    {        int     nTestIndex = (nMaxIndex + nMinIndex) / 2;        if( pasRecords[nTestIndex].nKey < nKey )            nMinIndex = nTestIndex + 1;        else if( pasRecords[nTestIndex].nKey > nKey )            nMaxIndex = nTestIndex - 1;        else            return pasRecords[nTestIndex].poRecord;    }    return NULL;}/************************************************************************//*                       FindRecordByObjl()                             *//*      Rodney Jensen                                                   *//*      Though the returned pointer is not const, it should be          *//*      considered internal to the index and not modified or freed      *//*      by application code.                                            *//************************************************************************/DDFRecord * DDFRecordIndex::FindRecordByObjl( int nObjl ){    if( !bSorted )        Sort();/* -------------------------------------------------------------------- *//*      Do a linear search based on the nObjl to find the desired record. *//* -------------------------------------------------------------------- */    int nMinIndex = 0;    if (nLastObjl != nObjl) nLastObjlPos=0;    for (nMinIndex = nLastObjlPos; nMinIndex < nRecordCount; nMinIndex++)    {        if (nObjl == pasRecords[nMinIndex].poRecord->GetIntSubfield( "FRID", 0, "OBJL", 0 ) )        {            nLastObjlPos=nMinIndex+1;  /* add 1, don't want to look at same again */            nLastObjl=nObjl;            return pasRecords[nMinIndex].poRecord;        }    }    nLastObjlPos=0;    nLastObjl=0;    return NULL;}/************************************************************************//*                            RemoveRecord()                            *//************************************************************************/int DDFRecordIndex::RemoveRecord( int nKey ){    if( !bSorted )        Sort();/* -------------------------------------------------------------------- *//*      Do a binary search based on the key to find the desired record. *//* -------------------------------------------------------------------- */    int         nMinIndex = 0, nMaxIndex = nRecordCount-1;    int         nTestIndex = 0;    while( nMinIndex <= nMaxIndex )    {        nTestIndex = (nMaxIndex + nMinIndex) / 2;        if( pasRecords[nTestIndex].nKey < nKey )            nMinIndex = nTestIndex + 1;        else if( pasRecords[nTestIndex].nKey > nKey )            nMaxIndex = nTestIndex - 1;        else            break;    }    if( nMinIndex > nMaxIndex )        return FALSE;/* -------------------------------------------------------------------- *//*      Delete this record.                                             *//* -------------------------------------------------------------------- */    delete pasRecords[nTestIndex].poRecord;/* -------------------------------------------------------------------- *//*      Move all the list entries back one to fill the hole, and        *//*      update the total count.                                         *//* -------------------------------------------------------------------- */    memmove( pasRecords + nTestIndex,             pasRecords + nTestIndex + 1,             (nRecordCount - nTestIndex - 1) * sizeof(DDFIndexedRecord) );    nRecordCount--;    return TRUE;}/************************************************************************//*                             DDFCompare()                             *//*                                                                      *//*      Compare two DDFIndexedRecord objects for qsort().               *//************************************************************************/static int DDFCompare( const void *pRec1, const void *pRec2 ){    if( ((const DDFIndexedRecord *) pRec1)->nKey        == ((const DDFIndexedRecord *) pRec2)->nKey )        return 0;    else if( ((const DDFIndexedRecord *) pRec1)->nKey             < ((const DDFIndexedRecord *) pRec2)->nKey )        return -1;    else        return 1;}/************************************************************************//*                                Sort()                                *//*                                                                      *//*      Sort the records based on the key.  This is currently           *//*      implemented as a bubble sort, and could gain in efficiency      *//*      by reimplementing as a quick sort; however, I believe that      *//*      the keys will always be in order so a bubble sort should        *//*      only require one pass to verify this.                           *//************************************************************************/void DDFRecordIndex::Sort(){    if( bSorted )        return;    qsort( pasRecords, nRecordCount, sizeof(DDFIndexedRecord), DDFCompare );    bSorted = TRUE;}/************************************************************************//*                             GetByIndex()                             *//************************************************************************/DDFRecord * DDFRecordIndex::GetByIndex( int nIndex ){    if( !bSorted )        Sort();    if( nIndex < 0 || nIndex >= nRecordCount )        return NULL;    else        return pasRecords[nIndex].poRecord;}/************************************************************************//*                        GetClientInfoByIndex()                        *//************************************************************************/void * DDFRecordIndex::GetClientInfoByIndex( int nIndex ){    if( !bSorted )        Sort();    if( nIndex < 0 || nIndex >= nRecordCount )        return NULL;    else        return pasRecords[nIndex].pClientData;}/************************************************************************//*                        SetClientInfoByIndex()                        *//************************************************************************/void DDFRecordIndex::SetClientInfoByIndex( int nIndex, void *pClientData ){    if( !bSorted )        Sort();    if( nIndex < 0 || nIndex >= nRecordCount )        return;    else        pasRecords[nIndex].pClientData = pClientData;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人av一区二区| www.亚洲在线| 91视频免费观看| 欧美不卡视频一区| 亚洲国产sm捆绑调教视频| 韩国精品一区二区| 欧美日韩黄色影视| 中文字幕中文字幕一区二区| 日本色综合中文字幕| 色屁屁一区二区| 国产精品亲子伦对白| 国模一区二区三区白浆| 欧美精品久久一区| 亚洲图片欧美视频| 色噜噜夜夜夜综合网| 中文字幕第一页久久| 日本不卡的三区四区五区| 欧美在线影院一区二区| 中文字幕在线观看一区| 国产成人免费在线观看| 久久天天做天天爱综合色| 天天综合色天天| 91福利小视频| 伊人色综合久久天天人手人婷| 国产盗摄女厕一区二区三区 | 色久综合一二码| 国产精品视频观看| 国产成人午夜精品影院观看视频| 精品国产一区二区三区久久影院 | 精品视频在线免费看| 亚洲精品国产无套在线观| 99国产欧美久久久精品| 国产精品久久久久久久久久免费看 | 极品少妇xxxx精品少妇| 欧美一级在线观看| 蜜臀av一区二区在线观看| 3d动漫精品啪啪一区二区竹菊| 偷拍亚洲欧洲综合| 欧美一区二区网站| 美女视频黄免费的久久 | 麻豆国产精品一区二区三区| 在线播放一区二区三区| 麻豆freexxxx性91精品| 久久亚洲捆绑美女| 成人午夜视频在线| 亚洲人成电影网站色mp4| 欧美性大战久久久久久久蜜臀 | 一区二区三区四区国产精品| 色88888久久久久久影院按摩| 亚洲一区二区三区不卡国产欧美| 欧美日产国产精品| 狠狠狠色丁香婷婷综合激情| 中文字幕精品三区| 一本久久精品一区二区| 婷婷开心激情综合| 久久久精品欧美丰满| 99久久精品免费看国产| 亚洲色图第一区| 337p亚洲精品色噜噜狠狠| 国产精品99久久久久| 亚洲欧美日韩成人高清在线一区| 欧美精品日日鲁夜夜添| 国产成人在线视频免费播放| 亚洲欧美日韩精品久久久久| 日韩一区二区免费在线电影| 国产91在线观看| 亚洲成av人片一区二区三区| 日韩一区二区在线看| 成人美女视频在线观看| 丝袜美腿亚洲一区二区图片| 国产午夜亚洲精品不卡| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 亚洲伊人伊色伊影伊综合网| 日韩一卡二卡三卡四卡| 成人一道本在线| 另类小说色综合网站| 国产精品盗摄一区二区三区| 91精品国产综合久久香蕉的特点| 国产一区91精品张津瑜| 亚洲电影你懂得| 中文字幕一区二区三| 日韩精品中文字幕一区二区三区| 91丨九色丨尤物| 国产精品123区| 日韩高清不卡一区二区三区| 亚洲欧洲在线观看av| 精品久久久久一区| 欧美日韩国产电影| 91蜜桃视频在线| 成人一区二区三区视频在线观看| 蜜桃一区二区三区在线观看| 一区二区三区免费看视频| 国产视频一区在线观看| 日韩精品一区二区三区在线观看 | 天堂久久一区二区三区| 日韩美女视频一区| 欧美国产精品久久| 久久免费视频色| 精品国产91久久久久久久妲己| 欧美在线观看你懂的| 日本精品视频一区二区三区| 国产精品一区二区男女羞羞无遮挡| 日韩极品在线观看| 午夜在线成人av| 亚洲午夜电影在线| 亚洲精品国产第一综合99久久| 亚洲欧美综合色| 亚洲天堂a在线| 亚洲欧美日韩电影| 最近中文字幕一区二区三区| 国产免费成人在线视频| 久久麻豆一区二区| 欧美精品一区二区三区蜜桃| 精品国产麻豆免费人成网站| 欧美videossexotv100| 欧美一区二区三区在线观看 | 欧美在线不卡视频| 在线亚洲高清视频| 欧美日韩另类一区| 欧美高清激情brazzers| 884aa四虎影成人精品一区| 欧美日韩国产成人在线免费| 在线不卡的av| 久久综合一区二区| 国产精品少妇自拍| 亚洲日本一区二区三区| 一区二区三区中文字幕电影| 一区二区三区产品免费精品久久75| 极品少妇xxxx精品少妇| 免费日韩伦理电影| 国产盗摄女厕一区二区三区| 丁香六月综合激情| 一本大道久久a久久综合婷婷 | av在线不卡免费看| 色婷婷久久久久swag精品| 欧美日韩第一区日日骚| 日韩欧美色电影| 中文字幕高清一区| 亚洲电影第三页| 狠狠v欧美v日韩v亚洲ⅴ| 成人高清视频在线| 欧美日韩国产综合一区二区三区 | 精品无人码麻豆乱码1区2区 | 尤物在线观看一区| 日本不卡123| www.成人在线| 欧美日韩免费高清一区色橹橹 | 欧美精品一卡二卡| 久久久精品免费免费| 亚洲嫩草精品久久| 久久精品国产**网站演员| 福利一区福利二区| 欧美剧情片在线观看| 日本一区免费视频| 亚洲午夜免费视频| 粉嫩在线一区二区三区视频| 欧美影视一区在线| 国产亚洲女人久久久久毛片| 亚洲最新在线观看| 国产老肥熟一区二区三区| 色悠久久久久综合欧美99| 精品国产亚洲一区二区三区在线观看 | 91啦中文在线观看| 久久蜜桃一区二区| 亚洲国产美女搞黄色| 不卡的看片网站| 精品国精品自拍自在线| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲国产成人porn| av在线免费不卡| 久久综合久久综合久久| 香港成人在线视频| 色偷偷久久人人79超碰人人澡| 久久久国产综合精品女国产盗摄| 午夜精品福利在线| 在线免费不卡电影| 亚洲天堂精品在线观看| 国产精品性做久久久久久| 91麻豆精品国产91久久久久久| 最新不卡av在线| gogo大胆日本视频一区| 久久综合国产精品| 日本vs亚洲vs韩国一区三区二区 | 美腿丝袜亚洲三区| 欧美吻胸吃奶大尺度电影| 国产精品久久久久久久久图文区| 国产剧情av麻豆香蕉精品| 欧美精品国产精品| 亚洲高清中文字幕| 在线免费观看日本欧美| 日韩伦理电影网| 成人av网址在线| 国产精品九色蝌蚪自拍| 成人激情校园春色| 国产精品久久三区| 99麻豆久久久国产精品免费 | 日韩精品每日更新| 欧美男男青年gay1069videost | 欧美一区二区三区在线电影| 亚洲mv大片欧洲mv大片精品|