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

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

?? ogrlinestring.cpp

?? mitab,讀取MapInfo的地圖文件
?? CPP
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/******************************************************************************
 * $Id: ogrlinestring.cpp 10646 2007-01-18 02:38:10Z warmerdam $
 *
 * Project:  OpenGIS Simple Features Reference Implementation
 * Purpose:  The OGRLineString geometry 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"
#include <assert.h>

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

/************************************************************************/
/*                           OGRLineString()                            */
/************************************************************************/

/**
 * Create an empty line string.
 */

OGRLineString::OGRLineString()

{
    nPointCount = 0;
    paoPoints = NULL;
    padfZ = NULL;
}

/************************************************************************/
/*                           ~OGRLineString()                           */
/************************************************************************/

OGRLineString::~OGRLineString()

{
    if( paoPoints != NULL )
        OGRFree( paoPoints );
    if( padfZ != NULL )
        OGRFree( padfZ );
}

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

OGRwkbGeometryType OGRLineString::getGeometryType() const

{
    if( getCoordinateDimension() == 3 )
        return wkbLineString25D;
    else
        return wkbLineString;
}

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

void OGRLineString::flattenTo2D()

{
    Make2D();
}

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

const char * OGRLineString::getGeometryName() const

{
    return "LINESTRING";
}

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

OGRGeometry *OGRLineString::clone() const

{
    OGRLineString       *poNewLineString;

    poNewLineString = new OGRLineString();

    poNewLineString->assignSpatialReference( getSpatialReference() );
    poNewLineString->setPoints( nPointCount, paoPoints, padfZ );
    poNewLineString->setCoordinateDimension( getCoordinateDimension() );
    
    return poNewLineString;
}

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

void OGRLineString::empty()

{
    setNumPoints( 0 );
}

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

int OGRLineString::getDimension() const

{
    return 1;
}

/************************************************************************/
/*                       setCoordinateDimension()                       */
/************************************************************************/

void OGRLineString::setCoordinateDimension( int nNewDimension )

{
    nCoordDimension = nNewDimension;
    if( nNewDimension == 2 )
        Make2D();
    else if( nNewDimension == 3 )
        Make3D();
}

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

int OGRLineString::WkbSize() const

{
    return 5 + 4 + 8 * nPointCount * getCoordinateDimension();
}

/************************************************************************/
/*                               Make2D()                               */
/************************************************************************/

void OGRLineString::Make2D()

{
    if( padfZ != NULL )
    {
        OGRFree( padfZ );
        padfZ = NULL;
    }
    nCoordDimension = 2;
}

/************************************************************************/
/*                               Make3D()                               */
/************************************************************************/

void OGRLineString::Make3D()

{
    if( padfZ == NULL )
    {
        if( nPointCount == 0 )
            padfZ = (double *) OGRCalloc(sizeof(double),1);
        else
            padfZ = (double *) OGRCalloc(sizeof(double),nPointCount);
    }
    nCoordDimension = 3;
}

/************************************************************************/
/*                              getPoint()                              */
/************************************************************************/

/**
 * Fetch a point in line string.
 *
 * This method relates to the SFCOM ILineString::get_Point() method.
 *
 * @param i the vertex to fetch, from 0 to getNumPoints()-1.
 * @param poPoint a point to initialize with the fetched point.
 */

void    OGRLineString::getPoint( int i, OGRPoint * poPoint ) const

{
    assert( i >= 0 );
    assert( i < nPointCount );
    assert( poPoint != NULL );

    poPoint->setX( paoPoints[i].x );
    poPoint->setY( paoPoints[i].y );

    if( getCoordinateDimension() == 3 && padfZ != NULL )
        poPoint->setZ( padfZ[i] );
}

/**
 * \fn int OGRLineString::getNumPoints() const;
 *
 * Fetch vertex count.
 *
 * Returns the number of vertices in the line string.  
 *
 * @return vertex count.
 */

