⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ugkmultipolygon.cpp

📁 linux下一款GIS程序源码
💻 CPP
字号:
// ugkmultipolygon.cpp: implementation of the UGKMultiPolygon class.////////////////////////////////////////////////////////////////////////#include "ugkmultipolygon.h"#include "ugkpolygon.h"/************************************************************************//*                          UGKMultiPolygon()                           *//************************************************************************/UGKMultiPolygon::UGKMultiPolygon(){}/************************************************************************//*                          ~UGKMultiPolygon()                          *//************************************************************************/UGKMultiPolygon::~UGKMultiPolygon(){}/************************************************************************//*                        addGeometryDirectly()                         *//************************************************************************/UGKErr UGKMultiPolygon::addGeometryDirectly( UGKGeometry * poNewGeom ){    if( poNewGeom->getGeometryType() != wkbPolygon         && poNewGeom->getGeometryType() != wkbPolygon25D )        return UGKERR_UNSUPPORTED_GEOMETRY_TYPE;    return UGKGeometryCollection::addGeometryDirectly( poNewGeom );}/************************************************************************//*                               clone()                                *//************************************************************************/UGKGeometry *UGKMultiPolygon::clone() const{    UGKMultiPolygon     *poNewGC;    poNewGC = new UGKMultiPolygon;    for( int i = 0; i < getNumGeometries(); i++ )    {        poNewGC->addGeometry( getGeometryRef(i) );    }    return poNewGC;}/************************************************************************//*                              get_Area()                              *//************************************************************************//** * Compute area of multipolygon. * * The area is computed as the sum of the areas of all polygon members * in this collection. * * @return computed area. */double UGKMultiPolygon::get_Area() const{    double dfArea = 0.0;    int iPoly;    for( iPoly = 0; iPoly < getNumGeometries(); iPoly++ )    {        UGKPolygon *poPoly = (UGKPolygon *) getGeometryRef( iPoly );        dfArea += poPoly->get_Area();    }    return dfArea;}/************************************************************************//*                          getGeometryName()                           *//************************************************************************/const char * UGKMultiPolygon::getGeometryName() const{    return "MULTIPOLYGON";}/************************************************************************//*                          getGeometryType()                           *//************************************************************************/UGKwkbGeometryType UGKMultiPolygon::getGeometryType() const{    if( getCoordinateDimension() == 3 )        return wkbMultiPolygon25D;    else        return wkbMultiPolygon;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -