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

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

?? ogrgeometrycollection.cpp

?? mitab,讀取MapInfo的地圖文件
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************
 * $Id: ogrgeometrycollection.cpp 10646 2007-01-18 02:38:10Z warmerdam $
 *
 * Project:  OpenGIS Simple Features Reference Implementation
 * Purpose:  The OGRGeometryCollection class.
 * Author:   Frank Warmerdam, warmerdam@pobox.com
 *
 ******************************************************************************
 * Copyright (c) 1999, 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 "ogr_geometry.h"
#include "ogr_p.h"

CPL_CVSID("$Id: ogrgeometrycollection.cpp 10646 2007-01-18 02:38:10Z warmerdam $");

/************************************************************************/
/*                       OGRGeometryCollection()                        */
/************************************************************************/

/**
 * Create an empty geometry collection.
 */

OGRGeometryCollection::OGRGeometryCollection()

{
    nGeomCount = 0;
    papoGeoms = NULL;
    nCoordinateDimension = 2;
}

/************************************************************************/
/*                       ~OGRGeometryCollection()                       */
/************************************************************************/

OGRGeometryCollection::~OGRGeometryCollection()

{
    empty();
    nCoordinateDimension = 2;
}

/************************************************************************/
/*                               empty()                                */
/************************************************************************/

void OGRGeometryCollection::empty()

{
    if( papoGeoms != NULL )
    {
        for( int i = 0; i < nGeomCount; i++ )
        {
            delete papoGeoms[i];
        }
        OGRFree( papoGeoms );
    }

    nGeomCount = 0;
    papoGeoms = NULL;
}


/************************************************************************/
/*                               clone()                                */
/************************************************************************/

OGRGeometry *OGRGeometryCollection::clone() const

{
    OGRGeometryCollection       *poNewGC;

    poNewGC = new OGRGeometryCollection;
    poNewGC->assignSpatialReference( getSpatialReference() );

    for( int i = 0; i < nGeomCount; i++ )
    {
        poNewGC->addGeometry( papoGeoms[i] );
    }

    return poNewGC;
}

/************************************************************************/
/*                          getGeometryType()                           */
/************************************************************************/

OGRwkbGeometryType OGRGeometryCollection::getGeometryType() const

{
    if( getCoordinateDimension() == 3 )
        return wkbGeometryCollection25D;
    else
        return wkbGeometryCollection;
}

/************************************************************************/
/*                            getDimension()                            */
/************************************************************************/

int OGRGeometryCollection::getDimension() const

{
    return 2; // This isn't strictly correct.  It should be based on members.
}

/************************************************************************/
/*                            flattenTo2D()                             */
/************************************************************************/

void OGRGeometryCollection::flattenTo2D()

{
    for( int i = 0; i < nGeomCount; i++ )
        papoGeoms[i]->flattenTo2D();

    nCoordinateDimension = 2;
}

/************************************************************************/
/*                          getGeometryName()                           */
/************************************************************************/

const char * OGRGeometryCollection::getGeometryName() const

{
    return "GEOMETRYCOLLECTION";
}

/************************************************************************/
/*                          getNumGeometries()                          */
/************************************************************************/

/**
 * Fetch number of geometries in container.
 *
 * This method relates to the SFCOM IGeometryCollect::get_NumGeometries()
 * method.
 *
 * @return count of children geometries.  May be zero.
 */

int OGRGeometryCollection::getNumGeometries() const

{
    return nGeomCount;
}

/************************************************************************/
/*                           getGeometryRef()                           */
/************************************************************************/

/**
 * Fetch geometry from container.
 *
 * This method returns a pointer to an geometry within the container.  The
 * returned geometry remains owned by the container, and should not be
 * modified.  The pointer is only valid untill the next change to the
 * geometry container.  Use IGeometry::clone() to make a copy.
 *
 * This method relates to the SFCOM IGeometryCollection::get_Geometry() method.
 *
 * @param i the index of the geometry to fetch, between 0 and
 *          getNumGeometries() - 1.
 * @return pointer to requested geometry.
 */

OGRGeometry * OGRGeometryCollection::getGeometryRef( int i ) 

{
    if( i < 0 || i >= nGeomCount )
        return NULL;
    else
        return papoGeoms[i];
}

const OGRGeometry * OGRGeometryCollection::getGeometryRef( int i ) const

{
    if( i < 0 || i >= nGeomCount )
        return NULL;
    else
        return papoGeoms[i];
}

/************************************************************************/
/*                            addGeometry()                             */
/*                                                                      */
/*      Add a new geometry to a collection.  Subclasses should          */
/*      override this to verify the type of the new geometry, and       */
/*      then call this method to actually add it.                       */
/************************************************************************/

/**
 * Add a geometry to the container.
 *
 * Some subclasses of OGRGeometryCollection restrict the types of geometry
 * that can be added, and may return an error.  The passed geometry is cloned
 * to make an internal copy.
 *
 * There is no SFCOM analog to this method.
 *
 * This method is the same as the C function OGR_G_AddGeometry().
 *
 * @param poNewGeom geometry to add to the container.
 *
 * @return OGRERR_NONE if successful, or OGRERR_UNSUPPORTED_GEOMETRY_TYPE if
 * the geometry type is illegal for the type of geometry container.
 */

OGRErr OGRGeometryCollection::addGeometry( const OGRGeometry * poNewGeom )

{
    OGRGeometry *poClone = poNewGeom->clone();
    OGRErr      eErr;

    eErr = addGeometryDirectly( poClone );
    if( eErr != OGRERR_NONE )
        delete poClone;

    return eErr;
}

/************************************************************************/
/*                        addGeometryDirectly()                         */
/*                                                                      */
/*      Add a new geometry to a collection.  Subclasses should          */
/*      override this to verify the type of the new geometry, and       */
/*      then call this method to actually add it.                       */
/************************************************************************/

/**
 * Add a geometry directly to the container.
 *
 * Some subclasses of OGRGeometryCollection restrict the types of geometry
 * that can be added, and may return an error.  Ownership of the passed
 * geometry is taken by the container rather than cloning as addGeometry()
 * does.
 *
 * This method is the same as the C function OGR_G_AddGeometryDirectly().
 *
 * There is no SFCOM analog to this method.
 *
 * @param poNewGeom geometry to add to the container.
 *
 * @return OGRERR_NONE if successful, or OGRERR_UNSUPPORTED_GEOMETRY_TYPE if
 * the geometry type is illegal for the type of geometry container.
 */

OGRErr OGRGeometryCollection::addGeometryDirectly( OGRGeometry * poNewGeom )

{
    papoGeoms = (OGRGeometry **) OGRRealloc( papoGeoms,
                                             sizeof(void*) * (nGeomCount+1) );

    papoGeoms[nGeomCount] = poNewGeom;

    nGeomCount++;

    if( poNewGeom->getCoordinateDimension() == 3 )
        nCoordinateDimension = 3;

    return OGRERR_NONE;
}

/************************************************************************/
/*                           removeGeometry()                           */
/************************************************************************/

/**
 * Remove a geometry from the container.
 *
 * Removing a geometry will cause the geometry count to drop by one, and all
 * "higher" geometries will shuffle down one in index.
 *
 * There is no SFCOM analog to this method.
 *
 * This method is the same as the C function OGR_G_RemoveGeometry().
 *
 * @param iGeom the index of the geometry to delete.  A value of -1 is a
 * special flag meaning that all geometries should be removed.
 *
 * @param bDelete if TRUE the geometry will be deallocated, otherwise it will
 * not.  The default is TRUE as the container is considered to own the
 * geometries in it. 
 *
 * @return OGRERR_NONE if successful, or OGRERR_FAILURE if the index is
 * out of range.
 */

OGRErr OGRGeometryCollection::removeGeometry( int iGeom, int bDelete )

{
    if( iGeom < -1 || iGeom >= nGeomCount )
        return OGRERR_FAILURE;

    // Special case.
    if( iGeom == -1 )
    {
        while( nGeomCount > 0 )
            removeGeometry( nGeomCount-1, bDelete );
        return OGRERR_NONE;
    }

    if( bDelete )
        delete papoGeoms[iGeom];

    memmove( papoGeoms + iGeom, papoGeoms + iGeom + 1, 
             sizeof(void*) * (nGeomCount-iGeom-1) );

    nGeomCount--;

    return OGRERR_NONE;
}

/************************************************************************/
/*                              WkbSize()                               */
/*                                                                      */
/*      Return the size of this object in well known binary             */
/*      representation including the byte order, and type information.  */
/************************************************************************/

int OGRGeometryCollection::WkbSize() const

{
    int         nSize = 9;

    for( int i = 0; i < nGeomCount; i++ )
    {
        nSize += papoGeoms[i]->WkbSize();
    }

    return nSize;
}

/************************************************************************/
/*                           importFromWkb()                            */
/*                                                                      */
/*      Initialize from serialized stream in well known binary          */
/*      format.                                                         */
/************************************************************************/

OGRErr OGRGeometryCollection::importFromWkb( unsigned char * pabyData,
                                             int nSize )

{
    OGRwkbByteOrder     eByteOrder;
    int                 nDataOffset;
    
    if( nSize < 9 && nSize != -1 )
        return OGRERR_NOT_ENOUGH_DATA;

/* -------------------------------------------------------------------- */
/*      Get the byte order byte.                                        */
/* -------------------------------------------------------------------- */
    eByteOrder = DB2_V72_FIX_BYTE_ORDER((OGRwkbByteOrder) *pabyData);
    CPLAssert( eByteOrder == wkbXDR || eByteOrder == wkbNDR );

/* -------------------------------------------------------------------- */
/*      Get the geometry feature type.  For now we assume that          */
/*      geometry type is between 0 and 255 so we only have to fetch     */
/*      one byte.                                                       */
/* -------------------------------------------------------------------- */
#ifdef DEBUG
    OGRwkbGeometryType eGeometryType;

    if( eByteOrder == wkbNDR )
    {
        eGeometryType = (OGRwkbGeometryType) pabyData[1];
    }
    else
    {
        eGeometryType = (OGRwkbGeometryType) pabyData[4];
    }

    CPLAssert( eGeometryType == wkbGeometryCollection
               || eGeometryType == wkbMultiPolygon 
               || eGeometryType == wkbMultiLineString 
               || eGeometryType == wkbMultiPoint );
#endif    

/* -------------------------------------------------------------------- */
/*      Do we already have some existing geometry objects?              */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级专区免费大片| 亚洲黄色录像片| 丁香婷婷综合激情五月色| 国产欧美精品一区| 成人av影院在线| 亚洲日本电影在线| 欧美久久一二区| 久久se这里有精品| 国产精品天天看| 在线精品视频免费观看| 天天av天天翘天天综合网色鬼国产| 欧美日韩国产一二三| 激情六月婷婷综合| 国产精品拍天天在线| 欧美日韩午夜精品| 久久av中文字幕片| 中文字幕日本乱码精品影院| 欧洲人成人精品| 毛片av一区二区| 欧美国产1区2区| 欧美三级电影在线观看| 男人操女人的视频在线观看欧美| 久久尤物电影视频在线观看| 99国产精品久久久久久久久久| 亚洲一区二区精品视频| 日韩写真欧美这视频| 国产suv一区二区三区88区| 伊人色综合久久天天人手人婷| 51久久夜色精品国产麻豆| 国产成人精品www牛牛影视| 亚洲精品水蜜桃| 日韩一级大片在线| 不卡的av网站| 日韩国产欧美三级| 国产精品免费aⅴ片在线观看| 欧美性受xxxx| 国产精品自拍av| 亚洲综合色丁香婷婷六月图片| 日韩精品一区二区三区swag| 99久久国产免费看| 麻豆精品在线看| **网站欧美大片在线观看| 日韩欧美综合一区| 91碰在线视频| 韩国毛片一区二区三区| 亚洲综合在线五月| 国产亚洲欧美日韩在线一区| 欧美日韩你懂得| 高清不卡一区二区在线| 午夜av电影一区| 亚洲欧洲精品成人久久奇米网| 4438成人网| 91丝袜美腿高跟国产极品老师| 美女视频黄久久| 亚洲乱码中文字幕| 久久你懂得1024| 欧美日韩午夜在线| 91在线视频播放地址| 国产乱码字幕精品高清av| 午夜电影网一区| 亚洲少妇中出一区| 久久久久久麻豆| 欧美一级欧美一级在线播放| 色综合天天狠狠| 高清不卡在线观看| 国产在线一区观看| 日本在线不卡一区| 夜夜嗨av一区二区三区中文字幕| 亚洲国产精品v| 精品国产免费一区二区三区四区| 欧美日韩亚洲综合一区| 91亚洲资源网| 丁香婷婷综合五月| 国产一区视频导航| 奇米影视一区二区三区| 午夜精品久久久久久久久| 亚洲免费视频中文字幕| 中文字幕成人网| 2023国产精华国产精品| 91精品婷婷国产综合久久| 欧洲国内综合视频| 菠萝蜜视频在线观看一区| 国产成人免费在线| 精品一区二区三区在线播放视频| 午夜电影一区二区| 亚洲成人免费在线观看| 亚洲精品中文在线| 亚洲人成人一区二区在线观看| 国产午夜精品一区二区三区视频 | 精品成人一区二区三区| 欧美日韩国产精品成人| 色999日韩国产欧美一区二区| 国产福利一区在线| 韩日精品视频一区| 激情综合网最新| 男男gaygay亚洲| 秋霞国产午夜精品免费视频| 肉色丝袜一区二区| 午夜精品123| 日韩制服丝袜av| 首页国产丝袜综合| 天堂在线一区二区| 首页亚洲欧美制服丝腿| 日韩成人精品视频| 理论片日本一区| 精品无码三级在线观看视频| 免费精品视频在线| 久久国产成人午夜av影院| 蜜桃精品视频在线观看| 美女一区二区视频| 久久99精品久久久| 国产一区二区美女| 国产福利一区二区三区视频| 成人在线视频首页| 成人99免费视频| 99久久伊人久久99| 91精品1区2区| 777奇米四色成人影色区| 日韩三级av在线播放| 精品日韩欧美在线| 精品国产91洋老外米糕| 久久嫩草精品久久久精品一| 欧美—级在线免费片| 国产精品的网站| 一区二区三区日本| 亚洲大片在线观看| 青椒成人免费视频| 国产麻豆成人传媒免费观看| 懂色av一区二区三区蜜臀| 99re66热这里只有精品3直播| 亚洲一二三区在线观看| 亚洲成人综合在线| 免费高清成人在线| 国产91精品一区二区麻豆网站| 成人的网站免费观看| 欧美亚洲国产一区二区三区va| 欧美一区二区在线免费播放| 亚洲精品一区二区在线观看| 亚洲国产精品成人综合| 一区二区三区在线视频观看58| 亚洲成va人在线观看| 久久国产夜色精品鲁鲁99| 国产盗摄精品一区二区三区在线 | 亚洲欧洲美洲综合色网| 亚洲综合视频网| 久久精品国产亚洲一区二区三区| 国产一区二区在线视频| 成人短视频下载| 欧美日韩一级片在线观看| 欧美精品一区二区三区蜜桃| 中文字幕av一区二区三区免费看| 一片黄亚洲嫩模| 美国三级日本三级久久99| 大陆成人av片| 欧美日韩美女一区二区| 久久久亚洲欧洲日产国码αv| 国产精品乱码人人做人人爱| 亚洲国产日韩综合久久精品| 国产一区二区三区最好精华液| a级高清视频欧美日韩| 91精品国产综合久久久久久久久久 | 午夜激情一区二区三区| 国产一区二区视频在线| 色婷婷综合在线| 欧美mv和日韩mv国产网站| 亚洲欧美自拍偷拍| 免费成人在线网站| av在线不卡网| 欧美成人性战久久| 一区二区三区四区中文字幕| 久久aⅴ国产欧美74aaa| 91黄色激情网站| 久久久久免费观看| 亚洲成a人v欧美综合天堂| 国产91在线看| 69堂精品视频| 最新不卡av在线| 久久99精品久久只有精品| 在线视频欧美精品| 国产婷婷色一区二区三区在线| 亚洲v日本v欧美v久久精品| 国产成人av一区二区三区在线| 欧美日韩精品一区二区三区 | 在线观看网站黄不卡| www日韩大片| 三级影片在线观看欧美日韩一区二区 | 99re热这里只有精品视频| 欧美变态tickling挠脚心| 亚洲国产sm捆绑调教视频| 粉嫩嫩av羞羞动漫久久久| 欧美一区二区人人喊爽| 亚洲女女做受ⅹxx高潮| 国产激情视频一区二区三区欧美 | 国产欧美日韩综合| 日本中文在线一区| 91福利国产精品| 中文字幕在线不卡国产视频| 激情文学综合丁香| 7777女厕盗摄久久久| 亚洲宅男天堂在线观看无病毒|