资源简介
点集压缩算法,douglas-peucker,Radial distance,Nth point等。使用win7,VS2013,Qt5.5.1,64位编译。对原程序作了Qt适应性修改。psimpl_v7_win32_demo\src\demo\x64\Debug下的程序可直接运行,裸机已实验
代码片段和文件信息
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the “License“); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an “AS IS“ basis
* WITHOUT WARRANTY OF ANY KIND either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is
* ‘psimpl - generic n-dimensional polyline simplification‘.
*
* The Initial Developer of the Original Code is
* Elmar de Koning.
* Portions created by the Initial Developer are Copyright (C) 2010-2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* ***** END LICENSE BLOCK ***** */
/*
psimpl - generic n-dimensional polyline simplification
Copyright (C) 2010-2011 Elmar de Koning edekoning@gmail.com
This file is part of psimpl and is hosted at SourceForge:
http://sourceforge.net/projects/psimpl/
*/
#include “DPWorker.h“
#include “psimpl_reference.h“
#include “../lib/psimpl.h“
#include
#include
namespace psimpl {
DPWorker::DPWorker (Qobject* inParent) :
Qobject (inParent)
{
// note: disable this line during testing
srand ((unsigned)QTime::currentTime ().msec ());
}
void DPWorker::Generate (int inCount) {
emit SignalGeneratingPolyline ();
QTime t;
t.start ();
mGeneratedCoords.resize (inCount*2);
mSimplifiedCoords.clear ();
qreal miny = inCount;
qreal maxy = -inCount;
const qreal PI = std::atan (1.0) * 4;
qreal step = 2 * PI / inCount;
int a = 1 + (rand () % 2); // [1 3]
int b = 2 + (rand () % 3); // [2 5]
int c = 3 + (rand () % 7); // [3 10]
// generate a random line
for (int i=0; i mGeneratedCoords [i*2] = i;
qreal tmp1 = cos (step * i * a) / 3;
qreal tmp2 = sin (step * i * b) / 5;
qreal tmp3 = sin (step * i * c) / 10;
mGeneratedCoords [i*2+1] = tmp1 + tmp2 + tmp3;
miny = qMin (miny mGeneratedCoords [i*2+1]);
maxy = qMax (maxy mGeneratedCoords [i*2+1]);
}
// translate the line to (00) and scale the line to (2 * inCount inCount)
qreal scaley = (inCount-1) / (maxy-miny);
for (int i=0; i mGeneratedCoords [i*2+1] = (mGeneratedCoords [i*2+1] - miny) * 0.5 * scaley;
}
//mGeneratedCoords.push_back(0);
emit SignalGeneratedPolyline (t.elapsed () mGeneratedCoords);
}
void DPWorker::SimplifyNP (Container cont int n) {
QTime t;
int duration = 0;
mSimpli
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4521 2011-06-24 14:56 psimpl_v7_win32_demo\doc\annotated.html
文件 705 2011-06-24 14:56 psimpl_v7_win32_demo\doc\bc_s.png
文件 5102 2011-06-24 14:56 psimpl_v7_win32_demo\doc\classes.html
文件 5512 2011-06-24 14:56 psimpl_v7_win32_demo\doc\classpsimpl_1_1util_1_1scoped__array-members.html
文件 13941 2011-06-24 14:56 psimpl_v7_win32_demo\doc\classpsimpl_1_1util_1_1scoped__array.html
文件 11038 2011-06-24 14:56 psimpl_v7_win32_demo\doc\classpsimpl_1_1_polyline_simplification-members.html
文件 75500 2011-06-24 14:56 psimpl_v7_win32_demo\doc\classpsimpl_1_1_polyline_simplification.html
文件 4302 2011-06-24 14:56 psimpl_v7_win32_demo\doc\classpsimpl_1_1_polyline_simplification_1_1_d_p_helper-members.html
文件 16259 2011-06-24 14:56 psimpl_v7_win32_demo\doc\classpsimpl_1_1_polyline_simplification_1_1_d_p_helper.html
文件 126 2011-06-24 14:56 psimpl_v7_win32_demo\doc\closed.png
文件 2400 2011-06-24 14:56 psimpl_v7_win32_demo\doc\dirs.html
文件 2697 2011-06-24 14:56 psimpl_v7_win32_demo\doc\dir_f9993e17f36afaef24d7a404e932861e.html
文件 12350 2011-06-24 14:56 psimpl_v7_win32_demo\doc\doxygen.css
文件 3942 2011-06-24 14:56 psimpl_v7_win32_demo\doc\doxygen.png
文件 2650 2011-06-24 14:56 psimpl_v7_win32_demo\doc\files.html
文件 82 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2blank.png
文件 762 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2doc.png
文件 598 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2folderclosed.png
文件 590 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2folderopen.png
文件 82 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2lastnode.png
文件 762 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2li
文件 221 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2mlastnode.png
文件 221 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2mnode.png
文件 82 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2node.png
文件 215 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2plastnode.png
文件 215 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2pnode.png
文件 249 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2splitbar.png
文件 82 2011-06-24 14:56 psimpl_v7_win32_demo\doc\ftv2vertline.png
文件 14114 2011-06-24 14:56 psimpl_v7_win32_demo\doc\functions.html
文件 10646 2011-06-24 14:56 psimpl_v7_win32_demo\doc\functions_func.html
............此处省略146个文件信息
- 上一篇:智慧城市技术白皮书
- 下一篇:线性代数及其应用英文第四版—20180803.zip
相关资源
- COM原理与应用.pdf
- Qt 5开发及第4版陆文周.zip
- QT Css设计器
- 类似qq的交流工具
- OpenGL编程指南 第九版英文版 OpenGL P
- IP包捕获与解析
- cmake-3.16.0-rc1-win64-x64.zip
- 机器鱼的结构设计与组装
- 匠心精作C 从0到1入门编程-学习编程
-
基于qt的qmediapla
yer类实现的一个播放 - MongoDB电子考试系统
- opengl编程指南第七版
- 去除反光干扰
- 《编译原理第二版》完整版
- PCLint9.0L修正版
- C ++ Builder 5程序设计大全,PDF版本,
- 多人聊天小程序
- opencv一维码识别
- 基于windows的蓝牙通信
- 基于windows的蓝牙扫描、连接、通讯
- 泊松重建代码
- boost库开发范例大全
- 基于qt实现的minidraw画板程序
- VS2013做的推箱子含源码
- VS2013 做的简单的贪吃蛇含源码
- 多功能网络媒体播放器-Qt-demo
- 坦克大战可执行程序-windows
- 炫彩气泡--win32实现透明不规则窗口
- amCap工具源码
- 基于opencv的三种人脸识别
评论
共有 条评论