/**
 * \fn double OGRLineString::getX( int iVertex ) const;
 *
 * Get X at vertex.
 *
 * Returns the X value at the indicated vertex.   If iVertex is out of range a
 * crash may occur, no internal range checking is performed.
 *
 * @param iVertex the vertex to return, between 0 and getNumPoints()-1. 
 *
 * @return X value.
 */

/**
 * \fn double OGRLineString::getY( int iVertex ) const;
 *
 * Get Y at vertex.
 *
 * Returns the Y value at the indicated vertex.   If iVertex is out of range a
 * crash may occur, no internal range checking is performed.
 *
 * @param iVertex the vertex to return, between 0 and getNumPoints()-1. 
 *
 * @return X value.
 */

/************************************************************************/
/*                                getZ()                                */
/************************************************************************/

/**
 * Get Z at vertex.
 *
 * Returns the Z (elevation) value at the indicated vertex.  If no Z
 * value is available, 0.0 is returned.  If iVertex is out of range a
 * crash may occur, no internal range checking is performed.
 *
 * @param iVertex the vertex to return, between 0 and getNumPoints()-1. 
 *
 * @return Z value.
 */

double OGRLineString::getZ( int iVertex ) const

{
    if( padfZ != NULL && iVertex >= 0 && iVertex < nPointCount 
        && nCoordDimension >= 3 )
        return( padfZ[iVertex] );
    else
        return 0.0;
}

/************************************************************************/
/*                            setNumPoints()                            */
/************************************************************************/

/**
 * Set number of points in geometry.
 *
 * This method primary exists to preset the number of points in a linestring
 * geometry before setPoint() is used to assign them to avoid reallocating
 * the array larger with each call to addPoint(). 
 *
 * This method has no SFCOM analog.
 *
 * @param nNewPointCount the new number of points for geometry.
 */

void OGRLineString::setNumPoints( int nNewPointCount )

{
    if( nNewPointCount == 0 )
    {
        OGRFree( paoPoints );
        paoPoints = NULL;
        
        OGRFree( padfZ );
        padfZ = NULL;
        
        nPointCount = 0;
        return;
    }

    if( nNewPointCount > nPointCount )
    {
        paoPoints = (OGRRawPoint *)
            OGRRealloc(paoPoints, sizeof(OGRRawPoint) * nNewPointCount);

        assert( paoPoints != NULL );
        
        memset( paoPoints + nPointCount,
                0, sizeof(OGRRawPoint) * (nNewPointCount - nPointCount) );
        
        if( getCoordinateDimension() == 3 )
        {
            padfZ = (double *)
                OGRRealloc( padfZ, sizeof(double)*nNewPointCount );
            memset( padfZ + nPointCount, 0,
                    sizeof(double) * (nNewPointCount - nPointCount) );
        }
    }

    nPointCount = nNewPointCount;
}

/************************************************************************/
/*                              setPoint()                              */
/************************************************************************/

/**
 * Set the location of a vertex in line string.
 *
 * If iPoint is larger than the number of necessary the number of existing
 * points in the line string, the point count will be increased to
 * accomodate the request.
 *
 * There is no SFCOM analog to this method.
 * 
 * @param iPoint the index of the vertex to assign (zero based).
 * @param poPoint the value to assign to the vertex.
 */

void OGRLineString::setPoint( int iPoint, OGRPoint * poPoint )

{
    setPoint( iPoint, poPoint->getX(), poPoint->getY(), poPoint->getZ() );
}

/************************************************************************/
/*                              setPoint()                              */
/************************************************************************/

/**
 * Set the location of a vertex in line string.
 *
 * If iPoint is larger than the number of necessary the number of existing
 * points in the line string, the point count will be increased to
 * accomodate the request.
 * 
 * There is no SFCOM analog to this method.
 *
 * @param iPoint the index of the vertex to assign (zero based).
 * @param xIn input X coordinate to assign.
 * @param yIn input Y coordinate to assign.
 * @param zIn input Z coordinate to assign (defaults to zero).
 */

