点集压缩算法,douglas-peucker,Radial distance,Nth point等。使用win7,VS2013,Qt5.5.1,64位编译。对原程序作了Qt适应性修改。psimpl_v7_win32_demosrcdemox64Debug下的程序可直接运行,裸机已实验
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4521 2011-06-24 14:56 psimpl_v7_win32_demodocannotated.html
文件 705 2011-06-24 14:56 psimpl_v7_win32_demodocc_s.png
文件 5102 2011-06-24 14:56 psimpl_v7_win32_demodocclasses.html
文件 5512 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1util_1_1scoped__array-members.html
文件 13941 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1util_1_1scoped__array.html
文件 11038 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1_polyline_simplification-members.html
文件 75500 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1_polyline_simplification.html
文件 4302 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1_polyline_simplification_1_1_d_p_helper-members.html
文件 16259 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1_polyline_simplification_1_1_d_p_helper.html
文件 126 2011-06-24 14:56 psimpl_v7_win32_demodocclosed.png
文件 2400 2011-06-24 14:56 psimpl_v7_win32_demodocdirs.html
文件 2697 2011-06-24 14:56 psimpl_v7_win32_demodocdir_f9993e17f36afaef24d7a404e932861e.html
文件 12350 2011-06-24 14:56 psimpl_v7_win32_demodocdoxygen.css
文件 3942 2011-06-24 14:56 psimpl_v7_win32_demodocdoxygen.png
文件 2650 2011-06-24 14:56 psimpl_v7_win32_demodocfiles.html
文件 82 2011-06-24 14:56 psimpl_v7_win32_demodocftv2blank.png
文件 762 2011-06-24 14:56 psimpl_v7_win32_demodocftv2doc.png
文件 598 2011-06-24 14:56 psimpl_v7_win32_demodocftv2folderclosed.png
文件 590 2011-06-24 14:56 psimpl_v7_win32_demodocftv2folderopen.png
文件 82 2011-06-24 14:56 psimpl_v7_win32_demodocftv2lastnode.png
文件 762 2011-06-24 14:56 psimpl_v7_win32_demodocftv2link.png
文件 221 2011-06-24 14:56 psimpl_v7_win32_demodocftv2mlastnode.png
文件 221 2011-06-24 14:56 psimpl_v7_win32_demodocftv2mnode.png
文件 82 2011-06-24 14:56 psimpl_v7_win32_demodocftv2node.png
文件 215 2011-06-24 14:56 psimpl_v7_win32_demodocftv2plastnode.png
文件 215 2011-06-24 14:56 psimpl_v7_win32_demodocftv2pnode.png
文件 249 2011-06-24 14:56 psimpl_v7_win32_demodocftv2splitbar.png
文件 82 2011-06-24 14:56 psimpl_v7_win32_demodocftv2vertline.png
文件 14114 2011-06-24 14:56 psimpl_v7_win32_demodocfunctions.html
文件 10646 2011-06-24 14:56 psimpl_v7_win32_demodocfunctions_func.html
............此处省略146个文件信息
/* ***** 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_demodocannotated.html
文件 705 2011-06-24 14:56 psimpl_v7_win32_demodocc_s.png
文件 5102 2011-06-24 14:56 psimpl_v7_win32_demodocclasses.html
文件 5512 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1util_1_1scoped__array-members.html
文件 13941 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1util_1_1scoped__array.html
文件 11038 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1_polyline_simplification-members.html
文件 75500 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1_polyline_simplification.html
文件 4302 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1_polyline_simplification_1_1_d_p_helper-members.html
文件 16259 2011-06-24 14:56 psimpl_v7_win32_demodocclasspsimpl_1_1_polyline_simplification_1_1_d_p_helper.html
文件 126 2011-06-24 14:56 psimpl_v7_win32_demodocclosed.png
文件 2400 2011-06-24 14:56 psimpl_v7_win32_demodocdirs.html
文件 2697 2011-06-24 14:56 psimpl_v7_win32_demodocdir_f9993e17f36afaef24d7a404e932861e.html
文件 12350 2011-06-24 14:56 psimpl_v7_win32_demodocdoxygen.css
文件 3942 2011-06-24 14:56 psimpl_v7_win32_demodocdoxygen.png
文件 2650 2011-06-24 14:56 psimpl_v7_win32_demodocfiles.html
文件 82 2011-06-24 14:56 psimpl_v7_win32_demodocftv2blank.png
文件 762 2011-06-24 14:56 psimpl_v7_win32_demodocftv2doc.png
文件 598 2011-06-24 14:56 psimpl_v7_win32_demodocftv2folderclosed.png
文件 590 2011-06-24 14:56 psimpl_v7_win32_demodocftv2folderopen.png
文件 82 2011-06-24 14:56 psimpl_v7_win32_demodocftv2lastnode.png
文件 762 2011-06-24 14:56 psimpl_v7_win32_demodocftv2li
文件 221 2011-06-24 14:56 psimpl_v7_win32_demodocftv2mlastnode.png
文件 221 2011-06-24 14:56 psimpl_v7_win32_demodocftv2mnode.png
文件 82 2011-06-24 14:56 psimpl_v7_win32_demodocftv2node.png
文件 215 2011-06-24 14:56 psimpl_v7_win32_demodocftv2plastnode.png
文件 215 2011-06-24 14:56 psimpl_v7_win32_demodocftv2pnode.png
文件 249 2011-06-24 14:56 psimpl_v7_win32_demodocftv2splitbar.png
文件 82 2011-06-24 14:56 psimpl_v7_win32_demodocftv2vertline.png
文件 14114 2011-06-24 14:56 psimpl_v7_win32_demodocfunctions.html
文件 10646 2011-06-24 14:56 psimpl_v7_win32_demodocfunctions_func.html
............此处省略146个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)