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

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

?? ogrfeature.cpp

?? mitab,讀取MapInfo的地圖文件
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/******************************************************************************
 * $Id: ogrfeature.cpp 11087 2007-03-27 03:55:12Z warmerdam $
 * 
 * Project:  OpenGIS Simple Features Reference Implementation
 * Purpose:  The OGRFeature class implementation. 
 * Author:   Frank Warmerdam, warmerda@home.com
 *
 ******************************************************************************
 * Copyright (c) 1999,  Les Technologies SoftMap Inc.
 *
 * 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_feature.h"
#include "ogr_api.h"
#include "ogr_p.h"

CPL_CVSID("$Id: ogrfeature.cpp 11087 2007-03-27 03:55:12Z warmerdam $");

/************************************************************************/
/*                             OGRFeature()                             */
/************************************************************************/

/**
 * Constructor
 *
 * Note that the OGRFeature will increment the reference count of it's
 * defining OGRFeatureDefn.  Destruction of the OGRFeatureDefn before
 * destruction of all OGRFeatures that depend on it is likely to result in
 * a crash. 
 *
 * This method is the same as the C function OGR_F_Create().
 *
 * @param poDefnIn feature class (layer) definition to which the feature will
 * adhere.
 */

OGRFeature::OGRFeature( OGRFeatureDefn * poDefnIn )

{
    m_pszStyleString = NULL;
    m_poStyleTable = NULL;
    m_pszTmpFieldValue = NULL;
    poDefnIn->Reference();
    poDefn = poDefnIn;

    nFID = OGRNullFID;
    
    poGeometry = NULL;

    // we should likely be initializing from the defaults, but this will
    // usually be a waste. 
    pauFields = (OGRField *) CPLCalloc( poDefn->GetFieldCount(),
                                        sizeof(OGRField) );

    for( int i = 0; i < poDefn->GetFieldCount(); i++ )
    {
        pauFields[i].Set.nMarker1 = OGRUnsetMarker;
        pauFields[i].Set.nMarker2 = OGRUnsetMarker;
    }
}

/************************************************************************/
/*                            OGR_F_Create()                            */
/************************************************************************/
/**
 * Feature factory.
 *
 * Note that the OGRFeature will increment the reference count of it's
 * defining OGRFeatureDefn.  Destruction of the OGRFeatureDefn before
 * destruction of all OGRFeatures that depend on it is likely to result in
 * a crash. 
 *
 * This function is the same as the C++ method OGRFeature::OGRFeature().
 * 
 * @param hDefn handle to the feature class (layer) definition to 
 * which the feature will adhere.
 * 
 * @return an handle to the new feature object with null fields and 
 * no geometry.
 */

OGRFeatureH OGR_F_Create( OGRFeatureDefnH hDefn )

{
    return (OGRFeatureH) new OGRFeature( (OGRFeatureDefn *) hDefn );
}

/************************************************************************/
/*                            ~OGRFeature()                             */
/************************************************************************/

OGRFeature::~OGRFeature()

{
    if( poGeometry != NULL )
        delete poGeometry;

    for( int i = 0; i < poDefn->GetFieldCount(); i++ )
    {
        OGRFieldDefn    *poFDefn = poDefn->GetFieldDefn(i);
        
        if( !IsFieldSet(i) )
            continue;
    
        switch( poFDefn->GetType() )
        {
          case OFTString:
            if( pauFields[i].String != NULL )
                VSIFree( pauFields[i].String );
            break;

          case OFTBinary:
            if( pauFields[i].Binary.paData != NULL )
                VSIFree( pauFields[i].Binary.paData );
            break;

          case OFTStringList:
            CSLDestroy( pauFields[i].StringList.paList );
            break;

          case OFTIntegerList:
          case OFTRealList:
            CPLFree( pauFields[i].IntegerList.paList );
            break;

          default:
            // should add support for wide strings.
            break;
        }
    }
    
    poDefn->Release();

    CPLFree( pauFields );
    CPLFree(m_pszStyleString);
    CPLFree(m_pszTmpFieldValue);
}

/************************************************************************/
/*                           OGR_F_Destroy()                            */
/************************************************************************/
/**
 * Destroy feature
 *
 * The feature is deleted, but within the context of the GDAL/OGR heap.
 * This is necessary when higher level applications use GDAL/OGR from a 
 * DLL and they want to delete a feature created within the DLL.  If the
 * delete is done in the calling application the memory will be freed onto
 * the application heap which is inappropriate. 
 *
 * This function is the same as the C++ method OGRFeature::DestroyFeature().
 * 
 * @param hFeat handle to the feature to destroy.
 */

