/******************************************************************************
* $Id$
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Classes for manipulating simple features that is not specific
* to a particular interface technology.
* Author: Frank Warmerdam, warmerdam@pobox.com
*
******************************************************************************
* Copyright (c) 1999, Frank Warmerdam
* Copyright (c) 2008-2014, Even Rouault <even dot rouault at spatialys.com>
*
* 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.
****************************************************************************/
#ifndef OGR_GEOMETRY_H_INCLUDED
#define OGR_GEOMETRY_H_INCLUDED
#include "cpl_conv.h"
#include "cpl_json.h"
#include "ogr_core.h"
#include "ogr_spatialref.h"
#include <cmath>
#include <memory>
/**
* \file ogr_geometry.h
*
* Simple feature geometry classes.
*/
/*! @cond Doxygen_Suppress */
#ifndef DEFINEH_OGRGeometryH
#define DEFINEH_OGRGeometryH
#ifdef DEBUG
typedef struct OGRGeometryHS *OGRGeometryH;
#else
typedef void *OGRGeometryH;
#endif
#endif /* DEFINEH_OGRGeometryH */
/*! @endcond */
/// WKT Output formatting options.
enum class OGRWktFormat
{
F, ///< F-type formatting.
G, ///< G-type formatting.
Default ///< Format as F when abs(value) < 1, otherwise as G.
};
/// Options for formatting WKT output
struct CPL_DLL OGRWktOptions
{
public:
/// Type of WKT output to produce.
OGRwkbVariant variant;
/// Precision of output. Interpretation depends on \c format.
int precision;
/// Whether GDAL-special rounding should be applied.
bool round;
/// Formatting type.
OGRWktFormat format;
/// Constructor.
OGRWktOptions() : variant(wkbVariantOldOgc), precision(15), round(true),
format(OGRWktFormat::Default)
{
static int defPrecision = getDefaultPrecision();
static bool defRound = getDefaultRound();
precision = defPrecision;
round = defRound;
}
/// Copy constructor
OGRWktOptions(const OGRWktOptions&) = default;
private:
static int getDefaultPrecision();
static bool getDefaultRound();
};
/**
* Simple container for a position.
*/
class OGRRawPoint
{
public:
/** Constructor */
OGRRawPoint() : x(0.0), y(0.0) {}
/** Constructor */
OGRRawPoint(double xIn, double yIn) : x(xIn), y(yIn) {}
/** x */
double x;
/** y */
double y;
};
/** GEOS geometry type */
typedef struct GEOSGeom_t *GEOSGeom;
/** GEOS context handle type */
typedef struct GEOSContextHandle_HS *GEOSContextHandle_t;
/** SFCGAL geometry type */
typedef void sfcgal_geometry_t;
class OGRPoint;
class OGRCurve;
class OGRCompoundCurve;
class OGRSimpleCurve;
class OGRLinearRing;
class OGRLineString;
class OGRCircularString;
class OGRSurface;
class OGRCurvePolygon;
class OGRPolygon;
class OGRMultiPoint;
class OGRMultiSurface;
class OGRMultiPolygon;
class OGRMultiCurve;
class OGRMultiLineString;
class OGRGeometryCollection;
class OGRTriangle;
class OGRPolyhedralSurface;
class OGRTriangulatedSurface;
//! @cond Doxygen_Suppress
typedef OGRLineString* (*OGRCurveCasterToLineString)(OGRCurve*);
typedef OGRLinearRing* (*OGRCurveCasterToLinearRing)(OGRCurve*);
typedef OGRPolygon* (*OGRSurfaceCasterToPolygon)(OGRSurface*);
typedef OGRCurvePolygon* (*OGRSurfaceCasterToCurvePolygon)(OGRSurface*);
typedef OGRMultiPolygon* (*OGRPolyhedralSurfaceCastToMultiPolygon)(OGRPolyhedralSurface*);
//! @endcond
/** OGRGeometry visitor interface.
* @since GDAL 2.3
*/
class CPL_DLL IOGRGeometryVisitor
{
public:
/** Destructor/ */
virtual ~IOGRGeometryVisitor() = default;
/** Visit OGRPoint. */
virtual void visit(OGRPoint*) = 0;
/** Visit OGRLineString. */
virtual void visit(OGRLineString*) = 0;
/** Visit OGRLinearRing. */
virtual void visit(OGRLinearRing*) = 0;
/** Visit OGRPolygon. */
virtual void visit(OGRPolygon*) = 0;
/** Visit OGRMultiPoint. */
virtual void visit(OGRMultiPoint*) = 0;
/** Visit OGRMultiLineString. */
virtual void visit(OGRMultiLineString*) = 0;
/** Visit OGRMultiPolygon. */
virtual void visit(OGRMultiPolygon*) = 0;
/** Visit OGRGeometryCollection. */
virtual void visit(OGRGeometryCollection*) = 0;
/** Visit OGRCircularString. */
virtual void visit(OGRCircularString*) = 0;
/** Visit OGRCompoundCurve. */
virtual void visit(OGRCompoundCurve*) = 0;
/** Visit OGRCurvePolygon. */
virtual void visit(OGRCurvePolygon*) = 0;
/** Visit OGRMultiCurve. */
virtual void visit(OGRMultiCurve*) = 0;
/** Visit OGRMultiSurface. */
virtual void visit(OGRMultiSurface*) = 0;
/** Visit OGRTriangle. */
virtual void visit(OGRTriangle*) = 0;
/** Visit OGRPolyhedralSurface. */
virtual void visit(OGRPolyhedralSurface*) = 0;
/** Visit OGRTriangulatedSurface. */
virtual void visit(OGRTriangulatedSurface*) = 0;
};
/** OGRGeometry visitor default implementation.
*
* This default implementation will recurse down to calling
* visit(OGRPoint*) on each point.
*
* @since GDAL 2.3
*/
class CPL_DLL OGRDefaultGeometryVisitor: public IOGRGeometryVisitor
{
void _visit(OGRSimpleCurve* poGeom);
public:
void visit(OGRPoint*) override {}
void visit(OGRLineString*) override;
void visit(OGRLinearRing*) override;
void visit(OGRPolygon*) override;
void visit(OGRMultiPoint*) override;
void visit(OGRMultiLineString*) override;
void visit(OGRMultiPolygon*) override;
void visit(OGRGeometryCollection*) override;
void visit(OGRCircularString*) override;
void visit(OGRCompoundCurve*) override;
void visit(OGRCurvePolygon*) override;
void visit(OGRMultiCurve*) override;
void visit(OGRMultiSurface*) override;
void visit(OGRTriangle*) override;
void visit(OGRPolyhedralSurface*) override;
void visit(OGRTriangulatedSurface*) override;
};
/** OGRGeometry visitor interface.
* @since GDAL 2.3
*/
class CPL_DLL IOGRConstGeometryVisitor
{
public:
/** Destructor/ */
virtual ~IOGRConstGeometryVisitor() = default;
/** Visit OGRPoint. */
virtual void visit(const OGRPoint*) = 0;
/** Visit OGRLineString. */
virtual void visit(const OGRLineString*) = 0;
/** Visit OGRLinearRing. */
virtual void visit(const OGRLinearRing*) = 0;
/** Visit OGRPolygon. */
virtual void visit(const OGRPolygon*) = 0;
/** Visit OGRMultiPoint. */
virtual void visit(const OGRMultiPoint*) = 0;
/** Visit OGRMultiLineString. */
virtual void visit(const OGRMultiLineString*) = 0;
/** Visit OGRMultiPolygon
翰墨之道
- 粉丝: 3619
- 资源: 182
最新资源
- Matlab实现TCN-RVM时间卷积神经网络结合相关向量机多变量时间序列预测(含完整的程序,GUI设计和代码详解)
- 光伏储能三相PQ恒功率并网控制仿真(附参考文献及文档) ①网侧:采用PQ恒功率控制 参考文献《-微电网及其逆变器控制技术的研究》 ②储能控制:直流母线电压外环,电池电流内环双闭环控制策略直流母线电压
- Matlab实现BO-LSSVM贝叶斯算法优化最小二乘支持向量机时间序列预测(含完整的程序,GUI设计和代码详解)
- Matlab实现RF-Adaboost随机森林结合Adaboost多变量时间序列预测(含完整的程序,GUI设计和代码详解)
- 升级版Matlab基于A*算法的多agv路径规划仿真系统,地图自定义导入,改进A*算法平滑了路径,系统可输出路径长度,每个时间的点的坐标,多agv路径规划时输出时空图 升级点:增加了单机器人四方向路径
- 基于海康威视的代码进行目标检测与跟踪的python源码+全部资料.zip
- 电力系统风储联合一次调频MATLAB仿真模型 四机两区系统,采用频域模型法使得风电渗透率25%,附加惯性控制,储能附加下垂控制,参与系统一次调频,频率特性good
- 自动转板机sw17可编辑全套技术资料100%好用.zip
- 国际知名大厂的两个逆向ADC电路,都是采用的标准单元库器件,可以直接导入到cadence环境下打开模数转器 124bit sigma-delta ADC ads8681 216bit sar
- 无刷双馈电机 BDFM&BDFIG 电动机和发电机模型都有 发电机采用了两种不同的模型搭建方法 仿真结果验证可靠无误 图5是复现某篇lunwen的电机控制算法的模型(控制部分额外)
- comsol双温模型脉冲移动激光 耦合应力场 二维三维
- 光伏储能三相PQ恒功率并网控制仿真(附参考文献及文档) ①网侧:采用PQ恒功率控制,参考文献《-微电网及其逆变器控制技术的研究》 ②储能控制:直流母线电压外环,电池电流内环双闭环控制策略直流母线电压
- 模型预测控制(MPC)buck变器模型预测控制,MMC-HVDC 仿真,MPC轨迹跟踪,各种有关mpc的学习文件,代码算例
- 七自由度车辆动力学Matlab simulink仿真模型 dugoff轮胎模型 具体内容包含simulink模型+说明文档41 附赠二 三自由度车辆动力学仿真模型,MATLAB软件
- 360度紫外激光剥漆 stp全套技术资料100%好用.zip
- 14bit 100M sar adc matlab建模
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