void OGRLineString::setPoint( int iPoint, double xIn, double yIn, double zIn )

{
    if( getCoordinateDimension() == 2 )
        Make3D();

    if( iPoint >= nPointCount )
        setNumPoints( iPoint+1 );

    paoPoints[iPoint].x = xIn;
    paoPoints[iPoint].y = yIn;

    if( zIn != 0.0 )
    {
        Make3D();
        padfZ[iPoint] = zIn;
    }
    else if( getCoordinateDimension() == 3 )
    {
        padfZ[iPoint] = 0.0;
    }
}

void OGRLineString::setPoint( int iPoint, double xIn, double yIn )

{
    if( iPoint >= nPointCount )
        setNumPoints( iPoint+1 );

    paoPoints[iPoint].x = xIn;
    paoPoints[iPoint].y = yIn;
}

/************************************************************************/
/*                              addPoint()                              */
/************************************************************************/

/**
 * Add a point to a line string.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲国产怡红院影院| 免费一区二区视频| 亚洲国产综合色| 久久精品二区亚洲w码| 国产一区二区女| 91九色02白丝porn| 日韩欧美久久久| 中文字幕在线观看一区| 偷窥少妇高潮呻吟av久久免费| 精品在线观看免费| 91视频在线观看| 午夜免费欧美电影| 国产精品77777竹菊影视小说| 99久久国产免费看| 欧美一区二视频| 国产精品日日摸夜夜摸av| 性感美女极品91精品| 成人免费视频caoporn| 在线不卡的av| 亚洲美女区一区| 国产在线视频一区二区| 91成人在线观看喷潮| 久久久国产精品午夜一区ai换脸| 一区二区三区美女视频| 国产剧情av麻豆香蕉精品| 欧洲一区二区三区在线| 中文字幕不卡的av| 日韩av电影免费观看高清完整版在线观看| 国产·精品毛片| 欧美一区二区精品在线| 一级做a爱片久久| 国产91综合一区在线观看| 在线不卡免费av| 一区二区三区中文字幕| 成人小视频免费观看| 精品久久国产字幕高潮| 亚洲不卡在线观看| 色呦呦国产精品| 国产精品久久久久7777按摩| 另类欧美日韩国产在线| 欧美久久一二三四区| 亚洲天堂2014| 成人在线综合网站| 2020国产精品自拍| 免费观看一级特黄欧美大片| 欧美三级日韩三级| 夜夜爽夜夜爽精品视频| 99久久777色| 欧美国产97人人爽人人喊| 久久精品国产澳门| 欧美精品视频www在线观看| 亚洲另类在线制服丝袜| caoporen国产精品视频| 国产喂奶挤奶一区二区三区| 九九视频精品免费| 欧美一二三四区在线| 亚洲成人精品在线观看| 91搞黄在线观看| 一区二区三区免费看视频| aaa国产一区| 国产精品美女久久久久久2018| 国产在线一区二区| 久久久777精品电影网影网| 欧美日韩你懂得| 一区二区三区中文免费| 91在线国产观看| 亚洲男人天堂av网| 色狠狠桃花综合| 亚洲精品免费视频| 色吧成人激情小说| 亚洲乱码国产乱码精品精小说 | 欧美网站一区二区| 亚洲综合在线免费观看| 日本精品视频一区二区| 一区二区不卡在线视频 午夜欧美不卡在| 99在线热播精品免费| 亚洲精品乱码久久久久久久久 | 亚洲va韩国va欧美va精品| 欧美日韩亚洲综合| 亚洲成人av资源| 大白屁股一区二区视频| 日韩国产在线一| 欧美mv日韩mv国产| 欧美日韩一级视频| 91麻豆国产在线观看| 国产欧美精品一区二区色综合| 99精品视频一区二区三区| 日韩在线卡一卡二| 国产精品久久久久久久久免费丝袜| 欧美性做爰猛烈叫床潮| 国产91精品欧美| 麻豆专区一区二区三区四区五区| 国产女人18毛片水真多成人如厕| 欧美久久一区二区| 99国产精品久久| 成人国产精品免费网站| 捆绑调教美女网站视频一区| 亚洲乱码国产乱码精品精小说 | 久久精品国产一区二区三区免费看| 337p粉嫩大胆色噜噜噜噜亚洲| 欧美嫩在线观看| 国产欧美日韩一区二区三区在线观看 | 欧美激情一区二区三区在线| av资源网一区| 亚洲国产精品久久一线不卡| 5566中文字幕一区二区电影| 国产在线麻豆精品观看| 国产精品久久久久久久久晋中| 91福利国产成人精品照片| 蜜芽一区二区三区| 国产精品人妖ts系列视频| 欧美影片第一页| 国产一区二区三区免费观看| 依依成人综合视频| 精品国产成人系列| 91视频xxxx| 看国产成人h片视频| 椎名由奈av一区二区三区| 在线播放一区二区三区| 高清在线不卡av| 亚洲午夜视频在线| 久久综合资源网| 色婷婷精品久久二区二区蜜臀av| 另类调教123区 | 欧美日韩美少妇| 国产精品2024| 亚洲一二三专区| 久久亚区不卡日本| 欧美色男人天堂| 亚洲精品一区二区三区在线观看| 亚洲激情图片qvod| 97se亚洲国产综合在线| 秋霞影院一区二区| 亚洲精品久久久蜜桃| 精品国产一区二区三区久久影院| 91精彩视频在线观看| 国产一区二区三区在线看麻豆 | 欧洲国产伦久久久久久久| 国产一区二区在线观看视频| 亚洲一区在线观看网站| 天天色图综合网| 中文字幕欧美一| 欧美大白屁股肥臀xxxxxx| 日本丰满少妇一区二区三区| 国产精品自拍av| 日韩高清欧美激情| 亚洲男人的天堂在线aⅴ视频| 国产日韩欧美一区二区三区乱码| 3d动漫精品啪啪| 欧美少妇一区二区| 99热99精品| 丁香一区二区三区| 国内国产精品久久| 久久激情综合网| 日韩成人精品在线观看| 亚洲一区在线看| 一区二区三区欧美日| 国产精品你懂的在线欣赏| 国产亚洲精久久久久久| 精品sm捆绑视频| 日韩欧美国产一区在线观看| 欧美日韩亚洲国产综合| 色婷婷亚洲综合| 色诱视频网站一区| 9久草视频在线视频精品| 风间由美中文字幕在线看视频国产欧美 | 国产成人免费在线观看不卡| 久久国产精品一区二区| 免费观看一级特黄欧美大片| 五月婷婷另类国产| 亚洲五码中文字幕| 亚洲第一综合色| 天天亚洲美女在线视频| 婷婷国产在线综合| 日韩黄色在线观看| 奇米在线7777在线精品| 青青草国产成人av片免费| 日韩av在线发布| 免费成人深夜小野草| 久久爱www久久做| 国产午夜精品一区二区三区视频| 精品久久久久一区| 久久久综合精品| 国产欧美日韩视频在线观看| 国产日韩欧美综合一区| 国产精品色婷婷久久58| 亚洲视频一区在线观看| 亚洲欧美福利一区二区| 亚洲一区在线视频观看| 图片区日韩欧美亚洲| 美国三级日本三级久久99| 精品一二三四区| 国产成人精品午夜视频免费| 成人精品国产一区二区4080| 91麻豆精品视频| 欧美日韩国产在线播放网站| 欧美丰满嫩嫩电影| 精品剧情在线观看| 欧美极品aⅴ影院| 亚洲欧美一区二区不卡|