void OGR_F_Destroy( OGRFeatureH hFeat )

{
    delete (OGRFeature *) hFeat;
}

/************************************************************************/
/*                           CreateFeature()                            */
/************************************************************************/

/**
 * Feature factory.
 *
 * This is essentially a feature factory, useful for               
 * applications creating features but wanting to ensure they       
 * are created out of the OGR/GDAL heap.                           
 * 
 * @param poDefn Feature definition defining schema.
 * 
 * @return new feature object with null fields and no geometry.  May be
 * deleted with delete. 
 */

OGRFeature *OGRFeature::CreateFeature( OGRFeatureDefn *poDefn )

{
    return new OGRFeature( poDefn );
}

/************************************************************************/
/*                           DestroyFeature()                           */
/************************************************************************/

/**
 * Destroy feature
 *
 * The feature is deleted, but within the context of the GDAL/OGR heap.
 * This is necessary when higher level applications use GDAL/OGR from a 
 * DLL and they want to delete a feature created within the DLL.  If the
 * delete is done in the calling application the memory will be freed onto
 * the application heap which is inappropriate. 
 *
 * This method is the same as the C function OGR_F_Destroy().
 * 
 * @param poFeature the feature to delete.
 */

void OGRFeature::DestroyFeature( OGRFeature *poFeature )

{
    delete poFeature;
}

/************************************************************************/
/*                             GetDefnRef()                             */
/************************************************************************/

/**
 * \fn OGRFeatureDefn *OGRFeature::GetDefnRef();
 *
 * Fetch feature definition.
 *
 * This method is the same as the C function OGR_F_GetDefnRef().
 *
 * @return a reference to the feature definition object.
 */

/************************************************************************/
/*                          OGR_F_GetDefnRef()                          */
/************************************************************************/

/**
 * Fetch feature definition.
 *
 * This function is the same as the C++ method OGRFeature::GetDefnRef().
 *
 * @param hFeat handle to the feature to get the feature definition from.
 *
 * @return an handle to the feature definition object on which feature
 * depends.
 */

OGRFeatureDefnH OGR_F_GetDefnRef( OGRFeatureH hFeat )

{
    return ((OGRFeature *) hFeat)->GetDefnRef();
}

/************************************************************************/
/*                        SetGeometryDirectly()                         */
/************************************************************************/

/**
 * Set feature geometry.
 *
 * This method updates the features geometry, and operate exactly as
 * SetGeometry(), except that this method assumes ownership of the
 * passed geometry.
 *
 * This method is the same as the C function OGR_F_SetGeometryDirectly().
 *
 * @param poGeomIn new geometry to apply to feature. Passing NULL value here
 * is correct and it will result in deallocation of currently assigned geometry
 * without assigning new one.
 *
 * @return OGRERR_NONE if successful, or OGR_UNSUPPORTED_GEOMETRY_TYPE if
 * the geometry type is illegal for the OGRFeatureDefn (checking not yet
 * implemented). 
 */ 

OGRErr OGRFeature::SetGeometryDirectly( OGRGeometry * poGeomIn )

{
    delete poGeometry;
    poGeometry = poGeomIn;

    // I should be verifying that the geometry matches the defn's type.
    
    return OGRERR_NONE;
}

/************************************************************************/
/*                     OGR_F_SetGeometryDirectly()                      */
/************************************************************************/

/**
 * Set feature geometry.
 *
 * This function updates the features geometry, and operate exactly as
 * SetGeometry(), except that this function assumes ownership of the
 * passed geometry.
 *
 * This function is the same as the C++ method 
 * OGRFeature::SetGeometryDirectly.
 *
 * @param hFeat handle to the feature on which to apply the geometry.
 * @param hGeom handle to the new geometry to apply to feature.
 *
 * @return OGRERR_NONE if successful, or OGR_UNSUPPORTED_GEOMETRY_TYPE if
 * the geometry type is illegal for the OGRFeatureDefn (checking not yet
 * implemented). 
 */ 

OGRErr OGR_F_SetGeometryDirectly( OGRFeatureH hFeat, OGRGeometryH hGeom )

{
    return ((OGRFeature *) hFeat)->SetGeometryDirectly((OGRGeometry *) hGeom);
}

/************************************************************************/
/*                            SetGeometry()                             */
/************************************************************************/

/**
 * Set feature geometry.
 *
 * This method updates the features geometry, and operate exactly as
 * SetGeometryDirectly(), except that this method does not assume ownership
 * of the passed geometry, but instead makes a copy of it. 
 *
 * This method is the same as the C function OGR_F_SetGeometry().
 *
 * @param poGeomIn new geometry to apply to feature. Passing NULL value here
 * is correct and it will result in deallocation of currently assigned geometry
 * without assigning new one.
 *
 * @return OGRERR_NONE if successful, or OGR_UNSUPPORTED_GEOMETRY_TYPE if
 * the geometry type is illegal for the OGRFeatureDefn (checking not yet
 * implemented). 
 */ 

OGRErr OGRFeature::SetGeometry( OGRGeometry * poGeomIn )

{
    delete poGeometry;

    if( poGeomIn != NULL )
        poGeometry = poGeomIn->clone();
    else
        poGeometry = NULL;

    // I should be verifying that the geometry matches the defn's type.
    
    return OGRERR_NONE;
}

/************************************************************************/
/*                         OGR_F_SetGeometry()                          */
/************************************************************************/

/**
 * Set feature geometry.
 *
 * This function updates the features geometry, and operate exactly as
 * SetGeometryDirectly(), except that this function does not assume ownership
 * of the passed geometry, but instead makes a copy of it. 
 *
 * This function is the same as the C++ OGRFeature::SetGeometry().
 *
 * @param hFeat handle to the feature on which new geometry is applied to.
 * @param hGeom handle to the new geometry to apply to feature.
 *
 * @return OGRERR_NONE if successful, or OGR_UNSUPPORTED_GEOMETRY_TYPE if
 * the geometry type is illegal for the OGRFeatureDefn (checking not yet
 * implemented). 
 */ 

OGRErr OGR_F_SetGeometry( OGRFeatureH hFeat, OGRGeometryH hGeom )

{
    return ((OGRFeature *) hFeat)->SetGeometry((OGRGeometry *) hGeom);
}

/************************************************************************/
/*                           StealGeometry()                            */
/************************************************************************/

/**
 * Take away ownership of geometry.
 *
 * Fetch the geometry from this feature, and clear the reference to the
 * geometry on the feature.  This is a mechanism for the application to
 * take over ownship of the geometry from the feature without copying. 
 * Sort of an inverse to SetGeometryDirectly().
 *
 * After this call the OGRFeature will have a NULL geometry.
 *
 * @return the pointer to the geometry.
 */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区导航在线播放| 国产福利精品导航| 国产目拍亚洲精品99久久精品 | www..com久久爱| 视频一区视频二区中文| 国产精品色婷婷| 日韩你懂的在线播放| 在线观看精品一区| 粉嫩绯色av一区二区在线观看| 日韩精品三区四区| 亚洲欧美视频在线观看| 精品国产乱码久久久久久久| 日韩理论片在线| 精品三级在线观看| 精品视频一区 二区 三区| av网站一区二区三区| 激情文学综合插| 日韩精品一二区| 亚洲午夜一二三区视频| 国产精品久久久久久久久免费樱桃| 日韩欧美成人一区二区| 欧美理论在线播放| 精品视频在线免费观看| 色呦呦国产精品| 成人深夜在线观看| 国产精品性做久久久久久| 精品一区二区影视| 麻豆精品蜜桃视频网站| 日日摸夜夜添夜夜添亚洲女人| 亚洲精品日韩综合观看成人91| 国产精品女主播在线观看| 国产欧美精品一区二区三区四区| 欧美电影精品一区二区| 欧美大黄免费观看| 日韩欧美在线网站| 欧美一区三区四区| 91精品国产91久久久久久一区二区 | 国产一区二区免费视频| 亚洲图片欧美色图| 亚洲一区二区欧美日韩| 一区二区三区在线看| 一区二区三区中文在线观看| 亚洲欧洲精品一区二区三区| 国产精品久久毛片av大全日韩| 中文字幕欧美激情一区| 国产亲近乱来精品视频| 一本久久综合亚洲鲁鲁五月天| 国产精品一区二区黑丝| 国产尤物一区二区| 国产精品影视网| 成人性生交大片免费看中文| 国产iv一区二区三区| 99久久国产综合精品麻豆| 91成人国产精品| 欧美日高清视频| 欧美电影免费观看高清完整版在线 | 国产精品伊人色| 国产一区二区h| www.日韩av| 日本韩国欧美三级| 欧美日韩免费在线视频| 一区二区三区中文字幕精品精品 | 亚洲精品成人精品456| 一区二区三区四区蜜桃 | 国产一区二区三区免费在线观看| 国产一区 二区 三区一级| 不卡一区中文字幕| 欧美日韩亚州综合| 精品国产网站在线观看| 中文字幕在线不卡国产视频| 亚洲成人高清在线| 国产精品综合视频| 色婷婷综合激情| 欧美一级日韩不卡播放免费| 精品成人一区二区三区| 17c精品麻豆一区二区免费| 亚洲韩国一区二区三区| 国产精品影视网| 欧美中文字幕一二三区视频| 精品少妇一区二区| 一区二区三区资源| 国产另类ts人妖一区二区| 色94色欧美sute亚洲线路一ni| 精品少妇一区二区三区在线播放| 自拍偷拍亚洲欧美日韩| 美女视频黄 久久| 色综合婷婷久久| 精品国产区一区| 亚洲福利一二三区| 成人免费的视频| 日韩免费视频线观看| 亚洲免费av观看| 国产精品1区二区.| 欧美二区乱c少妇| 亚洲欧洲成人精品av97| 久久电影网站中文字幕| 在线中文字幕不卡| 国产精品视频免费| 蓝色福利精品导航| 欧美老肥妇做.爰bbww| ...av二区三区久久精品| 久久精品久久99精品久久| 欧美专区在线观看一区| 国产精品午夜电影| 激情综合色播五月| 7777女厕盗摄久久久| 亚洲男人的天堂一区二区| 国产黄色精品视频| 欧美成人精品1314www| 亚洲国产欧美日韩另类综合| 91丨porny丨中文| 久久精品夜色噜噜亚洲a∨| 老司机精品视频导航| 欧美高清一级片在线| 亚洲综合在线免费观看| av亚洲精华国产精华精华| 国产欧美日韩不卡| 国产精品一级黄| 亚洲成a人v欧美综合天堂| 97aⅴ精品视频一二三区| 中文字幕av一区二区三区免费看| 激情欧美一区二区| 日韩一级大片在线| 蜜臀久久99精品久久久久宅男| 色噜噜狠狠成人网p站| 中文字幕一区二区视频| 成人激情视频网站| 中文字幕一区二区三区在线不卡 | 一本久久综合亚洲鲁鲁五月天 | 亚洲欧美日韩国产另类专区 | 99久久综合狠狠综合久久| 国产日韩欧美一区二区三区综合| 精品一区二区成人精品| 欧美一区二区三区四区久久| 天天操天天综合网| 日韩一区二区免费在线电影| 免费观看一级欧美片| 欧美成人一区二区三区在线观看| 日韩高清在线观看| 欧美草草影院在线视频| 国产高清无密码一区二区三区| 国产日韩欧美精品综合| 国产成人综合在线| 日韩伦理免费电影| 欧美亚洲动漫另类| 性欧美大战久久久久久久久| 欧美日韩国产不卡| 精品一区二区三区视频| 国产视频视频一区| 91婷婷韩国欧美一区二区| 亚洲精品福利视频网站| 欧美色爱综合网| 九一九一国产精品| 日韩avvvv在线播放| 日韩亚洲电影在线| 成人性生交大片免费看视频在线 | 久久综合五月天婷婷伊人| 国产真实乱子伦精品视频| 国产精品视频看| 欧美三区在线观看| 激情综合一区二区三区| 国产精品久久久久久久浪潮网站| 91福利在线导航| 久久电影网电视剧免费观看| 中文字幕av免费专区久久| 91福利在线观看| 国产又黄又大久久| 亚洲精品午夜久久久| 日韩免费成人网| 一本色道a无线码一区v| 免费视频最近日韩| 国产精品二三区| 91精品在线麻豆| 国产91精品一区二区| 亚洲成a人v欧美综合天堂下载| 久久久久久久久久电影| 91成人国产精品| 国产精品18久久久| 亚洲一区二区视频| 久久精品日产第一区二区三区高清版| 色综合久久综合网| 国产美女一区二区三区| 亚洲午夜精品久久久久久久久| 久久亚洲一级片| 欧美日韩免费视频| 不卡的av网站| 经典三级视频一区| 亚洲成av人片www| 国产精品白丝在线| 欧美va亚洲va国产综合| 色婷婷国产精品| 国产电影精品久久禁18| 免费欧美日韩国产三级电影| 国产精品成人一区二区艾草| 日韩一区二区电影在线| 91国产视频在线观看| 波多野结衣中文一区| 国产乱人伦偷精品视频不卡| 亚洲成人激情自拍| 中文字幕一区二区不卡|