diff --git a/lib/psimpl-js/Makefile b/lib/psimpl-js/Makefile index 1ad5f85..dfcb219 100644 --- a/lib/psimpl-js/Makefile +++ b/lib/psimpl-js/Makefile @@ -10,5 +10,4 @@ psimpl.wasm psimpl.js: psimpl.cpp -s MODULARIZE=1 \ -s EXPORT_ES6=1 \ -o psimpl.js \ - -I ../ \ psimpl.cpp diff --git a/lib/psimpl-js/psimpl.cpp b/lib/psimpl-js/psimpl.cpp index b3d91bf..17b4c70 100644 --- a/lib/psimpl-js/psimpl.cpp +++ b/lib/psimpl-js/psimpl.cpp @@ -1,7 +1,7 @@ #include #include #include -#include "psimpl/psimpl.h" +#include "../psimpl_v7_src/psimpl.h" using namespace emscripten; diff --git a/lib/psimpl/demo/DPWorker.cpp b/lib/psimpl/demo/DPWorker.cpp deleted file mode 100644 index e080ed8..0000000 --- a/lib/psimpl/demo/DPWorker.cpp +++ /dev/null @@ -1,782 +0,0 @@ -/* ***** 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 (begin, end, n, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - // done - emit SignalCleaningConvertedPolyline (); - delete [] generatedPoints; - break; - } - case QVECTOR_DOUBLE: - { - // simplify - emit SignalSimplifyingPolyline (); - QVector ::const_iterator begin = mGeneratedCoords.constBegin (); - QVector ::const_iterator end = mGeneratedCoords.constEnd (); - t.start (); - simplify_nth_point <2> (begin, end, n, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - break; - } - case VECTOR_DOUBLE: - { - // convert - emit SignalConvertingPolyline (); - std::vector generatedPoints = mGeneratedCoords.toStdVector (); - // simplify - emit SignalSimplifyingPolyline (); - std::vector ::const_iterator begin = generatedPoints.begin (); - std::vector ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_nth_point <2> (begin, end, n, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - case LIST_LONGLONG: - { - // convert - emit SignalConvertingPolyline (); - std::list generatedPoints; - foreach (double coord, mGeneratedCoords) { - generatedPoints.push_back (coord); - } - // simplify - emit SignalSimplifyingPolyline (); - std::list ::const_iterator begin = generatedPoints.begin (); - std::list ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_nth_point <2> (begin, end, n, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - default: - break; - } - DoSignalSimplifiedPolyline (duration); - } - - void DPWorker::SimplifyRD (Container cont, QString tol) { - QTime t; - int duration = 0; - - mSimplifiedCoords.clear (); - - switch (cont) { - case ARRAY_FLOAT: - { - // convert - emit SignalConvertingPolyline (); - float* generatedPoints = new float [mGeneratedCoords.size ()]; - for (int c=0; c (begin, end, tol.toFloat(), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - // done - emit SignalCleaningConvertedPolyline (); - delete [] generatedPoints; - break; - } - case QVECTOR_DOUBLE: - { - // simplify - emit SignalSimplifyingPolyline (); - QVector ::const_iterator begin = mGeneratedCoords.constBegin (); - QVector ::const_iterator end = mGeneratedCoords.constEnd (); - t.start (); - simplify_radial_distance <2> (begin, end, tol.toDouble (), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - break; - } - case VECTOR_DOUBLE: - { - // convert - emit SignalConvertingPolyline (); - std::vector generatedPoints = mGeneratedCoords.toStdVector (); - // simplify - emit SignalSimplifyingPolyline (); - std::vector ::const_iterator begin = generatedPoints.begin (); - std::vector ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_radial_distance <2> (begin, end, tol.toDouble (), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - case LIST_LONGLONG: - { - // convert - emit SignalConvertingPolyline (); - std::list generatedPoints; - foreach (double coord, mGeneratedCoords) { - generatedPoints.push_back (coord); - } - // simplify - emit SignalSimplifyingPolyline (); - std::list ::const_iterator begin = generatedPoints.begin (); - std::list ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_radial_distance <2> (begin, end, tol.toLongLong (), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - default: - break; - } - DoSignalSimplifiedPolyline (duration); - } - - void DPWorker::SimplifyPD (Container cont, QString tol, int repeat) { - QTime t; - int duration = 0; - - mSimplifiedCoords.clear (); - - switch (cont) { - case ARRAY_FLOAT: - { - // convert - emit SignalConvertingPolyline (); - float* generatedPoints = new float [mGeneratedCoords.size ()]; - for (int c=0; c (begin, end, tol.toFloat(), repeat, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - // done - emit SignalCleaningConvertedPolyline (); - delete [] generatedPoints; - break; - } - case QVECTOR_DOUBLE: - { - // simplify - emit SignalSimplifyingPolyline (); - QVector ::const_iterator begin = mGeneratedCoords.constBegin (); - QVector ::const_iterator end = mGeneratedCoords.constEnd (); - t.start (); - simplify_perpendicular_distance <2> (begin, end, tol.toDouble (), repeat, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - break; - } - case VECTOR_DOUBLE: - { - // convert - emit SignalConvertingPolyline (); - std::vector generatedPoints = mGeneratedCoords.toStdVector (); - // simplify - emit SignalSimplifyingPolyline (); - std::vector ::const_iterator begin = generatedPoints.begin (); - std::vector ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_perpendicular_distance <2> (begin, end, tol.toDouble (), repeat, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - case LIST_LONGLONG: - { - // convert - emit SignalConvertingPolyline (); - std::list generatedPoints; - foreach (double coord, mGeneratedCoords) { - generatedPoints.push_back (coord); - } - // simplify - emit SignalSimplifyingPolyline (); - std::list ::const_iterator begin = generatedPoints.begin (); - std::list ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_perpendicular_distance <2> (begin, end, tol.toLongLong (), repeat, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - default: - break; - } - DoSignalSimplifiedPolyline (duration); - } - - void DPWorker::SimplifyRW (Container cont, QString tol) - { - QTime t; - int duration = 0; - - mSimplifiedCoords.clear (); - - switch (cont) { - case ARRAY_FLOAT: - { - // convert - emit SignalConvertingPolyline (); - float* generatedPoints = new float [mGeneratedCoords.size ()]; - for (int c=0; c (begin, end, tol.toFloat(), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - // done - emit SignalCleaningConvertedPolyline (); - delete [] generatedPoints; - break; - } - case QVECTOR_DOUBLE: - { - // simplify - emit SignalSimplifyingPolyline (); - QVector ::const_iterator begin = mGeneratedCoords.constBegin (); - QVector ::const_iterator end = mGeneratedCoords.constEnd (); - t.start (); - simplify_reumann_witkam <2> (begin, end, tol.toDouble (), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - break; - } - case VECTOR_DOUBLE: - { - // convert - emit SignalConvertingPolyline (); - std::vector generatedPoints = mGeneratedCoords.toStdVector (); - // simplify - emit SignalSimplifyingPolyline (); - std::vector ::const_iterator begin = generatedPoints.begin (); - std::vector ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_reumann_witkam <2> (begin, end, tol.toDouble (), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - case LIST_LONGLONG: - { - // convert - emit SignalConvertingPolyline (); - std::list generatedPoints; - foreach (double coord, mGeneratedCoords) { - generatedPoints.push_back (coord); - } - // simplify - emit SignalSimplifyingPolyline (); - std::list ::const_iterator begin = generatedPoints.begin (); - std::list ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_reumann_witkam <2> (begin, end, tol.toLongLong (), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - default: - break; - } - DoSignalSimplifiedPolyline (duration); - } - - void DPWorker::SimplifyOp (Container cont, QString minTol, QString maxTol) { - QTime t; - int duration = 0; - - mSimplifiedCoords.clear (); - - switch (cont) { - case ARRAY_FLOAT: - { - // convert - emit SignalConvertingPolyline (); - float* generatedPoints = new float [mGeneratedCoords.size ()]; - for (int c=0; c (begin, end, minTol.toFloat(), maxTol.toFloat(), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - // done - emit SignalCleaningConvertedPolyline (); - delete [] generatedPoints; - break; - } - case QVECTOR_DOUBLE: - { - // simplify - emit SignalSimplifyingPolyline (); - QVector ::const_iterator begin = mGeneratedCoords.constBegin (); - QVector ::const_iterator end = mGeneratedCoords.constEnd (); - t.start (); - simplify_opheim <2> (begin, end, minTol.toDouble(), maxTol.toDouble(), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - break; - } - case VECTOR_DOUBLE: - { - // convert - emit SignalConvertingPolyline (); - std::vector generatedPoints = mGeneratedCoords.toStdVector (); - // simplify - emit SignalSimplifyingPolyline (); - std::vector ::const_iterator begin = generatedPoints.begin (); - std::vector ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_opheim <2> (begin, end, minTol.toDouble(), maxTol.toDouble(), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - case LIST_LONGLONG: - { - // convert - emit SignalConvertingPolyline (); - std::list generatedPoints; - foreach (double coord, mGeneratedCoords) { - generatedPoints.push_back (coord); - } - // simplify - emit SignalSimplifyingPolyline (); - std::list ::const_iterator begin = generatedPoints.begin (); - std::list ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_opheim <2> (begin, end, minTol.toLongLong(), maxTol.toLongLong(), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - default: - break; - } - DoSignalSimplifiedPolyline (duration); - } - - void DPWorker::SimplifyLa (Container cont, QString tol, int size) { - QTime t; - int duration = 0; - - mSimplifiedCoords.clear (); - - switch (cont) { - case ARRAY_FLOAT: - { - // convert - emit SignalConvertingPolyline (); - float* generatedPoints = new float [mGeneratedCoords.size ()]; - for (int c=0; c (begin, end, tol.toFloat(), size, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - // done - emit SignalCleaningConvertedPolyline (); - delete [] generatedPoints; - break; - } - case QVECTOR_DOUBLE: - { - // simplify - emit SignalSimplifyingPolyline (); - QVector ::const_iterator begin = mGeneratedCoords.constBegin (); - QVector ::const_iterator end = mGeneratedCoords.constEnd (); - t.start (); - simplify_lang <2> (begin, end, tol.toDouble(), size, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - break; - } - case VECTOR_DOUBLE: - { - // convert - emit SignalConvertingPolyline (); - std::vector generatedPoints = mGeneratedCoords.toStdVector (); - // simplify - emit SignalSimplifyingPolyline (); - std::vector ::const_iterator begin = generatedPoints.begin (); - std::vector ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_lang <2> (begin, end, tol.toDouble(), size, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - case LIST_LONGLONG: - { - // convert - emit SignalConvertingPolyline (); - std::list generatedPoints; - foreach (double coord, mGeneratedCoords) { - generatedPoints.push_back (coord); - } - // simplify - emit SignalSimplifyingPolyline (); - std::list ::const_iterator begin = generatedPoints.begin (); - std::list ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_lang <2> (begin, end, tol.toLongLong(), size, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - default: - break; - } - DoSignalSimplifiedPolyline (duration); - } - - void DPWorker::SimplifyDP (Container cont, QString tol) { - QTime t; - int duration = 0; - - mSimplifiedCoords.clear (); - - switch (cont) { - case ARRAY_FLOAT: - { - // convert - emit SignalConvertingPolyline (); - float* generatedPoints = new float [mGeneratedCoords.size ()]; - for (int c=0; c (begin, end, tol.toFloat(), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - // done - emit SignalCleaningConvertedPolyline (); - delete [] generatedPoints; - break; - } - case QVECTOR_DOUBLE: - { - // simplify - emit SignalSimplifyingPolyline (); - QVector ::const_iterator begin = mGeneratedCoords.constBegin (); - QVector ::const_iterator end = mGeneratedCoords.constEnd (); - t.start (); - simplify_douglas_peucker <2> (begin, end, tol.toDouble (), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - break; - } - case VECTOR_DOUBLE: - { - // convert - emit SignalConvertingPolyline (); - std::vector generatedPoints = mGeneratedCoords.toStdVector (); - // simplify - emit SignalSimplifyingPolyline (); - std::vector ::const_iterator begin = generatedPoints.begin (); - std::vector ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_douglas_peucker <2> (begin, end, tol.toDouble (), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - case LIST_LONGLONG: - { - // convert - emit SignalConvertingPolyline (); - std::list generatedPoints; - foreach (double coord, mGeneratedCoords) { - generatedPoints.push_back (coord); - } - // simplify - emit SignalSimplifyingPolyline (); - std::list ::const_iterator begin = generatedPoints.begin (); - std::list ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_douglas_peucker <2> (begin, end, tol.toLongLong (), - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - default: - break; - } - DoSignalSimplifiedPolyline (duration); - } - - void DPWorker::SimplifyDP_variant (Container cont, int count) { - QTime t; - int duration = 0; - - mSimplifiedCoords.clear (); - - switch (cont) { - case ARRAY_FLOAT: - { - // convert - emit SignalConvertingPolyline (); - float* generatedPoints = new float [mGeneratedCoords.size ()]; - for (int c=0; c (begin, end, count, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - // done - emit SignalCleaningConvertedPolyline (); - delete [] generatedPoints; - break; - } - case QVECTOR_DOUBLE: - { - // simplify - emit SignalSimplifyingPolyline (); - QVector ::const_iterator begin = mGeneratedCoords.constBegin (); - QVector ::const_iterator end = mGeneratedCoords.constEnd (); - t.start (); - simplify_douglas_peucker_n <2> (begin, end, count, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - break; - } - case VECTOR_DOUBLE: - { - // convert - emit SignalConvertingPolyline (); - std::vector generatedPoints = mGeneratedCoords.toStdVector (); - // simplify - emit SignalSimplifyingPolyline (); - std::vector ::const_iterator begin = generatedPoints.begin (); - std::vector ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_douglas_peucker_n <2> (begin, end, count, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - case LIST_LONGLONG: - { - // convert - emit SignalConvertingPolyline (); - std::list generatedPoints; - foreach (double coord, mGeneratedCoords) { - generatedPoints.push_back (coord); - } - // simplify - emit SignalSimplifyingPolyline (); - std::list ::const_iterator begin = generatedPoints.begin (); - std::list ::const_iterator end = generatedPoints.end (); - t.start (); - simplify_douglas_peucker_n <2> (begin, end, count, - std::back_inserter (mSimplifiedCoords)); - duration = t.elapsed (); - emit SignalCleaningConvertedPolyline (); - break; - } - default: - break; - } - DoSignalSimplifiedPolyline (duration); - } - - void DPWorker::SimplifyDP_reference (QString tol) { - mSimplifiedCoords.clear(); - // convert generated polyline to Point array - emit SignalConvertingPolyline (); - int pointCount = mGeneratedCoords.size () / 2; - classic::Point* generatedPoints = new classic::Point [pointCount]; - classic::Point* simplifiedPoints = new classic::Point [pointCount]; - for (int i=0; i ( - mGeneratedCoords.constBegin (), mGeneratedCoords.constEnd (), - mSimplifiedCoords.constBegin (), mSimplifiedCoords.constEnd (), &validStatistics); - - if (validStatistics) { - emit SignalSimplifiedPolyline (duration, mSimplifiedCoords, stats.max, stats.sum, stats.mean, stats.std); - } - else { - emit SignalSimplifiedPolyline (duration, mSimplifiedCoords); - } - } -} // namespace psimpl diff --git a/lib/psimpl/demo/DPWorker.h b/lib/psimpl/demo/DPWorker.h deleted file mode 100644 index 914e881..0000000 --- a/lib/psimpl/demo/DPWorker.h +++ /dev/null @@ -1,101 +0,0 @@ -/* ***** 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/ -*/ - -#ifndef DPWORKER_H -#define DPWORKER_H - - -#include -#include - - -namespace psimpl { - typedef enum CONTAINER - { - ARRAY_FLOAT, - QVECTOR_DOUBLE, - VECTOR_DOUBLE, - LIST_LONGLONG, - } Container; - - /*! - \brief Worker class for generating and simplifying polylines. - - Polylines are always generated in a QVector container. Before simplification the - polyline is converted to the specified container type. This allows for easy adding of new - container types. - - */ - class DPWorker : public QObject - { - Q_OBJECT - - public: - DPWorker (QObject* inParent = 0); - - void Generate (int inCount); - void SimplifyNP (Container cont, int n); - void SimplifyRD (Container cont, QString tol); - void SimplifyPD (Container cont, QString tol, int repeat); - void SimplifyRW (Container cont, QString tol); - void SimplifyOp (Container cont, QString minTol, QString maxTol); - void SimplifyLa (Container cont, QString tol, int size); - void SimplifyDP (Container cont, QString tol); - void SimplifyDP_variant (Container cont, int count); - void SimplifyDP_reference (QString tol); - - int GetGeneratedPointCount () { return mGeneratedCoords.size () / 2; } - int GetSimplifiedGeneratedPointCount () { return mSimplifiedCoords.size () / 2; } - - private: - void DoSignalSimplifiedPolyline (qreal duration); - - signals: - void SignalGeneratingPolyline (); - void SignalConvertingPolyline (); - void SignalSimplifyingPolyline (); - void SignalCleaningConvertedPolyline (); - - void SignalGeneratedPolyline (int duration, QVector & polyline); - void SignalSimplifiedPolyline (int duration, QVector & polyline); - void SignalSimplifiedPolyline (int duration, QVector & polyline, double max, double sum, double mean, double std); - - private: - QVector mGeneratedCoords; - QVector mSimplifiedCoords; - }; - -} // namespace psimpl - - -#endif // DPWORKER_H diff --git a/lib/psimpl/demo/MainWindow.cpp b/lib/psimpl/demo/MainWindow.cpp deleted file mode 100644 index 1df1981..0000000 --- a/lib/psimpl/demo/MainWindow.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* ***** 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 "MainWindow.h" -#include "ui_MainWindow.h" -#include "DPWorker.h" -#include -#include - - -namespace psimpl { - - MainWindow::MainWindow (QWidget *parent) : - QMainWindow (parent), - ui (new Ui::MainWindow) - { - mWorker = new DPWorker (this); - - ui->setupUi (this); - ui->polyTypeComboBox->setCurrentIndex(VECTOR_DOUBLE); - -#ifndef _DEBUG - ui->algorithmComboBox->removeItem (DOUGLAS_PEUCKER_REFERENCE); -#endif - connect (mWorker, SIGNAL (SignalGeneratingPolyline ()), - this, SLOT (SlotGeneratingPolyline ())); - connect (mWorker, SIGNAL (SignalConvertingPolyline ()), - this, SLOT (SlotConvertingPolyline ())); - connect (mWorker, SIGNAL (SignalSimplifyingPolyline ()), - this, SLOT (SlotSimplifyingPolyline ())); - connect (mWorker, SIGNAL (SignalCleaningConvertedPolyline ()), - this, SLOT (SlotCleaningConvertedPolyline ())); - - connect (mWorker, SIGNAL (SignalGeneratedPolyline (int, QVector &)), - this, SLOT (SlotGeneratedPolyline (int, QVector &))); - connect (mWorker, SIGNAL (SignalSimplifiedPolyline (int, QVector &)), - this, SLOT (SlotSimplifiedPolyline (int, QVector &))); - connect (mWorker, SIGNAL (SignalSimplifiedPolyline (int, QVector &, double, double, double, double)), - this, SLOT (SlotSimplifiedPolyline (int, QVector &, double, double, double, double))); - } - - MainWindow::~MainWindow () - { - delete ui; - delete mWorker; - } - - void MainWindow::changeEvent (QEvent *e) - { - QMainWindow::changeEvent (e); - - switch (e->type ()) { - case QEvent::LanguageChange: - ui->retranslateUi (this); - break; - - default: - break; - } - } - - void MainWindow::EnableButtons () - { - ui->generatePushButton->setEnabled (true); - ui->simplifyPushButton->setEnabled (true); - ui->togglePushButton->setEnabled( - ui->generatedPolylineCheckBox->isChecked () != - ui->simplifiedPolylineCheckBox->isChecked ()); - } - - void MainWindow::DisableButtons () - { - ui->generatePushButton->setDisabled (true); - ui->simplifyPushButton->setDisabled (true); - ui->togglePushButton->setDisabled (true); - } - - void MainWindow::on_generatePushButton_clicked () - { - QApplication::setOverrideCursor (QCursor (Qt::WaitCursor)); - DisableButtons (); - mWorker->Generate (ui->polyPointCountSpinBox->value ()); - } - - void MainWindow::on_simplifyPushButton_clicked () - { - QApplication::setOverrideCursor (QCursor (Qt::WaitCursor)); - DisableButtons (); - - switch (ui->algorithmComboBox->currentIndex ()) - { - case NTH_POINT: - mWorker->SimplifyNP ((Container)ui->polyTypeComboBox->currentIndex (), ui->npSpinBox->value ()); - break; - - case RADIAL_DISTANCE: - mWorker->SimplifyRD ((Container)ui->polyTypeComboBox->currentIndex (), ui->rdLineEdit->text ()); - break; - - case PERPENDICULAR_DISTANCE: - mWorker->SimplifyPD ((Container)ui->polyTypeComboBox->currentIndex (), ui->pdLineEdit->text (), ui->pdSpinBox->value ()); - break; - - case REUMANN_WITKAM: - mWorker->SimplifyRW ((Container)ui->polyTypeComboBox->currentIndex (), ui->rwLineEdit->text ()); - break; - - case OPHEIM: - mWorker->SimplifyOp ((Container)ui->polyTypeComboBox->currentIndex (), ui->minOpLineEdit->text (), ui->maxOpLineEdit->text ()); - break; - - case LANG: - mWorker->SimplifyLa ((Container)ui->polyTypeComboBox->currentIndex (), ui->laLineEdit->text (), ui->lookAheadLaSpinBox->value ()); - break; - - case DOUGLAS_PEUCKER: - mWorker->SimplifyDP ((Container)ui->polyTypeComboBox->currentIndex (), ui->dpLineEdit->text ()); - break; - - case DOUGLAS_PEUCKER_VARIANT: - mWorker->SimplifyDP_variant ((Container)ui->polyTypeComboBox->currentIndex (), ui->dpvSpinBox->value ()); - break; - - case DOUGLAS_PEUCKER_REFERENCE: - mWorker->SimplifyDP_reference (ui->dprLineEdit->text ()); - break; - } - } - - void MainWindow::on_algorithmComboBox_currentIndexChanged (int index) - { - if (index == DOUGLAS_PEUCKER_REFERENCE) { - ui->polyTypeComboBox->setCurrentIndex (ARRAY_FLOAT); - ui->polyTypeComboBox->setDisabled (true); - } - else { - ui->polyTypeComboBox->setEnabled (true); - } - } - - void MainWindow::on_generatedPolylineCheckBox_toggled (bool checked) - { - ui->renderArea->SetVisibleGeneratedPolyline (checked); - ui->togglePushButton->setDisabled( - ui->generatedPolylineCheckBox->isChecked () == - ui->simplifiedPolylineCheckBox->isChecked ()); - update(); - } - - void MainWindow::on_simplifiedPolylineCheckBox_toggled (bool checked) - { - ui->renderArea->SetVisibleSimplifiedPolyline (checked); - ui->togglePushButton->setDisabled( - ui->generatedPolylineCheckBox->isChecked () == - ui->simplifiedPolylineCheckBox->isChecked ()); - update(); - } - - void MainWindow::on_keepAspectRatioCheckBox_toggled (bool checked) - { - ui->renderArea->SetKeepAspectRatio (checked); - update(); - } - - void MainWindow::SlotGeneratingPolyline () { - ui->statusBar->showMessage ("Generating polyline..."); - } - - void MainWindow::SlotConvertingPolyline () { - ui->statusBar->showMessage (QString ("Converting polyline to '%1'...").arg (ui->polyTypeComboBox->currentText ())); - } - - void MainWindow::SlotSimplifyingPolyline () { - ui->statusBar->showMessage ("Simplifying polyline..."); - } - - void MainWindow::SlotCleaningConvertedPolyline () { - ui->statusBar->showMessage ("Deleting converted polyline..."); - } - - void MainWindow::SlotGeneratedPolyline (int duration, QVector & polyline) - { - ui->statusBar->showMessage (QString ("Generation took %1 ms").arg (duration)); - ui->renderArea->SetGeneratedPolyline (polyline); - ui->simplGroupBox->setEnabled (true); - EnableButtons (); - QApplication::restoreOverrideCursor (); - update(); - } - - void MainWindow::SlotSimplifiedPolyline (int duration, QVector & polyline) - { - int pointCount = polyline.count () / 2; - ui->maxValueLabel->setText ("-"); - ui->sumValueLabel->setText ("-"); - ui->meanValueLabel->setText ("-"); - ui->stdValueLabel->setText ("-"); - ui->statusBar->showMessage ( - QString ("Simplification took %1 ms; %2 (%3%) points remaining"). - arg (duration). - arg (pointCount). - arg (100.0 * pointCount / mWorker->GetGeneratedPointCount())); - ui->renderArea->SetSimplifiedPolyline(polyline); - EnableButtons (); - QApplication::restoreOverrideCursor (); - update(); - } - - void MainWindow::SlotSimplifiedPolyline (int duration, QVector & polyline, double max, double sum, double mean, double std) - { - int pointCount = polyline.count () / 2; - ui->maxValueLabel->setText (QString::number (max)); - ui->sumValueLabel->setText (QString::number (sum)); - ui->meanValueLabel->setText (QString::number (mean)); - ui->stdValueLabel->setText (QString::number (std)); - ui->statusBar->showMessage ( - QString ("Simplification took %1 ms; %2 (%3%) points remaining"). - arg (duration). - arg (pointCount). - arg (100.0 * pointCount / mWorker->GetGeneratedPointCount())); - ui->renderArea->SetSimplifiedPolyline(polyline); - EnableButtons (); - QApplication::restoreOverrideCursor (); - update(); - } -} // namespace psimpl diff --git a/lib/psimpl/demo/MainWindow.h b/lib/psimpl/demo/MainWindow.h deleted file mode 100644 index 296a9f3..0000000 --- a/lib/psimpl/demo/MainWindow.h +++ /dev/null @@ -1,106 +0,0 @@ -/* ***** 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/ -*/ - -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - - -#include - - -namespace Ui { - class MainWindow; -} - - -namespace psimpl { - - class DPWorker; - - typedef enum ALGORITHM - { - NTH_POINT, - RADIAL_DISTANCE, - PERPENDICULAR_DISTANCE, - REUMANN_WITKAM, - OPHEIM, - LANG, - DOUGLAS_PEUCKER, - DOUGLAS_PEUCKER_VARIANT, - DOUGLAS_PEUCKER_REFERENCE, - } Algorithm; - - /*! - \brief Mainwindow where polylines can be generated and simplified. - - Multiple simplification algorithms, implementations and container types can be experimented - with. - */ - class MainWindow : public QMainWindow { - Q_OBJECT - - public: - MainWindow (QWidget *parent = 0); - ~MainWindow (); - - protected: - void changeEvent (QEvent *e); - - private: - void EnableButtons (); - void DisableButtons (); - - private: - Ui::MainWindow *ui; - DPWorker* mWorker; - -private slots: - void on_simplifiedPolylineCheckBox_toggled(bool checked); - void on_generatedPolylineCheckBox_toggled(bool checked); - void on_keepAspectRatioCheckBox_toggled(bool checked); - void on_simplifyPushButton_clicked (); - void on_algorithmComboBox_currentIndexChanged(int index); - void on_generatePushButton_clicked (); - void SlotGeneratingPolyline (); - void SlotConvertingPolyline (); - void SlotSimplifyingPolyline (); - void SlotCleaningConvertedPolyline (); - void SlotGeneratedPolyline (int duration, QVector & polyline); - void SlotSimplifiedPolyline (int duration, QVector & polyline); - void SlotSimplifiedPolyline (int duration, QVector & polyline, double max, double sum, double mean, double std); -}; - -} // namespace psimpl - - -#endif // MAINWINDOW_H diff --git a/lib/psimpl/demo/MainWindow.ui b/lib/psimpl/demo/MainWindow.ui deleted file mode 100644 index 2692fef..0000000 --- a/lib/psimpl/demo/MainWindow.ui +++ /dev/null @@ -1,855 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - psimpl v7 - generic n-dimensional polyline simplification - - - - - - - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> -<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">psimple v7</span><span style=" font-size:8pt;"> </span><span style=" font-size:8pt; color:#000000;">© Copyright 2010 - 2011 </span><a href="edekoning@gmail.com"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">Elmar de Koning</span></a><span style=" font-size:8pt;">; License - </span><a href="http://www.opensource.org/licenses/mozilla1.1.php"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">MPL 1.1</span></a><span style=" font-size:8pt;">; Website - </span><a href="http://psimpl.sf.net"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">psimpl.sf.net</span></a><span style=" font-size:8pt;">; Article - </span><a href="http://www.codeproject.com/KB/recipes/PolylineSimplification.aspx"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">CodeProject</span></a></p></body></html> - - - true - - - Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse - - - - - - - - 0 - 3 - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - - - - - - - - 0 - 0 - - - - Polyline - - - - - - Type - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - float [] - - - - - QVector <double> - - - - - std::vector <double> - - - - - std::list <long long> - - - - - - - - - 0 - 0 - - - - Generate - - - - - - - Point count - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 2 - - - 10000000 - - - 10000 - - - 100000 - - - - - - - Qt::Vertical - - - - 20 - 20 - - - - - - - - - - - true - - - - 0 - 0 - - - - Simplification - - - - - - - Nth point - - - - - Radial distance - - - - - Perpendicular distance - - - - - Reumann-Witkam - - - - - Opheim - - - - - Lang - - - - - Douglas-Peucker - - - - - Douglas-Peucker (variant) - - - - - Douglas-Peucker (reference) - - - - - - - - Algorithm - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - false - - - Simplify - - - - - - - 0 - - - - - 0 - - - - - 10000000 - - - - - - - - - 0 - - - - - 0 - - - - - - - - - 0 - - - - - 0 - - - - - - - 1000000 - - - 1 - - - - - - - - - 0 - - - - - - - - 0 - - - - - - - - - 0 - - - - - 0 - - - - - - - 0 - - - - - - - - - 0 - - - - - 0 - - - - - - - 10000000 - - - 1 - - - - - - - - - 0 - - - - - 0 - - - - - - - - - 0 - - - - - 0 - - - 10000000 - - - 10 - - - 0 - - - - - - - - - 0 - - - - - 0 - - - - - - - - - - - 0 - - - - - 0 - - - - - n - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - 0 - - - - - Radial distance - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - 0 - - - - - Perpendicular distance - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Repeat count - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - 0 - - - - - Perpendicular distance - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - 0 - - - - - Minimum distance - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Maximum distance - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - 0 - - - - - Perpendicular distance - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Look ahead - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - 0 - - - - - Perpendicular distance - - - Qt::AlignCenter - - - - - - - - - 0 - - - - - Point count - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - 0 - - - - - Perpendicular distance - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - Graphics - - - - - - Generated Polyline - - - true - - - - - - - Simplified Polyline - - - false - - - - - - - Toggle - - - - - - - Keep aspect ratio - - - true - - - - - - - - - - Positional errors are only calculated for doubles! - - - Positional error - - - - - - Sum - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Max - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Mean - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - Std - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - ? - - - About psimpl - - - F1 - - - - - - - psimpl::RenderArea - QFrame -
RenderArea.h
- 1 -
-
- - polyPointCountSpinBox - polyTypeComboBox - generatePushButton - algorithmComboBox - npSpinBox - rdLineEdit - pdLineEdit - pdSpinBox - rwLineEdit - dpLineEdit - dpvSpinBox - dprLineEdit - simplifyPushButton - generatedPolylineCheckBox - simplifiedPolylineCheckBox - - - - - togglePushButton - clicked() - generatedPolylineCheckBox - toggle() - - - 674 - 559 - - - 674 - 504 - - - - - togglePushButton - clicked() - simplifiedPolylineCheckBox - toggle() - - - 674 - 559 - - - 674 - 529 - - - - - algorithmComboBox - currentIndexChanged(int) - labelStackedWidget - setCurrentIndex(int) - - - 256 - 503 - - - 210 - 519 - - - - - algorithmComboBox - currentIndexChanged(int) - editStackedWidget - setCurrentIndex(int) - - - 281 - 490 - - - 279 - 512 - - - - -
diff --git a/lib/psimpl/demo/QTRules.rules b/lib/psimpl/demo/QTRules.rules deleted file mode 100644 index 9881b7b..0000000 --- a/lib/psimpl/demo/QTRules.rules +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/lib/psimpl/demo/RenderArea.cpp b/lib/psimpl/demo/RenderArea.cpp deleted file mode 100644 index 28d89cc..0000000 --- a/lib/psimpl/demo/RenderArea.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* ***** 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 "RenderArea.h" -#include - - -namespace psimpl { - - RenderArea::RenderArea (QWidget *inParent, Qt::WindowFlags inFlags) : - QFrame (inParent, inFlags), - mDrawGeneratedPolyline (true), - mDrawSimplifiedPolyline (false), - mKeepAspectRatio (true) - { - } - - void RenderArea::paintEvent(QPaintEvent * /*inEvent*/) { - if (!mGeneratedPolyline.elementCount ()) - return; - - QRectF rect = mGeneratedPolyline.boundingRect (); - if (!rect.isValid ()) - return; - - QPainter painter (this); - - if (mKeepAspectRatio) { - qreal scale = qMin ((width () - 1) / rect.width (), (height () - 1) / rect.height ()); - painter.translate ((width () - (rect.width () * scale)) / 2.0, - (height () - (rect.height () * scale)) / 2.0); - painter.scale (scale, scale); - painter.translate (-rect.left (), -rect.top ()); - } - else { - painter.scale ((width () - 1) / rect.width (), (height () - 1) / rect.height ()); - painter.translate (-rect.left (), -rect.top ()); - } - - if (mDrawGeneratedPolyline) { - painter.setPen (Qt::darkBlue); - painter.drawPath (mGeneratedPolyline); - } - - if (!mSimplifiedPolyline.elementCount ()) - return; - - if (mDrawSimplifiedPolyline) { - painter.setPen (Qt::darkRed); - painter.drawPath (mSimplifiedPolyline); - } - } - - QPainterPath RenderArea::Convert (QVector & polyline) - { - // limit paths to max 100.000 points to speed up drawing - const int threshold = 100000; - - QPainterPath path; - if (polyline.empty ()) { - return path; - } - int pointCount = polyline.size () / 2; - qreal skipStep = (qreal) (pointCount - threshold) / (qreal) threshold; - qreal skipValue = skipStep; - - path.moveTo(polyline [0], polyline [1]); - for (int i=1; i 1.0) { - skipValue -= 1.0; - } - else { - path.lineTo (polyline [i*2], polyline [i*2+1]); - skipValue += skipStep; - } - } - int elemCount = path.elementCount (); - elemCount++; - return path; - } - - void RenderArea::SetGeneratedPolyline (QVector & polyline) - { - mSimplifiedPolyline = QPainterPath (); - mGeneratedPolyline = Convert (polyline); - } - - void RenderArea::SetSimplifiedPolyline (QVector & polyline) - { - mSimplifiedPolyline = Convert (polyline); - } - -} // namespace psimpl diff --git a/lib/psimpl/demo/RenderArea.h b/lib/psimpl/demo/RenderArea.h deleted file mode 100644 index d198cd1..0000000 --- a/lib/psimpl/demo/RenderArea.h +++ /dev/null @@ -1,76 +0,0 @@ -/* ***** 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/ -*/ - -#ifndef RENDERAREA_H -#define RENDERAREA_H - - -#include -#include - - -namespace psimpl { - - /*! - \brief A frame that can draw polylines and their simplification. - - Note that the point count of each polyline is always limited to 100.000 to speed up drawing. - */ - class RenderArea : public QFrame - { - public: - RenderArea (QWidget *inParent = 0, Qt::WindowFlags inFlags = 0); - void SetGeneratedPolyline (QVector & polyline); - void SetSimplifiedPolyline (QVector & polyline); - void SetVisibleGeneratedPolyline (bool visible) { mDrawGeneratedPolyline = visible; } - void SetVisibleSimplifiedPolyline (bool visible) { mDrawSimplifiedPolyline = visible; } - void SetKeepAspectRatio (bool keep) { mKeepAspectRatio = keep; } - - protected: - void paintEvent (QPaintEvent *inEvent); - - private: - QPainterPath Convert (QVector & polyline); - - private: - QPainterPath mGeneratedPolyline; - QPainterPath mSimplifiedPolyline; - bool mDrawGeneratedPolyline; - bool mDrawSimplifiedPolyline; - bool mKeepAspectRatio; - }; - -} // namespace psimpl - - -#endif // RENDERAREA_H diff --git a/lib/psimpl/demo/main.cpp b/lib/psimpl/demo/main.cpp deleted file mode 100644 index 292d0be..0000000 --- a/lib/psimpl/demo/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* ***** 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 -#include "MainWindow.h" - -int main (int argc, char *argv []) -{ - QApplication a (argc, argv); - psimpl::MainWindow w; - w.show (); - return a.exec (); -} diff --git a/lib/psimpl/demo/psimpl.pro b/lib/psimpl/demo/psimpl.pro deleted file mode 100644 index aadb665..0000000 --- a/lib/psimpl/demo/psimpl.pro +++ /dev/null @@ -1,22 +0,0 @@ -# ------------------------------------------------- -# Project created by QtCreator 2010-06-05T12:09:26 -# ------------------------------------------------- -TARGET = psimpl-demo -TEMPLATE = app -VERSION = 7 -SOURCES += main.cpp \ - MainWindow.cpp \ - DPWorker.cpp \ - RenderArea.cpp -HEADERS += MainWindow.h \ - DPWorker.h \ - RenderArea.h \ - psimpl_reference.h \ - psimpl.h \ - ../lib/psimpl.h -FORMS += MainWindow.ui -OTHER_FILES += \ - resource.rc \ - ../README.txt \ - ../LICENSE.txt -RC_FILE = resource.rc diff --git a/lib/psimpl/demo/psimpl.vcproj b/lib/psimpl/demo/psimpl.vcproj deleted file mode 100644 index ccdca26..0000000 --- a/lib/psimpl/demo/psimpl.vcproj +++ /dev/null @@ -1,304 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/psimpl/demo/psimpl_reference.h b/lib/psimpl/demo/psimpl_reference.h deleted file mode 100644 index ac17471..0000000 --- a/lib/psimpl/demo/psimpl_reference.h +++ /dev/null @@ -1,238 +0,0 @@ -/* ***** 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/ -*/ - -#ifndef PSIMPL_CLASSIC_H -#define PSIMPL_CLASSIC_H - -#include - -namespace psimpl { - namespace classic { - // Contains a minimal modified version of the Douglas-Peucker recursive simplification - // routine as available from www.softsurfer.com. Modifications include: - // - Removed recursion by using a stack - // - Added minimal Point, Vector, and Segment classes as needed by the algorithm - - - // minimal point class - class Point { - public: - Point () : - x (0.f), - y (0.f) - {} - - Point (float x, float y) : - x (x), - y (y) - {} - - float x, y; - }; - - // reuse the point class for a vector - typedef Point Vector; - - // operators as needed by the algorithm - Point operator+ (const Point& P, const Vector& V) { - return Point (P.x+V.x, P.y+V.y); - } - - Vector operator- (const Point& P0, const Point& P1) { - return Vector (P0.x-P1.x, P0.y-P1.y); - } - - Vector operator* (double s, const Vector& V) { - return Vector (s*V.x, s*V.y); - } - - // minimal segment class - class Segment { - public: - Segment (const Point& P0, const Point& P1) : - P0(P0), - P1(P1) - {} - - Point P0; - Point P1; - }; - - // define the stack and sub poly that are used to replace the original recusion - typedef std::pair< int, int > SubPoly; - typedef std::stack< SubPoly > Stack; - - - // Copyright 2002, softSurfer (www.softsurfer.com) - // This code may be freely used and modified for any purpose - // providing that this copyright notice is included with it. - // SoftSurfer makes no warranty for this code, and cannot be held - // liable for any real or imagined damage resulting from its use. - // Users of this code must verify correctness for their application. - - // Assume that classes are already given for the objects: - // Point and Vector with - // coordinates {float x, y, z;} // as many as are needed - // operators for: - // == to test equality - // != to test inequality - // (Vector)0 = (0,0,0) (null vector) - // Point = Point ± Vector - // Vector = Point - Point - // Vector = Vector ± Vector - // Vector = Scalar * Vector (scalar product) - // Vector = Vector * Vector (cross product) - // Segment with defining endpoints {Point P0, P1;} - //=================================================================== - - // dot product (3D) which allows vector operations in arguments - #define __dot(u,v) ((u).x * (v).x + (u).y * (v).y) - #define __norm2(v) __dot(v,v) // norm2 = squared length of vector - #define __norm(v) sqrt(__norm2(v)) // norm = length of vector - #define __d2(u,v) __norm2(u-v) // distance squared = norm2 of difference - #define __d(u,v) __norm(u-v) // distance = norm of difference - - // simplifyDP(): - // This is the Douglas-Peucker recursive simplification routine - // It just marks vertices that are part of the simplified polyline - // for approximating the polyline subchain v[j] to v[k]. - // Input: tol = approximation tolerance - // v[] = polyline array of vertex points - // j,k = indices for the subchain v[j] to v[k] - // Output: mk[] = array of markers matching vertex array v[] - void - simplifyDP( Stack& stack, float tol, Point* v, int j, int k, int* mk ) - { - if (k <= j+1) // there is nothing to simplify - return; - - // check for adequate approximation by segment S from v[j] to v[k] - int maxi = j; // index of vertex farthest from S - float maxd2 = 0; // distance squared of farthest vertex - float tol2 = tol * tol; // tolerance squared - Segment S (v[j], v[k]); // segment from v[j] to v[k] - Vector u = S.P1 - S.P0; // segment direction vector - double cu = __dot(u,u); // segment length squared - - // test each vertex v[i] for max distance from S - // compute using the Feb 2001 Algorithm's dist_Point_to_Segment() - // Note: this works in any dimension (2D, 3D, ...) - Vector w; - Point Pb; // base of perpendicular from v[i] to S - double b, cw, dv2; // dv2 = distance v[i] to S squared - - for (int i=j+1; i tol2) // error is worse than the tolerance - { - // split the polyline at the farthest vertex from S - mk[maxi] = 1; // mark v[maxi] for the simplified polyline - // recursively simplify the two subpolylines at v[maxi] - stack.push( std::make_pair (j, maxi)); - stack.push( std::make_pair (maxi, k)); - } - // else the approximation is OK, so ignore intermediate vertices - return; - } - - // poly_simplify(): - // Input: tol = approximation tolerance - // V[] = polyline array of vertex points - // n = the number of points in V[] - // Output: sV[]= simplified polyline vertices (max is n) - // Return: m = the number of points in sV[] - int - poly_simplify(float tol, Point* V, int n, Point* sV ) - { - int i, k, m, pv; // misc counters - float tol2 = tol * tol; // tolerance squared - Point* vt = new Point[n]; // vertex buffer - int* mk = new int[n]; // marker buffer - for (i=0; i -# else -# include -# endif - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 7,0,0,0 - PRODUCTVERSION 7,0,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL - FILESUBTYPE 0x0L - BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904B0" - BEGIN - VALUE "CompanyName", "Elmar de Koning\0" - VALUE "FileDescription", "psimpl demo application\0" - VALUE "FileVersion", "7.0.0.0\0" - VALUE "LegalCopyright", "Copyright (C) 2010-2011 Elmar de Koning\0" - VALUE "OriginalFilename", "psimpl-demo.exe\0" - VALUE "ProductName", "psimpl - generic n-dimensional polyline simplification\0" - END - END - END -/* End of Version info */ - diff --git a/lib/psimpl/LICENSE.txt b/lib/psimpl_v7_src/LICENSE.txt similarity index 100% rename from lib/psimpl/LICENSE.txt rename to lib/psimpl_v7_src/LICENSE.txt diff --git a/lib/psimpl/README.txt b/lib/psimpl_v7_src/README.txt similarity index 100% rename from lib/psimpl/README.txt rename to lib/psimpl_v7_src/README.txt diff --git a/lib/psimpl_v7_src/doc/annotated.html b/lib/psimpl_v7_src/doc/annotated.html new file mode 100644 index 0000000..3f4aedf --- /dev/null +++ b/lib/psimpl_v7_src/doc/annotated.html @@ -0,0 +1,85 @@ + + + + +psimpl: Class List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+ + + + + + + +
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelperDouglas-Peucker approximation helper class
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfoDefines the key of a polyline
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >Provides various simplification algorithms for n-dimensional simple polylines
psimpl::util::scoped_array< T >A smart pointer for holding a dynamically allocated array
psimpl::math::StatisticsPOD structure for storing several statistical values
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyDefines a sub polyline
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAltDefines a sub polyline including its key
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/bc_s.png b/lib/psimpl_v7_src/doc/bc_s.png new file mode 100644 index 0000000..51ba006 Binary files /dev/null and b/lib/psimpl_v7_src/doc/bc_s.png differ diff --git a/lib/psimpl_v7_src/doc/classes.html b/lib/psimpl_v7_src/doc/classes.html new file mode 100644 index 0000000..eb07cd6 --- /dev/null +++ b/lib/psimpl_v7_src/doc/classes.html @@ -0,0 +1,83 @@ + + + + +psimpl: Class Index + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ + + + + + diff --git a/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification-members.html b/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification-members.html new file mode 100644 index 0000000..7143643 --- /dev/null +++ b/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification-members.html @@ -0,0 +1,97 @@ + + + + +psimpl: Member List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > Member List
+
+
+This is the complete list of members for psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >, including all inherited members. + + + + + + + + + + + + + + + + + + + + +
Advance(InputIterator &it, diff_type n=1)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline, private]
AdvanceCopy(InputIterator it, diff_type n=1)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline, private]
Backward(InputIterator &it, unsigned &remaining)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline, private]
ComputePositionalErrors2(InputIterator original_first, InputIterator original_last, InputIterator simplified_first, InputIterator simplified_last, OutputIterator result, bool *valid=0)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
ComputePositionalErrorStatistics(InputIterator original_first, InputIterator original_last, InputIterator simplified_first, InputIterator simplified_last, bool *valid=0)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
CopyKey(InputIterator key, OutputIterator &result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline, private]
CopyKeyAdvance(InputIterator &key, OutputIterator &result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline, private]
diff_type typedefpsimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [private]
DouglasPeucker(InputIterator first, InputIterator last, value_type tol, OutputIterator result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
DouglasPeuckerN(InputIterator first, InputIterator last, unsigned count, OutputIterator result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
Forward(InputIterator &it, unsigned n, unsigned &remaining)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline, private]
Lang(InputIterator first, InputIterator last, value_type tol, unsigned look_ahead, OutputIterator result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
NthPoint(InputIterator first, InputIterator last, unsigned n, OutputIterator result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
Opheim(InputIterator first, InputIterator last, value_type min_tol, value_type max_tol, OutputIterator result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
PerpendicularDistance(InputIterator first, InputIterator last, value_type tol, unsigned repeat, OutputIterator result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
PerpendicularDistance(InputIterator first, InputIterator last, value_type tol, OutputIterator result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
ptr_diff_type typedefpsimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [private]
RadialDistance(InputIterator first, InputIterator last, value_type tol, OutputIterator result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
ReumannWitkam(InputIterator first, InputIterator last, value_type tol, OutputIterator result)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [inline]
value_type typedefpsimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > [private]
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification.html b/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification.html new file mode 100644 index 0000000..415e02e --- /dev/null +++ b/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification.html @@ -0,0 +1,1140 @@ + + + + +psimpl: psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > Class Template Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator > Class Template Reference
+
+
+ +

Provides various simplification algorithms for n-dimensional simple polylines. + More...

+ +

#include <psimpl.h>

+ +

List of all members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  DPHelper
 Douglas-Peucker approximation helper class. More...

+Public Member Functions

OutputIterator NthPoint (InputIterator first, InputIterator last, unsigned n, OutputIterator result)
 Performs the nth point routine (NP).
OutputIterator RadialDistance (InputIterator first, InputIterator last, value_type tol, OutputIterator result)
 Performs the (radial) distance between points routine (RD).
OutputIterator PerpendicularDistance (InputIterator first, InputIterator last, value_type tol, unsigned repeat, OutputIterator result)
 Repeatedly performs the perpendicular distance routine (PD).
OutputIterator PerpendicularDistance (InputIterator first, InputIterator last, value_type tol, OutputIterator result)
 Performs the perpendicular distance routine (PD).
OutputIterator ReumannWitkam (InputIterator first, InputIterator last, value_type tol, OutputIterator result)
 Performs Reumann-Witkam approximation (RW).
OutputIterator Opheim (InputIterator first, InputIterator last, value_type min_tol, value_type max_tol, OutputIterator result)
 Performs Opheim approximation (OP).
OutputIterator Lang (InputIterator first, InputIterator last, value_type tol, unsigned look_ahead, OutputIterator result)
 Performs Lang approximation (LA).
OutputIterator DouglasPeucker (InputIterator first, InputIterator last, value_type tol, OutputIterator result)
 Performs Douglas-Peucker approximation (DP).
OutputIterator DouglasPeuckerN (InputIterator first, InputIterator last, unsigned count, OutputIterator result)
 Performs a Douglas-Peucker approximation variant (DPn).
OutputIterator ComputePositionalErrors2 (InputIterator original_first, InputIterator original_last, InputIterator simplified_first, InputIterator simplified_last, OutputIterator result, bool *valid=0)
 Computes the squared positional error between a polyline and its simplification.
math::Statistics ComputePositionalErrorStatistics (InputIterator original_first, InputIterator original_last, InputIterator simplified_first, InputIterator simplified_last, bool *valid=0)
 Computes statistics for the positional errors between a polyline and its simplification.

+Private Types

typedef std::iterator_traits
+< InputIterator >
+::difference_type 
diff_type
typedef std::iterator_traits
+< InputIterator >::value_type 
value_type
typedef std::iterator_traits
+< const value_type * >
+::difference_type 
ptr_diff_type

+Private Member Functions

void CopyKeyAdvance (InputIterator &key, OutputIterator &result)
 Copies the key to the output destination, and increments the iterator.
void CopyKey (InputIterator key, OutputIterator &result)
 Copies the key to the output destination.
void Advance (InputIterator &it, diff_type n=1)
 Increments the iterator by n points.
InputIterator AdvanceCopy (InputIterator it, diff_type n=1)
 Increments a copy of the iterator by n points.
unsigned Forward (InputIterator &it, unsigned n, unsigned &remaining)
 Increments the iterator by n points if possible.
void Backward (InputIterator &it, unsigned &remaining)
 Decrements the iterator by 1 point.
+

Detailed Description

+

template<unsigned DIM, class InputIterator, class OutputIterator>
+class psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >

+ +

Provides various simplification algorithms for n-dimensional simple polylines.

+

A polyline is simple when it is non-closed and non-selfintersecting. All algorithms operate on input iterators and output iterators. Note that unisgned integer types are NOT supported.

+

Member Typedef Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
typedef std::iterator_traits<InputIterator>::difference_type psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::diff_type [private]
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
typedef std::iterator_traits<const value_type*>::difference_type psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::ptr_diff_type [private]
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
typedef std::iterator_traits<InputIterator>::value_type psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::value_type [private]
+
+
+ +
+
+

Member Function Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + +
void psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::Advance (InputIterator & it,
diff_type n = 1 
) [inline, private]
+
+
+ +

Increments the iterator by n points.

+
See also:
AdvanceCopy
+
Parameters:
+ + + +
[in,out]ititerator to be advanced
[in]nnumber of points to advance
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + +
InputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::AdvanceCopy (InputIterator it,
diff_type n = 1 
) [inline, private]
+
+
+ +

Increments a copy of the iterator by n points.

+
See also:
Advance
+
Parameters:
+ + + +
[in]ititerator to be advanced
[in]nnumber of points to advance
+
+
+
Returns:
an incremented copy of the input iterator
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + +
void psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::Backward (InputIterator & it,
unsigned & remaining 
) [inline, private]
+
+
+ +

Decrements the iterator by 1 point.

+
See also:
Forward
+
Parameters:
+ + + +
[in,out]ititerator to be advanced
[in,out]remainingnumber of points remaining after it
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::ComputePositionalErrors2 (InputIterator original_first,
InputIterator original_last,
InputIterator simplified_first,
InputIterator simplified_last,
OutputIterator result,
bool * valid = 0 
) [inline]
+
+
+ +

Computes the squared positional error between a polyline and its simplification.

+

For each point in the range [original_first, original_last) the squared distance to the simplification [simplified_first, simplified_last) is calculated. Each positional error is copied to the output range [result, result + count), where count is the number of points in the original polyline. The return value is the end of the output range: result + count.

+

Note that both the original and simplified polyline must be defined using the same value_type.

+
+psimpl_pos_error.png +
+

Input (Type) requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a forward iterator 3- The InputIterator value type is convertible to a value type of the output iterator 4- The ranges [original_first, original_last) and [simplified_first, simplified_last) contain vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The ranges [original_first, original_last) and [simplified_first, simplified_last) contain a minimum of 2 vertices 6- The range [simplified_first, simplified_last) represents a simplification of the range [original_first, original_last), meaning each point in the simplification has the exact same coordinates as some point from the original polyline

+

In case these requirements are not met, the valid flag is set to false OR compile errors may occur.

+
Parameters:
+ + + + + + + +
[in]original_firstthe first coordinate of the first polyline point
[in]original_lastone beyond the last coordinate of the last polyline point
[in]simplified_firstthe first coordinate of the first simplified polyline point
[in]simplified_lastone beyond the last coordinate of the last simplified polyline point
[in]resultdestination of the squared positional errors
[out]valid[optional] indicates if the computed positional errors are valid
+
+
+
Returns:
one beyond the last computed positional error
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
math::Statistics psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::ComputePositionalErrorStatistics (InputIterator original_first,
InputIterator original_last,
InputIterator simplified_first,
InputIterator simplified_last,
bool * valid = 0 
) [inline]
+
+
+ +

Computes statistics for the positional errors between a polyline and its simplification.

+

Various statistics (mean, max, sum, std) are calculated for the positional errors between the range [original_first, original_last) and its simplification the range [simplified_first, simplified_last).

+

Input (Type) requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a forward iterator 3- The InputIterator value type is convertible to double 4- The ranges [original_first, original_last) and [simplified_first, simplified_last) contain vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The ranges [original_first, original_last) and [simplified_first, simplified_last) contain a minimum of 2 vertices 6- The range [simplified_first, simplified_last) represents a simplification of the range [original_first, original_last), meaning each point in the simplification has the exact same coordinates as some point from the original polyline

+

In case these requirements are not met, the valid flag is set to false OR compile errors may occur.

+
See also:
ComputePositionalErrors2
+
Parameters:
+ + + + + + +
[in]original_firstthe first coordinate of the first polyline point
[in]original_lastone beyond the last coordinate of the last polyline point
[in]simplified_firstthe first coordinate of the first simplified polyline point
[in]simplified_lastone beyond the last coordinate of the last simplified polyline point
[out]valid[optional] indicates if the computed statistics are valid
+
+
+
Returns:
the computed statistics
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + +
void psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::CopyKey (InputIterator key,
OutputIterator & result 
) [inline, private]
+
+
+ +

Copies the key to the output destination.

+
See also:
CopyKeyAdvance
+
Parameters:
+ + + +
[in]keythe first coordinate of the key
[in,out]resultdestination of the copied key
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + +
void psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::CopyKeyAdvance (InputIterator & key,
OutputIterator & result 
) [inline, private]
+
+
+ +

Copies the key to the output destination, and increments the iterator.

+
See also:
CopyKey
+
Parameters:
+ + + +
[in,out]keythe first coordinate of the key
[in,out]resultdestination of the copied key
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DouglasPeucker (InputIterator first,
InputIterator last,
value_type tol,
OutputIterator result 
) [inline]
+
+
+ +

Performs Douglas-Peucker approximation (DP).

+

The DP algorithm uses the RadialDistance (RD) routine O(n) as a preprocessing step. After RD the algorithm is O (n m) in worst case and O(n log m) on average, where m < n (m is the number of points after RD).

+

The DP algorithm starts with a simplification that is the single edge joining the first and last vertices of the polyline. The distance of the remaining vertices to that edge are computed. The vertex that is furthest away from theedge (called a key), and has a computed distance that is larger than a specified tolerance, will be added to the simplification. This process will recurse for each edge in the current simplification, untill all vertices of the original polyline are within tolerance.

+
+psimpl_dp.png +
+

Note that this algorithm will create a copy of the input polyline during the vertex reduction step.

+

RD followed by DP is applied to the range [first, last) using the specified tolerance tol. The resulting simplified polyline is copied to the output range [result, result + m*DIM), where m is the number of vertices of the simplified polyline. The return value is the end of the output range: result + m*DIM.

+

Input (Type) requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a forward iterator 3- The InputIterator value type is convertible to a value type of the output iterator 4- The range [first, last) contains vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The range [first, last) contains at least 2 vertices 6- tol is not 0

+

In case these requirements are not met, the entire input range [first, last) is copied to the output range [result, result + (last - first)) OR compile errors may occur.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (point-to-segment) distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DouglasPeuckerN (InputIterator first,
InputIterator last,
unsigned count,
OutputIterator result 
) [inline]
+
+
+ +

Performs a Douglas-Peucker approximation variant (DPn).

+

This algorithm is a variation of the original implementation. Instead of considering one polyline segment at a time, all segments of the current simplified polyline are evaluated at each step. Only the vertex with the maximum distance from its edge is added to the simplification. This process will recurse untill the the simplification contains the desired amount of vertices.

+

The algorithm, which does not use the (radial) distance between points routine as a preprocessing step, is O(n2) in worst case and O(n log n) on average.

+

Note that this algorithm will create a copy of the input polyline for performance reasons.

+

DPn is applied to the range [first, last). The resulting simplified polyline consists of count vertices and is copied to the output range [result, result + count). The return value is the end of the output range: result + count.

+

Input (Type) requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a forward iterator 3- The InputIterator value type is convertible to a value type of the output iterator 4- The range [first, last) contains vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The range [first, last) contains a minimum of count vertices 6- count is at least 2

+

In case these requirements are not met, the entire input range [first, last) is copied to the output range [result, result + (last - first)) OR compile errors may occur.

+
See also:
DouglasPeucker
+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]countthe maximum number of points of the simplified polyline
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + +
unsigned psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::Forward (InputIterator & it,
unsigned n,
unsigned & remaining 
) [inline, private]
+
+
+ +

Increments the iterator by n points if possible.

+

If there are fewer than n point remaining the iterator will be incremented to the last point.

+
See also:
Backward
+
Parameters:
+ + + + +
[in,out]ititerator to be advanced
[in]nnumber of points to advance
[in,out]remainingnumber of points remaining after it
+
+
+
Returns:
the actual amount of points that the iterator advanced
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::Lang (InputIterator first,
InputIterator last,
value_type tol,
unsigned look_ahead,
OutputIterator result 
) [inline]
+
+
+ +

Performs Lang approximation (LA).

+

The LA routine defines a fixed size search-region. The first and last points of that search region form a segment. This segment is used to calculate the perpendicular distance to each intermediate point. If any calculated distance is larger than the specified tolerance, the search region will be shrunk by excluding its last point. This process will continue untill all calculated distances fall below the specified tolerance , or there are no more intermediate points. At this point all intermediate points are removed and a new search region is defined starting at the last point from old search region. Note that the size of the search region (look_ahead parameter) controls the maximum amount of simplification, e.g.: a size of 20 will always result in a simplification that contains at least 5% of the original points.

+
+psimpl_la.png +
+

LA routine is applied to the range [first, last) using the specified tolerance and look ahead values. The resulting simplified polyline is copied to the output range [result, result + m*DIM), where m is the number of vertices of the simplified polyline. The return value is the end of the output range: result + m*DIM.

+

Input (Type) Requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a bidirectional iterator 3- The InputIterator value type is convertible to a value type of the output iterator 4- The range [first, last) contains vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The range [first, last) contains at least 2 vertices 6- tol is not 0 7- look_ahead is not zero

+

In case these requirements are not met, the entire input range [first, last) is copied to the output range [result, result + (last - first)) OR compile errors may occur.

+
Parameters:
+ + + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (point-to-segment) distance tolerance
[in]look_aheaddefines the size of the search region
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::NthPoint (InputIterator first,
InputIterator last,
unsigned n,
OutputIterator result 
) [inline]
+
+
+ +

Performs the nth point routine (NP).

+

NP is an O(n) algorithm for polyline simplification. It keeps only the first, last and each nth point. As an example, consider any random line of 8 points. Using n = 3 will always yield a simplification consisting of points: 1, 4, 7, 8

+
+psimpl_np.png +
+

NP is applied to the range [first, last). The resulting simplified polyline is copied to the output range [result, result + m*DIM), where m is the number of vertices of the simplified polyline. The return value is the end of the output range: result + m*DIM.

+

Input (Type) requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a forward iterator 3- The input iterator value type is convertible to a value type of the OutputIterator 4- The range [first, last) contains only vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The range [first, last) contains at least 2 vertices 6- n is not 0

+

In case these requirements are not met, the entire input range [first, last) is copied to the output range [result, result + (last - first)) OR compile errors may occur.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]nspecifies 'each nth point'
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::Opheim (InputIterator first,
InputIterator last,
value_type min_tol,
value_type max_tol,
OutputIterator result 
) [inline]
+
+
+ +

Performs Opheim approximation (OP).

+

The O(n) OP routine is very similar to the Reumann-Witkam (RW) routine, and can be seen as a constrained version of that RW routine. OP uses both a minimum and a maximum distance tolerance to constrain the search area. For each successive vertex vi, its radial distance to the current key vkey (initially v0) is calculated. The last point within the minimum distance tolerance is used to define a ray R (vkey, vi). If no such vi exists, the ray is defined as R(vkey, vkey+1). For each successive vertex vj beyond vi its perpendicular distance to the ray R is calculated. A new key is found at vj-1, when this distance exceeds the minimum tolerance Or when the radial distance between vj and the vkey exceeds the maximum tolerance. After a new key is found, the process repeats itself.

+
+psimpl_op.png +
+

OP routine is applied to the range [first, last) using the specified distance tolerances min_tol and max_tol. The resulting simplified polyline is copied to the output range [result, result + m*DIM), where m is the number of vertices of the simplified polyline. The return value is the end of the output range: result + m*DIM.

+

Input (Type) Requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a forward iterator 3- The input iterator value type is convertible to a value type of the output iterator 4- The range [first, last) contains vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The range [first, last) contains at least 2 vertices 6- min_tol is not 0 7- max_tol is not 0

+

In case these requirements are not met, the entire input range [first, last) is copied to the output range [result, result + (last - first)) OR compile errors may occur.

+
Parameters:
+ + + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]min_tolradial and perpendicular (point-to-ray) distance tolerance
[in]max_tolradial distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::PerpendicularDistance (InputIterator first,
InputIterator last,
value_type tol,
OutputIterator result 
) [inline]
+
+
+ +

Performs the perpendicular distance routine (PD).

+

PD is an O(n) algorithm for polyline simplification. It computes the perpendicular distance of each point pi to the line segment S(pi-1, pi+1). Only when this distance is larger than the given tolerance will pi be part of the simpification. Note that the original polyline can only be reduced by a maximum of 50%. Multiple passes are required to achieve higher points reductions.

+
+psimpl_pd.png +
+

PD is applied to the range [first, last) using the specified tolerance tol. The resulting simplified polyline is copied to the output range [result, result + m*DIM), where m is the number of vertices of the simplified polyline. The return value is the end of the output range: result + m*DIM.

+

Input (Type) requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a forward iterator 3- The input iterator value type is convertible to a value type of the output iterator 4- The range [first, last) contains only vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The range [first, last) contains at least 2 vertices 6- tol is not 0

+

In case these requirements are not met, the entire input range [first, last) is copied to the output range [result, result + (last - first)) OR compile errors may occur.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (segment-to-point) distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::PerpendicularDistance (InputIterator first,
InputIterator last,
value_type tol,
unsigned repeat,
OutputIterator result 
) [inline]
+
+
+ +

Repeatedly performs the perpendicular distance routine (PD).

+

The algorithm stops after calling the PD routine 'repeat' times OR when the simplification does not improve. Note that this algorithm will need to store up to two intermediate simplification results.

+
See also:
PerpendicularDistance(InputIterator, InputIterator, value_type, OutputIterator)
+
Parameters:
+ + + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (segment-to-point) distance tolerance
[in]repeatthe number of times to successively apply the PD routine
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::RadialDistance (InputIterator first,
InputIterator last,
value_type tol,
OutputIterator result 
) [inline]
+
+
+ +

Performs the (radial) distance between points routine (RD).

+

RD is a brute-force O(n) algorithm for polyline simplification. It reduces successive vertices that are clustered too closely to a single vertex, called a key. The resulting keys form the simplified polyline.

+
+psimpl_rd.png +
+

RD is applied to the range [first, last) using the specified tolerance tol. The resulting simplified polyline is copied to the output range [result, result + m*DIM), where m is the number of vertices of the simplified polyline. The return value is the end of the output range: result + m*DIM.

+

Input (Type) requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a forward iterator 3- The input iterator value type is convertible to a value type of the output iterator 4- The range [first, last) contains only vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The range [first, last) contains at least 2 vertices 6- tol is not 0

+

In case these requirements are not met, the entire input range [first, last) is copied to the output range [result, result + (last - first)) OR compile errors may occur.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolradial (point-to-point) distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::ReumannWitkam (InputIterator first,
InputIterator last,
value_type tol,
OutputIterator result 
) [inline]
+
+
+ +

Performs Reumann-Witkam approximation (RW).

+

The O(n) RW routine uses a point-to-line (perpendicular) distance tolerance. It defines a line through the first two vertices of the original polyline. For each successive vertex vi its perpendicular distance to this line is calculated. A new key is found at vi-1, when this distance exceeds the specified tolerance. The vertices vi and vi+1 are then used to define a new line, and the process repeats itself.

+
+psimpl_rw.png +
+

RW routine is applied to the range [first, last) using the specified perpendicular distance tolerance tol. The resulting simplified polyline is copied to the output range [result, result + m*DIM), where m is the number of vertices of the simplified polyline. The return value is the end of the output range: result + m*DIM.

+

Input (Type) Requirements: 1- DIM is not 0, where DIM represents the dimension of the polyline 2- The InputIterator type models the concept of a forward iterator 3- The input iterator value type is convertible to a value type of the output iterator 4- The range [first, last) contains vertex coordinates in multiples of DIM, f.e.: x, y, z, x, y, z, x, y, z when DIM = 3 5- The range [first, last) contains at least 2 vertices 6- tol is not 0

+

In case these requirements are not met, the entire input range [first, last) is copied to the output range [result, result + (last - first)) OR compile errors may occur.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (point-to-line) distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/Code/Projects/psimpl/trunk/lib/psimpl.h
  • +
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification_1_1_d_p_helper-members.html b/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification_1_1_d_p_helper-members.html new file mode 100644 index 0000000..b8429e2 --- /dev/null +++ b/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification_1_1_d_p_helper-members.html @@ -0,0 +1,80 @@ + + + + +psimpl: Member List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper Member List
+
+
+This is the complete list of members for psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper, including all inherited members. + + + +
Approximate(const value_type *coords, ptr_diff_type coordCount, value_type tol, unsigned char *keys)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper [inline, static]
ApproximateN(const value_type *coords, ptr_diff_type coordCount, unsigned countTol, unsigned char *keys)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper [inline, static]
FindKey(const value_type *coords, ptr_diff_type first, ptr_diff_type last)psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper [inline, private, static]
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification_1_1_d_p_helper.html b/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification_1_1_d_p_helper.html new file mode 100644 index 0000000..b1f4b01 --- /dev/null +++ b/lib/psimpl_v7_src/doc/classpsimpl_1_1_polyline_simplification_1_1_d_p_helper.html @@ -0,0 +1,269 @@ + + + + +psimpl: psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper Class Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper Class Reference
+
+
+ +

Douglas-Peucker approximation helper class. + More...

+ +

List of all members.

+ + + + + + + + + + + + + + + + +

+Classes

struct  KeyInfo
 Defines the key of a polyline. More...
struct  SubPoly
 Defines a sub polyline. More...
struct  SubPolyAlt
 Defines a sub polyline including its key. More...

+Static Public Member Functions

static void Approximate (const value_type *coords, ptr_diff_type coordCount, value_type tol, unsigned char *keys)
 Performs Douglas-Peucker approximation.
static void ApproximateN (const value_type *coords, ptr_diff_type coordCount, unsigned countTol, unsigned char *keys)
 Performs Douglas-Peucker approximation.

+Static Private Member Functions

static KeyInfo FindKey (const value_type *coords, ptr_diff_type first, ptr_diff_type last)
 Finds the key for the given sub polyline.
+

Detailed Description

+

template<unsigned DIM, class InputIterator, class OutputIterator>
+class psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper

+ +

Douglas-Peucker approximation helper class.

+

Contains helper implentations for Douglas-Peucker approximation that operate solely on value_type arrays and value_type pointers. Note that the PolylineSimplification class only operates on iterators.

+

Member Function Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::Approximate (const value_typecoords,
ptr_diff_type coordCount,
value_type tol,
unsigned char * keys 
) [inline, static]
+
+
+ +

Performs Douglas-Peucker approximation.

+
Parameters:
+ + + + + +
[in]coordsarray of polyline coordinates
[in]coordCountnumber of coordinates in coords []
[in]tolapproximation tolerance
[out]keysindicates for each polyline point if it is a key
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
static void psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::ApproximateN (const value_typecoords,
ptr_diff_type coordCount,
unsigned countTol,
unsigned char * keys 
) [inline, static]
+
+
+ +

Performs Douglas-Peucker approximation.

+
Parameters:
+ + + + + +
[in]coordsarray of polyline coordinates
[in]coordCountnumber of coordinates in coords []
[in]countTolpoint count tolerance
[out]keysindicates for each polyline point if it is a key
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + + + + + + + +
static KeyInfo psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::FindKey (const value_typecoords,
ptr_diff_type first,
ptr_diff_type last 
) [inline, static, private]
+
+
+ +

Finds the key for the given sub polyline.

+

Finds the point in the range [first, last] that is furthest away from the segment (first, last). This point is called the key.

+
Parameters:
+ + + + +
[in]coordsarray of polyline coordinates
[in]firstthe first coordinate of the first polyline point
[in]lastthe first coordinate of the last polyline point
+
+
+
Returns:
the index of the key and its distance, or last when a key could not be found
+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/Code/Projects/psimpl/trunk/lib/psimpl.h
  • +
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/classpsimpl_1_1util_1_1scoped__array-members.html b/lib/psimpl_v7_src/doc/classpsimpl_1_1util_1_1scoped__array-members.html new file mode 100644 index 0000000..0fb9157 --- /dev/null +++ b/lib/psimpl_v7_src/doc/classpsimpl_1_1util_1_1scoped__array-members.html @@ -0,0 +1,86 @@ + + + + +psimpl: Member List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
psimpl::util::scoped_array< T > Member List
+
+
+This is the complete list of members for psimpl::util::scoped_array< T >, including all inherited members. + + + + + + + + + +
arraypsimpl::util::scoped_array< T > [private]
get() const psimpl::util::scoped_array< T > [inline]
operator=(const scoped_array &)psimpl::util::scoped_array< T > [private]
operator[](int offset)psimpl::util::scoped_array< T > [inline]
operator[](int offset) const psimpl::util::scoped_array< T > [inline]
scoped_array(unsigned n)psimpl::util::scoped_array< T > [inline]
scoped_array(const scoped_array &)psimpl::util::scoped_array< T > [private]
swap(scoped_array &b)psimpl::util::scoped_array< T > [inline]
~scoped_array()psimpl::util::scoped_array< T > [inline]
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/classpsimpl_1_1util_1_1scoped__array.html b/lib/psimpl_v7_src/doc/classpsimpl_1_1util_1_1scoped__array.html new file mode 100644 index 0000000..ecdcdf5 --- /dev/null +++ b/lib/psimpl_v7_src/doc/classpsimpl_1_1util_1_1scoped__array.html @@ -0,0 +1,284 @@ + + + + +psimpl: psimpl::util::scoped_array< T > Class Template Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl::util::scoped_array< T > Class Template Reference
+
+
+ +

A smart pointer for holding a dynamically allocated array. + More...

+ +

#include <psimpl.h>

+ +

List of all members.

+ + + + + + + + + + + + + +

+Public Member Functions

 scoped_array (unsigned n)
 ~scoped_array ()
T & operator[] (int offset)
const T & operator[] (int offset) const
T * get () const
void swap (scoped_array &b)

+Private Member Functions

 scoped_array (const scoped_array &)
scoped_arrayoperator= (const scoped_array &)

+Private Attributes

T * array
+

Detailed Description

+

template<typename T>
+class psimpl::util::scoped_array< T >

+ +

A smart pointer for holding a dynamically allocated array.

+

Similar to boost::scoped_array.

+

Constructor & Destructor Documentation

+ +
+
+
+template<typename T>
+ + + + + + + + +
psimpl::util::scoped_array< T >::scoped_array (unsigned n) [inline]
+
+
+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + +
psimpl::util::scoped_array< T >::~scoped_array () [inline]
+
+
+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
psimpl::util::scoped_array< T >::scoped_array (const scoped_array< T > & ) [private]
+
+
+ +
+
+

Member Function Documentation

+ +
+
+
+template<typename T>
+ + + + + + + +
T* psimpl::util::scoped_array< T >::get () const [inline]
+
+
+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
scoped_array& psimpl::util::scoped_array< T >::operator= (const scoped_array< T > & ) [private]
+
+
+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
const T& psimpl::util::scoped_array< T >::operator[] (int offset) const [inline]
+
+
+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
T& psimpl::util::scoped_array< T >::operator[] (int offset) [inline]
+
+
+ +
+
+ +
+
+
+template<typename T>
+ + + + + + + + +
void psimpl::util::scoped_array< T >::swap (scoped_array< T > & b) [inline]
+
+
+ +
+
+

Member Data Documentation

+ +
+
+
+template<typename T>
+ + + + +
T* psimpl::util::scoped_array< T >::array [private]
+
+
+ +
+
+
The documentation for this class was generated from the following file:
    +
  • D:/Code/Projects/psimpl/trunk/lib/psimpl.h
  • +
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/closed.png b/lib/psimpl_v7_src/doc/closed.png new file mode 100644 index 0000000..b7d4bd9 Binary files /dev/null and b/lib/psimpl_v7_src/doc/closed.png differ diff --git a/lib/psimpl_v7_src/doc/dir_f9993e17f36afaef24d7a404e932861e.html b/lib/psimpl_v7_src/doc/dir_f9993e17f36afaef24d7a404e932861e.html new file mode 100644 index 0000000..63c212f --- /dev/null +++ b/lib/psimpl_v7_src/doc/dir_f9993e17f36afaef24d7a404e932861e.html @@ -0,0 +1,75 @@ + + + + +psimpl: D:/Code/Projects/psimpl/trunk/lib/ Directory Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ +
+
+ +
+
+
+ +
+
+
+
lib Directory Reference
+
+
+ + + +

+Files

file  psimpl.h [code]
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/dirs.html b/lib/psimpl_v7_src/doc/dirs.html new file mode 100644 index 0000000..490efb9 --- /dev/null +++ b/lib/psimpl_v7_src/doc/dirs.html @@ -0,0 +1,72 @@ + + + + +psimpl: Directories + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ +
+
+ +
+
+
+ +
+
+
+
Directories
+
+
+
This directory hierarchy is sorted roughly, but not completely, alphabetically:
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/doxygen.css b/lib/psimpl_v7_src/doc/doxygen.css new file mode 100644 index 0000000..74445fe --- /dev/null +++ b/lib/psimpl_v7_src/doc/doxygen.css @@ -0,0 +1,835 @@ +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + font-size: 150%; +} + +.title { + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { + color: #4665A2; +} + +a.codeRef { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + box-shadow: 2px 2px 3px #999; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 10px; + margin-right: 5px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4CFE5; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight { + width: 100%; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 9px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 8px; + border-top-left-radius: 8px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + +} + +.memdoc { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 2px 5px; + background-color: #FBFCFD; + border-top-width: 0; + /* opera specific markup */ + border-bottom-left-radius: 8px; + border-bottom-right-radius: 8px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +.params, .retval, .exception, .tparams { + border-spacing: 6px 2px; +} + +.params .paramname, .retval .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir { + font-family: "courier new",courier,monospace; + vertical-align: top; +} + + + + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath li.navelem a:hover +{ + color:#6884BD; +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color:#364D7C; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.ingroups +{ + font-size: 8pt; + padding-left: 5px; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +dl +{ + padding: 0 0 0 10px; +} + +dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug +{ + border-left:4px solid; + padding: 0 0 0 6px; +} + +dl.note +{ + border-color: #D0C000; +} + +dl.warning, dl.attention +{ + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant +{ + border-color: #00D000; +} + +dl.deprecated +{ + border-color: #505050; +} + +dl.todo +{ + border-color: #00C0E0; +} + +dl.test +{ + border-color: #3030E0; +} + +dl.bug +{ + border-color: #C08050; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectname +{ + font: 300% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font: 120% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font: 50% Tahoma, Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #5373B4; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + diff --git a/lib/psimpl_v7_src/doc/doxygen.png b/lib/psimpl_v7_src/doc/doxygen.png new file mode 100644 index 0000000..635ed52 Binary files /dev/null and b/lib/psimpl_v7_src/doc/doxygen.png differ diff --git a/lib/psimpl_v7_src/doc/files.html b/lib/psimpl_v7_src/doc/files.html new file mode 100644 index 0000000..9e3e9b3 --- /dev/null +++ b/lib/psimpl_v7_src/doc/files.html @@ -0,0 +1,77 @@ + + + + +psimpl: File List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
File List
+
+
+
Here is a list of all files with brief descriptions:
+ +
D:/Code/Projects/psimpl/trunk/lib/psimpl.h [code]
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/ftv2blank.png b/lib/psimpl_v7_src/doc/ftv2blank.png new file mode 100644 index 0000000..3b7a29c Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2blank.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2doc.png b/lib/psimpl_v7_src/doc/ftv2doc.png new file mode 100644 index 0000000..310e441 Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2doc.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2folderclosed.png b/lib/psimpl_v7_src/doc/ftv2folderclosed.png new file mode 100644 index 0000000..79aeaf7 Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2folderclosed.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2folderopen.png b/lib/psimpl_v7_src/doc/ftv2folderopen.png new file mode 100644 index 0000000..1b703dd Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2folderopen.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2lastnode.png b/lib/psimpl_v7_src/doc/ftv2lastnode.png new file mode 100644 index 0000000..3b7a29c Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2lastnode.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2link.png b/lib/psimpl_v7_src/doc/ftv2link.png new file mode 100644 index 0000000..310e441 Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2link.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2mlastnode.png b/lib/psimpl_v7_src/doc/ftv2mlastnode.png new file mode 100644 index 0000000..ec51f17 Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2mlastnode.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2mnode.png b/lib/psimpl_v7_src/doc/ftv2mnode.png new file mode 100644 index 0000000..ec51f17 Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2mnode.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2node.png b/lib/psimpl_v7_src/doc/ftv2node.png new file mode 100644 index 0000000..3b7a29c Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2node.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2plastnode.png b/lib/psimpl_v7_src/doc/ftv2plastnode.png new file mode 100644 index 0000000..270a965 Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2plastnode.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2pnode.png b/lib/psimpl_v7_src/doc/ftv2pnode.png new file mode 100644 index 0000000..270a965 Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2pnode.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2splitbar.png b/lib/psimpl_v7_src/doc/ftv2splitbar.png new file mode 100644 index 0000000..f60a527 Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2splitbar.png differ diff --git a/lib/psimpl_v7_src/doc/ftv2vertline.png b/lib/psimpl_v7_src/doc/ftv2vertline.png new file mode 100644 index 0000000..3b7a29c Binary files /dev/null and b/lib/psimpl_v7_src/doc/ftv2vertline.png differ diff --git a/lib/psimpl_v7_src/doc/functions.html b/lib/psimpl_v7_src/doc/functions.html new file mode 100644 index 0000000..db5f1d8 --- /dev/null +++ b/lib/psimpl_v7_src/doc/functions.html @@ -0,0 +1,300 @@ + + + + +psimpl: Class Members + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + + + +
+
+ +
+
+
+ +
+
+
Here is a list of all class members with links to the classes they belong to:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- f -

+ + +

- g -

+ + +

- i -

+ + +

- k -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- v -

+ + +

- ~ -

+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/functions_func.html b/lib/psimpl_v7_src/doc/functions_func.html new file mode 100644 index 0000000..1feb9d9 --- /dev/null +++ b/lib/psimpl_v7_src/doc/functions_func.html @@ -0,0 +1,244 @@ + + + + +psimpl: Class Members - Functions + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + + + +
+
+ +
+
+
+ +
+
+  + +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- f -

+ + +

- g -

+ + +

- k -

+ + +

- l -

+ + +

- n -

+ + +

- o -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- ~ -

+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/functions_type.html b/lib/psimpl_v7_src/doc/functions_type.html new file mode 100644 index 0000000..ead94f4 --- /dev/null +++ b/lib/psimpl_v7_src/doc/functions_type.html @@ -0,0 +1,91 @@ + + + + +psimpl: Class Members - Typedefs + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + + +
+
+ +
+
+
+ + + + + + diff --git a/lib/psimpl_v7_src/doc/functions_vars.html b/lib/psimpl_v7_src/doc/functions_vars.html new file mode 100644 index 0000000..bee04f0 --- /dev/null +++ b/lib/psimpl_v7_src/doc/functions_vars.html @@ -0,0 +1,114 @@ + + + + +psimpl: Class Members - Variables + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + + +
+
+ +
+
+
+ + + + + + diff --git a/lib/psimpl_v7_src/doc/index.html b/lib/psimpl_v7_src/doc/index.html new file mode 100644 index 0000000..79ff6ed --- /dev/null +++ b/lib/psimpl_v7_src/doc/index.html @@ -0,0 +1,117 @@ + + + + +psimpl: psimpl - generic n-dimensional polyline simplification + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ +
+
+ +
+
+
+ +
+
+
+
psimpl - generic n-dimensional polyline simplification
+
+
+
+    Author  - Elmar de Koning
+    Support - edekoning@gmail.com
+    Website - http://psimpl.sf.net
+    Article - http://www.codeproject.com/KB/recipes/PolylineSimplification.aspx
+    License - MPL 1.1
+


+

+

+psimpl

+
+    'psimpl' is a c++ polyline simplification library that is generic, easy to use, and supports
+    the following algorithms:
    Simplification
+    + Nth point - A naive algorithm that keeps only each nth point
+    + Distance between points - Removes successive points that are clustered together
+    + Perpendicular distance - Removes points based on their distance to the line segment defined
+      by their left and right neighbors
+    + Reumann-Witkam - Shifts a strip along the polyline and removes points that fall outside
+    + Opheim - A constrained version of Reumann-Witkam
+    + Lang - Similar to the Perpendicular distance routine, but instead of looking only at direct
+      neighbors, an entire search region is processed
+    + Douglas-Peucker - A classic simplification algorithm that provides an excellent approximation
+      of the original line
+    + A variation on the Douglas-Peucker algorithm - Slower, but yields better results at lower resolutions
    Errors
+    + positional error - Distance of each polyline point to its simplification
    All the algorithms have been implemented in a single standalone C++ header using an STL-style
+    interface that operates on input and output iterators. Polylines can be of any dimension, and
+    defined using floating point or signed integer data types.
+


+

+

+changelog

+
+    28-09-2010 - Initial version
+    23-10-2010 - Changed license from CPOL to MPL
+    26-10-2010 - Clarified input (type) requirements, and changed the behavior of the algorithms
+                 under invalid input
+    01-12-2010 - Added the nth point, perpendicular distance and Reumann-Witkam routines; moved all
+                 functions related to distance calculations to the math namespace
+    10-12-2010 - Fixed a bug in the perpendicular distance routine
+    27-02-2011 - Added Opheim simplification, and functions for computing positional errors due to
+                 simplification; renamed simplify_douglas_peucker_alt to simplify_douglas_peucker_n
+    18-06-2011 - Added Lang simplification; fixed divide by zero bug when using integers; fixed a
+                 bug where incorrect output iterators were returned under invalid input; fixed a bug
+                 in douglas_peucker_n where an incorrect number of points could be returned; fixed a
+                 bug in compute_positional_errors2 that required the output and input iterator types
+                 to be the same; fixed a bug in compute_positional_error_statistics where invalid
+                 statistics could be returned under questionable input; documented input iterator
+                 requirements for each algorithm; miscellaneous refactoring of most algorithms.
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/jquery.js b/lib/psimpl_v7_src/doc/jquery.js new file mode 100644 index 0000000..c052173 --- /dev/null +++ b/lib/psimpl_v7_src/doc/jquery.js @@ -0,0 +1,54 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0) +{I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function() +{G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); +/* + * jQuery UI 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */ +jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* * jQuery UI Resizable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * ui.core.js + */ +(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f
');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)) +{s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);; +/** + * jQuery.ScrollTo - Easy element scrolling using jQuery. + * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com + * Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php). + * Date: 2/8/2008 + * @author Ariel Flesler + * @version 1.3.2 + */ +;(function($){var o=$.scrollTo=function(a,b,c){o.window().scrollTo(a,b,c)};o.defaults={axis:'y',duration:1};o.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(l,m,n){if(typeof m=='object'){n=m;m=0}n=$.extend({},o.defaults,n);m=m||n.speed||n.duration;n.queue=n.queue&&n.axis.length>1;if(n.queue)m/=2;n.offset=j(n.offset);n.over=j(n.over);return this.each(function(){var a=this,b=$(a),t=l,c,d={},w=b.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=j(t);break}t=$(t,this);case'object':if(t.is||t.style)c=(t=$(t)).offset()}$.each(n.axis.split(''),function(i,f){var P=f=='x'?'Left':'Top',p=P.toLowerCase(),k='scroll'+P,e=a[k],D=f=='x'?'Width':'Height';if(c){d[k]=c[p]+(w?0:e-b.offset()[p]);if(n.margin){d[k]-=parseInt(t.css('margin'+P))||0;d[k]-=parseInt(t.css('border'+P+'Width'))||0}d[k]+=n.offset[p]||0;if(n.over[p])d[k]+=t[D.toLowerCase()]()*n.over[p]}else d[k]=t[p];if(/^\d+$/.test(d[k]))d[k]=d[k]<=0?0:Math.min(d[k],h(D));if(!i&&n.queue){if(e!=d[k])g(n.onAfterFirst);delete d[k]}});g(n.onAfter);function g(a){b.animate(d,m,n.easing,a&&function(){a.call(this,l)})};function h(D){var b=w?$.browser.opera?document.body:document.documentElement:a;return b['scroll'+D]-b['client'+D]}})};function j(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); + diff --git a/lib/psimpl_v7_src/doc/namespacemembers.html b/lib/psimpl_v7_src/doc/namespacemembers.html new file mode 100644 index 0000000..e340156 --- /dev/null +++ b/lib/psimpl_v7_src/doc/namespacemembers.html @@ -0,0 +1,139 @@ + + + + +psimpl: Namespace Members + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + + +
+
+ +
+
+
+ +
+
+
Here is a list of all namespace members with links to the namespace documentation for each member:
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/namespacemembers_func.html b/lib/psimpl_v7_src/doc/namespacemembers_func.html new file mode 100644 index 0000000..babfb27 --- /dev/null +++ b/lib/psimpl_v7_src/doc/namespacemembers_func.html @@ -0,0 +1,139 @@ + + + + +psimpl: Namespace Members + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + + +
+
+ +
+
+
+ +
+
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/namespacepsimpl.html b/lib/psimpl_v7_src/doc/namespacepsimpl.html new file mode 100644 index 0000000..19c3f7a --- /dev/null +++ b/lib/psimpl_v7_src/doc/namespacepsimpl.html @@ -0,0 +1,775 @@ + + + + +psimpl: psimpl Namespace Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl Namespace Reference
+
+
+ +

Root namespace of the polyline simplification library. +More...

+ + + + +

+

+ + +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Namespaces

namespace  math
 

Contains functions for calculating statistics and distances between various geometric entities.

+
namespace  util
 

Contains utility functions and classes.

+

+Classes

class  PolylineSimplification
 Provides various simplification algorithms for n-dimensional simple polylines. More...

+Functions

template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator simplify_nth_point (ForwardIterator first, ForwardIterator last, unsigned n, OutputIterator result)
 Performs the nth point routine (NP).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator simplify_radial_distance (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs the (radial) distance between points routine (RD).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator simplify_perpendicular_distance (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, unsigned repeat, OutputIterator result)
 Repeatedly performs the perpendicular distance routine (PD).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator simplify_perpendicular_distance (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs the perpendicular distance routine (PD).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator simplify_reumann_witkam (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs Reumann-Witkam polyline simplification (RW).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator simplify_opheim (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type min_tol, typename std::iterator_traits< ForwardIterator >::value_type max_tol, OutputIterator result)
 Performs Opheim polyline simplification (OP).
template<unsigned DIM, class BidirectionalIterator , class OutputIterator >
OutputIterator simplify_lang (BidirectionalIterator first, BidirectionalIterator last, typename std::iterator_traits< BidirectionalIterator >::value_type tol, unsigned look_ahead, OutputIterator result)
 Performs Lang polyline simplification (LA).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator simplify_douglas_peucker (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs Douglas-Peucker polyline simplification (DP).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator simplify_douglas_peucker_n (ForwardIterator first, ForwardIterator last, unsigned count, OutputIterator result)
 Performs a variant of Douglas-Peucker polyline simplification (DPn).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator compute_positional_errors2 (ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, OutputIterator result, bool *valid=0)
 Computes the squared positional error between a polyline and its simplification.
template<unsigned DIM, class ForwardIterator >
math::Statistics compute_positional_error_statistics (ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, bool *valid=0)
 Computes statistics for the positional errors between a polyline and its simplification.
+

Detailed Description

+

Root namespace of the polyline simplification library.

+

Function Documentation

+ +
+
+
+template<unsigned DIM, class ForwardIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
math::Statistics psimpl::compute_positional_error_statistics (ForwardIterator original_first,
ForwardIterator original_last,
ForwardIterator simplified_first,
ForwardIterator simplified_last,
bool * valid = 0 
)
+
+
+ +

Computes statistics for the positional errors between a polyline and its simplification.

+

This is a convenience function that provides template type deduction for PolylineSimplification::ComputePositionalErrorStatistics.

+
Parameters:
+ + + + + + +
[in]original_firstthe first coordinate of the first polyline point
[in]original_lastone beyond the last coordinate of the last polyline point
[in]simplified_firstthe first coordinate of the first simplified polyline point
[in]simplified_lastone beyond the last coordinate of the last simplified polyline point
[out]valid[optional] indicates if the computed statistics are valid
+
+
+
Returns:
the computed statistics
+ +
+
+ +
+
+
+template<unsigned DIM, class ForwardIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::compute_positional_errors2 (ForwardIterator original_first,
ForwardIterator original_last,
ForwardIterator simplified_first,
ForwardIterator simplified_last,
OutputIterator result,
bool * valid = 0 
)
+
+
+ +

Computes the squared positional error between a polyline and its simplification.

+

This is a convenience function that provides template type deduction for PolylineSimplification::ComputePositionalErrors2.

+
Parameters:
+ + + + + + + +
[in]original_firstthe first coordinate of the first polyline point
[in]original_lastone beyond the last coordinate of the last polyline point
[in]simplified_firstthe first coordinate of the first simplified polyline point
[in]simplified_lastone beyond the last coordinate of the last simplified polyline point
[in]resultdestination of the squared positional errors
[out]valid[optional] indicates if the computed positional errors are valid
+
+
+
Returns:
one beyond the last computed positional error
+ +
+
+ +
+
+
+template<unsigned DIM, class ForwardIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::simplify_douglas_peucker (ForwardIterator first,
ForwardIterator last,
typename std::iterator_traits< ForwardIterator >::value_type tol,
OutputIterator result 
)
+
+
+ +

Performs Douglas-Peucker polyline simplification (DP).

+

This is a convenience function that provides template type deduction for PolylineSimplification::DouglasPeucker.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (point-to-segment) distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class ForwardIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::simplify_douglas_peucker_n (ForwardIterator first,
ForwardIterator last,
unsigned count,
OutputIterator result 
)
+
+
+ +

Performs a variant of Douglas-Peucker polyline simplification (DPn).

+

This is a convenience function that provides template type deduction for PolylineSimplification::DouglasPeuckerAlt.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]countthe maximum number of points of the simplified polyline
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class BidirectionalIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::simplify_lang (BidirectionalIterator first,
BidirectionalIterator last,
typename std::iterator_traits< BidirectionalIterator >::value_type tol,
unsigned look_ahead,
OutputIterator result 
)
+
+
+ +

Performs Lang polyline simplification (LA).

+

This is a convenience function that provides template type deduction for PolylineSimplification::Lang.

+
Parameters:
+ + + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (point-to-segment) distance tolerance
[in]look_aheaddefines the size of the search region
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class ForwardIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::simplify_nth_point (ForwardIterator first,
ForwardIterator last,
unsigned n,
OutputIterator result 
)
+
+
+ +

Performs the nth point routine (NP).

+

This is a convenience function that provides template type deduction for PolylineSimplification::NthPoint.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]nspecifies 'each nth point'
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class ForwardIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::simplify_opheim (ForwardIterator first,
ForwardIterator last,
typename std::iterator_traits< ForwardIterator >::value_type min_tol,
typename std::iterator_traits< ForwardIterator >::value_type max_tol,
OutputIterator result 
)
+
+
+ +

Performs Opheim polyline simplification (OP).

+

This is a convenience function that provides template type deduction for PolylineSimplification::Opheim.

+
Parameters:
+ + + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]min_tolminimum distance tolerance
[in]max_tolmaximum distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class ForwardIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::simplify_perpendicular_distance (ForwardIterator first,
ForwardIterator last,
typename std::iterator_traits< ForwardIterator >::value_type tol,
OutputIterator result 
)
+
+
+ +

Performs the perpendicular distance routine (PD).

+

This is a convenience function that provides template type deduction for PolylineSimplification::PerpendicularDistance.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (segment-to-point) distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class ForwardIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::simplify_perpendicular_distance (ForwardIterator first,
ForwardIterator last,
typename std::iterator_traits< ForwardIterator >::value_type tol,
unsigned repeat,
OutputIterator result 
)
+
+
+ +

Repeatedly performs the perpendicular distance routine (PD).

+

This is a convenience function that provides template type deduction for PolylineSimplification::PerpendicularDistance.

+
Parameters:
+ + + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (segment-to-point) distance tolerance
[in]repeatthe number of times to successively apply the PD routine.
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class ForwardIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::simplify_radial_distance (ForwardIterator first,
ForwardIterator last,
typename std::iterator_traits< ForwardIterator >::value_type tol,
OutputIterator result 
)
+
+
+ +

Performs the (radial) distance between points routine (RD).

+

This is a convenience function that provides template type deduction for PolylineSimplification::RadialDistance.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolradial (point-to-point) distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+ +
+
+
+template<unsigned DIM, class ForwardIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::simplify_reumann_witkam (ForwardIterator first,
ForwardIterator last,
typename std::iterator_traits< ForwardIterator >::value_type tol,
OutputIterator result 
)
+
+
+ +

Performs Reumann-Witkam polyline simplification (RW).

+

This is a convenience function that provides template type deduction for PolylineSimplification::ReumannWitkam.

+
Parameters:
+ + + + + +
[in]firstthe first coordinate of the first polyline point
[in]lastone beyond the last coordinate of the last polyline point
[in]tolperpendicular (point-to-line) distance tolerance
[in]resultdestination of the simplified polyline
+
+
+
Returns:
one beyond the last coordinate of the simplified polyline
+ +
+
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/namespacepsimpl_1_1math.html b/lib/psimpl_v7_src/doc/namespacepsimpl_1_1math.html new file mode 100644 index 0000000..190c7d9 --- /dev/null +++ b/lib/psimpl_v7_src/doc/namespacepsimpl_1_1math.html @@ -0,0 +1,519 @@ + + + + +psimpl: psimpl::math Namespace Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl::math Namespace Reference
+
+
+ +

Contains functions for calculating statistics and distances between various geometric entities. +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

struct  Statistics
 POD structure for storing several statistical values. More...

+Functions

template<unsigned DIM, class InputIterator >
bool equal (InputIterator p1, InputIterator p2)
 Determines if two points have the exact same coordinates.
template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator make_vector (InputIterator p1, InputIterator p2, OutputIterator result)
 Creates a vector from two points.
template<unsigned DIM, class InputIterator >
std::iterator_traits
+< InputIterator >::value_type 
dot (InputIterator v1, InputIterator v2)
 Computes the dot product of two vectors.
template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator interpolate (InputIterator p1, InputIterator p2, float fraction, OutputIterator result)
 Peforms linear interpolation between two points.
template<unsigned DIM, class InputIterator1 , class InputIterator2 >
std::iterator_traits
+< InputIterator1 >::value_type 
point_distance2 (InputIterator1 p1, InputIterator2 p2)
 Computes the squared distance of two points.
template<unsigned DIM, class InputIterator >
std::iterator_traits
+< InputIterator >::value_type 
line_distance2 (InputIterator l1, InputIterator l2, InputIterator p)
 Computes the squared distance between an infinite line (l1, l2) and a point p.
template<unsigned DIM, class InputIterator >
std::iterator_traits
+< InputIterator >::value_type 
segment_distance2 (InputIterator s1, InputIterator s2, InputIterator p)
 Computes the squared distance between a line segment (s1, s2) and a point p.
template<unsigned DIM, class InputIterator >
std::iterator_traits
+< InputIterator >::value_type 
ray_distance2 (InputIterator r1, InputIterator r2, InputIterator p)
 Computes the squared distance between a ray (r1, r2) and a point p.
template<class InputIterator >
Statistics compute_statistics (InputIterator first, InputIterator last)
 Computes various statistics for the range [first, last)
+

Detailed Description

+

Contains functions for calculating statistics and distances between various geometric entities.

+

Function Documentation

+ +
+
+
+template<class InputIterator >
+ + + + + + + + + + + + + + + + + + +
Statistics psimpl::math::compute_statistics (InputIterator first,
InputIterator last 
) [inline]
+
+
+ +

Computes various statistics for the range [first, last)

+
Parameters:
+ + + +
[in]firstthe first value
[in]lastone beyond the last value
+
+
+
Returns:
the calculated statistics
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator >
+ + + + + + + + + + + + + + + + + + +
std::iterator_traits<InputIterator>::value_type psimpl::math::dot (InputIterator v1,
InputIterator v2 
) [inline]
+
+
+ +

Computes the dot product of two vectors.

+
Parameters:
+ + + +
[in]v1the first coordinate of the first vector
[in]v2the first coordinate of the second vector
+
+
+
Returns:
the dot product (v1 * v2)
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator >
+ + + + + + + + + + + + + + + + + + +
bool psimpl::math::equal (InputIterator p1,
InputIterator p2 
) [inline]
+
+
+ +

Determines if two points have the exact same coordinates.

+
Parameters:
+ + + +
[in]p1the first coordinate of the first point
[in]p2the first coordinate of the second point
+
+
+
Returns:
true when the points are equal; false otherwise
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::math::interpolate (InputIterator p1,
InputIterator p2,
float fraction,
OutputIterator result 
) [inline]
+
+
+ +

Peforms linear interpolation between two points.

+
Parameters:
+ + + + + +
[in]p1the first coordinate of the first point
[in]p2the first coordinate of the second point
[in]fractionthe fraction used during interpolation
[in]resultthe interpolation result (p1 + fraction * (p2 - p1))
+
+
+
Returns:
one beyond the last coordinate of the interpolated point
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::iterator_traits<InputIterator>::value_type psimpl::math::line_distance2 (InputIterator l1,
InputIterator l2,
InputIterator p 
) [inline]
+
+
+ +

Computes the squared distance between an infinite line (l1, l2) and a point p.

+
Parameters:
+ + + + +
[in]l1the first coordinate of the first point on the line
[in]l2the first coordinate of the second point on the line
[in]pthe first coordinate of the test point
+
+
+
Returns:
the squared distance
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator , class OutputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + +
OutputIterator psimpl::math::make_vector (InputIterator p1,
InputIterator p2,
OutputIterator result 
) [inline]
+
+
+ +

Creates a vector from two points.

+
Parameters:
+ + + + +
[in]p1the first coordinate of the first point
[in]p2the first coordinate of the second point
[in]resultthe resulting vector (p2-p1)
+
+
+
Returns:
one beyond the last coordinate of the resulting vector
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator1 , class InputIterator2 >
+ + + + + + + + + + + + + + + + + + +
std::iterator_traits<InputIterator1>::value_type psimpl::math::point_distance2 (InputIterator1 p1,
InputIterator2 p2 
) [inline]
+
+
+ +

Computes the squared distance of two points.

+
Parameters:
+ + + +
[in]p1the first coordinate of the first point
[in]p2the first coordinate of the second point
+
+
+
Returns:
the squared distance
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::iterator_traits<InputIterator>::value_type psimpl::math::ray_distance2 (InputIterator r1,
InputIterator r2,
InputIterator p 
) [inline]
+
+
+ +

Computes the squared distance between a ray (r1, r2) and a point p.

+
Parameters:
+ + + + +
[in]r1the first coordinate of the start point of the ray
[in]r2the first coordinate of a point on the ray
[in]pthe first coordinate of the test point
+
+
+
Returns:
the squared distance
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator >
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::iterator_traits<InputIterator>::value_type psimpl::math::segment_distance2 (InputIterator s1,
InputIterator s2,
InputIterator p 
) [inline]
+
+
+ +

Computes the squared distance between a line segment (s1, s2) and a point p.

+
Parameters:
+ + + + +
[in]s1the first coordinate of the start point of the segment
[in]s2the first coordinate of the end point of the segment
[in]pthe first coordinate of the test point
+
+
+
Returns:
the squared distance
+ +
+
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/namespacepsimpl_1_1util.html b/lib/psimpl_v7_src/doc/namespacepsimpl_1_1util.html new file mode 100644 index 0000000..2780c0e --- /dev/null +++ b/lib/psimpl_v7_src/doc/namespacepsimpl_1_1util.html @@ -0,0 +1,125 @@ + + + + +psimpl: psimpl::util Namespace Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl::util Namespace Reference
+
+
+ +

Contains utility functions and classes. +More...

+ + + + + + + +

+Classes

class  scoped_array
 A smart pointer for holding a dynamically allocated array. More...

+Functions

template<typename T >
void swap (scoped_array< T > &a, scoped_array< T > &b)
+

Detailed Description

+

Contains utility functions and classes.

+

Function Documentation

+ +
+
+
+template<typename T >
+ + + + + + + + + + + + + + + + + + +
void psimpl::util::swap (scoped_array< T > & a,
scoped_array< T > & b 
) [inline]
+
+
+ +
+
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/namespaces.html b/lib/psimpl_v7_src/doc/namespaces.html new file mode 100644 index 0000000..c8405d0 --- /dev/null +++ b/lib/psimpl_v7_src/doc/namespaces.html @@ -0,0 +1,80 @@ + + + + +psimpl: Namespace List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
Namespace List
+
+
+
Here is a list of all namespaces with brief descriptions:
+ + + +
psimplRoot namespace of the polyline simplification library
psimpl::mathContains functions for calculating statistics and distances between various geometric entities
psimpl::utilContains utility functions and classes
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/nav_f.png b/lib/psimpl_v7_src/doc/nav_f.png new file mode 100644 index 0000000..1b07a16 Binary files /dev/null and b/lib/psimpl_v7_src/doc/nav_f.png differ diff --git a/lib/psimpl_v7_src/doc/nav_h.png b/lib/psimpl_v7_src/doc/nav_h.png new file mode 100644 index 0000000..01f5fa6 Binary files /dev/null and b/lib/psimpl_v7_src/doc/nav_h.png differ diff --git a/lib/psimpl_v7_src/doc/navtree.css b/lib/psimpl_v7_src/doc/navtree.css new file mode 100644 index 0000000..e46ffcd --- /dev/null +++ b/lib/psimpl_v7_src/doc/navtree.css @@ -0,0 +1,123 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; + outline:none; +} + +#nav-tree .label { + margin:0px; + padding:0px; +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + padding:2px; + margin:0px; + color:#fff; +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + background-color: #FAFAFF; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: 300px; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background:url("ftv2splitbar.png") repeat scroll right center transparent; + cursor:e-resize; + height:100%; + right:0; + top:0; + width:6px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; +} + + + diff --git a/lib/psimpl_v7_src/doc/navtree.js b/lib/psimpl_v7_src/doc/navtree.js new file mode 100644 index 0000000..ed13f0e --- /dev/null +++ b/lib/psimpl_v7_src/doc/navtree.js @@ -0,0 +1,275 @@ +var NAVTREE = +[ + [ "psimpl", "index.html", [ + [ "psimpl - generic n-dimensional polyline simplification", "index.html", null ], + [ "Class List", "annotated.html", [ + [ "psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper", "classpsimpl_1_1_polyline_simplification_1_1_d_p_helper.html", null ], + [ "psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo", "structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_key_info.html", null ], + [ "psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >", "classpsimpl_1_1_polyline_simplification.html", null ], + [ "psimpl::util::scoped_array< T >", "classpsimpl_1_1util_1_1scoped__array.html", null ], + [ "psimpl::math::Statistics", "structpsimpl_1_1math_1_1_statistics.html", null ], + [ "psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly", "structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly.html", null ], + [ "psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt", "structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly_alt.html", null ] + ] ], + [ "Class Index", "classes.html", null ], + [ "Class Members", "functions.html", null ], + [ "Namespace List", "namespaces.html", [ + [ "psimpl", "namespacepsimpl.html", null ], + [ "psimpl::math", "namespacepsimpl_1_1math.html", null ], + [ "psimpl::util", "namespacepsimpl_1_1util.html", null ] + ] ], + [ "Namespace Members", "namespacemembers.html", null ], + [ "File List", "files.html", [ + [ "D:/Code/Projects/psimpl/trunk/lib/psimpl.h", "psimpl_8h.html", null ] + ] ], + [ "Directories", "dirs.html", [ + [ "lib", "dir_f9993e17f36afaef24d7a404e932861e.html", null ] + ] ] + ] ] +]; + +function createIndent(o,domNode,node,level) +{ + if (node.parentNode && node.parentNode.parentNode) + { + createIndent(o,domNode,node.parentNode,level+1); + } + var imgNode = document.createElement("img"); + if (level==0 && node.childrenData) + { + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() + { + if (node.expanded) + { + $(node.getChildrenUL()).slideUp("fast"); + if (node.isLast) + { + node.plus_img.src = node.relpath+"ftv2plastnode.png"; + } + else + { + node.plus_img.src = node.relpath+"ftv2pnode.png"; + } + node.expanded = false; + } + else + { + expandNode(o, node, false); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } + else + { + domNode.appendChild(imgNode); + } + if (level==0) + { + if (node.isLast) + { + if (node.childrenData) + { + imgNode.src = node.relpath+"ftv2plastnode.png"; + } + else + { + imgNode.src = node.relpath+"ftv2lastnode.png"; + domNode.appendChild(imgNode); + } + } + else + { + if (node.childrenData) + { + imgNode.src = node.relpath+"ftv2pnode.png"; + } + else + { + imgNode.src = node.relpath+"ftv2node.png"; + domNode.appendChild(imgNode); + } + } + } + else + { + if (node.isLast) + { + imgNode.src = node.relpath+"ftv2blank.png"; + } + else + { + imgNode.src = node.relpath+"ftv2vertline.png"; + } + } + imgNode.border = "0"; +} + +function newNode(o, po, text, link, childrenData, lastNode) +{ + var node = new Object(); + node.children = Array(); + node.childrenData = childrenData; + node.depth = po.depth + 1; + node.relpath = po.relpath; + node.isLast = lastNode; + + node.li = document.createElement("li"); + po.getChildrenUL().appendChild(node.li); + node.parentNode = po; + + node.itemDiv = document.createElement("div"); + node.itemDiv.className = "item"; + + node.labelSpan = document.createElement("span"); + node.labelSpan.className = "label"; + + createIndent(o,node.itemDiv,node,0); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + var a = document.createElement("a"); + node.labelSpan.appendChild(a); + node.label = document.createTextNode(text); + a.appendChild(node.label); + if (link) + { + a.href = node.relpath+link; + } + else + { + if (childrenData != null) + { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + node.expanded = false; + } + } + + node.childrenUL = null; + node.getChildrenUL = function() + { + if (!node.childrenUL) + { + node.childrenUL = document.createElement("ul"); + node.childrenUL.className = "children_ul"; + node.childrenUL.style.display = "none"; + node.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }; + + return node; +} + +function showRoot() +{ + var headerHeight = $("#top").height(); + var footerHeight = $("#nav-path").height(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + navtree.scrollTo('#selected',0,{offset:-windowHeight/2}); +} + +function expandNode(o, node, imm) +{ + if (node.childrenData && !node.expanded) + { + if (!node.childrenVisited) + { + getNode(o, node); + } + if (imm) + { + $(node.getChildrenUL()).show(); + } + else + { + $(node.getChildrenUL()).slideDown("fast",showRoot); + } + if (node.isLast) + { + node.plus_img.src = node.relpath+"ftv2mlastnode.png"; + } + else + { + node.plus_img.src = node.relpath+"ftv2mnode.png"; + } + node.expanded = true; + } +} + +function getNode(o, po) +{ + po.childrenVisited = true; + var l = po.childrenData.length-1; + for (var i in po.childrenData) + { + var nodeData = po.childrenData[i]; + po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2], + i==l); + } +} + +function findNavTreePage(url, data) +{ + var nodes = data; + var result = null; + for (var i in nodes) + { + var d = nodes[i]; + if (d[1] == url) + { + return new Array(i); + } + else if (d[2] != null) // array of children + { + result = findNavTreePage(url, d[2]); + if (result != null) + { + return (new Array(i).concat(result)); + } + } + } + return null; +} + +function initNavTree(toroot,relpath) +{ + var o = new Object(); + o.toroot = toroot; + o.node = new Object(); + o.node.li = document.getElementById("nav-tree-contents"); + o.node.childrenData = NAVTREE; + o.node.children = new Array(); + o.node.childrenUL = document.createElement("ul"); + o.node.getChildrenUL = function() { return o.node.childrenUL; }; + o.node.li.appendChild(o.node.childrenUL); + o.node.depth = 0; + o.node.relpath = relpath; + + getNode(o, o.node); + + o.breadcrumbs = findNavTreePage(toroot, NAVTREE); + if (o.breadcrumbs == null) + { + o.breadcrumbs = findNavTreePage("index.html",NAVTREE); + } + if (o.breadcrumbs != null && o.breadcrumbs.length>0) + { + var p = o.node; + for (var i in o.breadcrumbs) + { + var j = o.breadcrumbs[i]; + p = p.children[j]; + expandNode(o,p,true); + } + p.itemDiv.className = p.itemDiv.className + " selected"; + p.itemDiv.id = "selected"; + $(window).load(showRoot); + } +} + diff --git a/lib/psimpl_v7_src/doc/open.png b/lib/psimpl_v7_src/doc/open.png new file mode 100644 index 0000000..7b35d2c Binary files /dev/null and b/lib/psimpl_v7_src/doc/open.png differ diff --git a/lib/psimpl_v7_src/doc/psimpl_8h.html b/lib/psimpl_v7_src/doc/psimpl_8h.html new file mode 100644 index 0000000..dd8a977 --- /dev/null +++ b/lib/psimpl_v7_src/doc/psimpl_8h.html @@ -0,0 +1,190 @@ + + + + +psimpl: D:/Code/Projects/psimpl/trunk/lib/psimpl.h File Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl.h File Reference
+
+
+
#include <queue>
+#include <stack>
+#include <numeric>
+#include <algorithm>
+#include <cmath>
+
+

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + +

+

+ + +

+

+ + +

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  psimpl::util::scoped_array< T >
 A smart pointer for holding a dynamically allocated array. More...
struct  psimpl::math::Statistics
 POD structure for storing several statistical values. More...
class  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >
 Provides various simplification algorithms for n-dimensional simple polylines. More...
class  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper
 Douglas-Peucker approximation helper class. More...
struct  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly
 Defines a sub polyline. More...
struct  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo
 Defines the key of a polyline. More...
struct  psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt
 Defines a sub polyline including its key. More...

+Namespaces

namespace  psimpl
 

Root namespace of the polyline simplification library.

+
namespace  psimpl::util
 

Contains utility functions and classes.

+
namespace  psimpl::math
 

Contains functions for calculating statistics and distances between various geometric entities.

+

+Functions

template<typename T >
void psimpl::util::swap (scoped_array< T > &a, scoped_array< T > &b)
template<unsigned DIM, class InputIterator >
bool psimpl::math::equal (InputIterator p1, InputIterator p2)
 Determines if two points have the exact same coordinates.
template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator psimpl::math::make_vector (InputIterator p1, InputIterator p2, OutputIterator result)
 Creates a vector from two points.
template<unsigned DIM, class InputIterator >
std::iterator_traits
+< InputIterator >::value_type 
psimpl::math::dot (InputIterator v1, InputIterator v2)
 Computes the dot product of two vectors.
template<unsigned DIM, class InputIterator , class OutputIterator >
OutputIterator psimpl::math::interpolate (InputIterator p1, InputIterator p2, float fraction, OutputIterator result)
 Peforms linear interpolation between two points.
template<unsigned DIM, class InputIterator1 , class InputIterator2 >
std::iterator_traits
+< InputIterator1 >::value_type 
psimpl::math::point_distance2 (InputIterator1 p1, InputIterator2 p2)
 Computes the squared distance of two points.
template<unsigned DIM, class InputIterator >
std::iterator_traits
+< InputIterator >::value_type 
psimpl::math::line_distance2 (InputIterator l1, InputIterator l2, InputIterator p)
 Computes the squared distance between an infinite line (l1, l2) and a point p.
template<unsigned DIM, class InputIterator >
std::iterator_traits
+< InputIterator >::value_type 
psimpl::math::segment_distance2 (InputIterator s1, InputIterator s2, InputIterator p)
 Computes the squared distance between a line segment (s1, s2) and a point p.
template<unsigned DIM, class InputIterator >
std::iterator_traits
+< InputIterator >::value_type 
psimpl::math::ray_distance2 (InputIterator r1, InputIterator r2, InputIterator p)
 Computes the squared distance between a ray (r1, r2) and a point p.
template<class InputIterator >
Statistics psimpl::math::compute_statistics (InputIterator first, InputIterator last)
 Computes various statistics for the range [first, last)
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_nth_point (ForwardIterator first, ForwardIterator last, unsigned n, OutputIterator result)
 Performs the nth point routine (NP).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_radial_distance (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs the (radial) distance between points routine (RD).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_perpendicular_distance (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, unsigned repeat, OutputIterator result)
 Repeatedly performs the perpendicular distance routine (PD).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_perpendicular_distance (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs the perpendicular distance routine (PD).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_reumann_witkam (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs Reumann-Witkam polyline simplification (RW).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_opheim (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type min_tol, typename std::iterator_traits< ForwardIterator >::value_type max_tol, OutputIterator result)
 Performs Opheim polyline simplification (OP).
template<unsigned DIM, class BidirectionalIterator , class OutputIterator >
OutputIterator psimpl::simplify_lang (BidirectionalIterator first, BidirectionalIterator last, typename std::iterator_traits< BidirectionalIterator >::value_type tol, unsigned look_ahead, OutputIterator result)
 Performs Lang polyline simplification (LA).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_douglas_peucker (ForwardIterator first, ForwardIterator last, typename std::iterator_traits< ForwardIterator >::value_type tol, OutputIterator result)
 Performs Douglas-Peucker polyline simplification (DP).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::simplify_douglas_peucker_n (ForwardIterator first, ForwardIterator last, unsigned count, OutputIterator result)
 Performs a variant of Douglas-Peucker polyline simplification (DPn).
template<unsigned DIM, class ForwardIterator , class OutputIterator >
OutputIterator psimpl::compute_positional_errors2 (ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, OutputIterator result, bool *valid=0)
 Computes the squared positional error between a polyline and its simplification.
template<unsigned DIM, class ForwardIterator >
math::Statistics psimpl::compute_positional_error_statistics (ForwardIterator original_first, ForwardIterator original_last, ForwardIterator simplified_first, ForwardIterator simplified_last, bool *valid=0)
 Computes statistics for the positional errors between a polyline and its simplification.
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/psimpl_8h_source.html b/lib/psimpl_v7_src/doc/psimpl_8h_source.html new file mode 100644 index 0000000..10418ee --- /dev/null +++ b/lib/psimpl_v7_src/doc/psimpl_8h_source.html @@ -0,0 +1,1203 @@ + + + + +psimpl: D:/Code/Projects/psimpl/trunk/lib/psimpl.h Source File + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
psimpl.h
+
+
+Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
+00002  * Version: MPL 1.1
+00003  *
+00004  * The contents of this file are subject to the Mozilla Public License Version
+00005  * 1.1 (the "License"); you may not use this file except in compliance with
+00006  * the License. You may obtain a copy of the License at
+00007  * http://www.mozilla.org/MPL/
+00008  *
+00009  * Software distributed under the License is distributed on an "AS IS" basis,
+00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+00011  * for the specific language governing rights and limitations under the
+00012  * License.
+00013  *
+00014  * The Original Code is
+00015  * 'psimpl - generic n-dimensional polyline simplification'.
+00016  *
+00017  * The Initial Developer of the Original Code is
+00018  * Elmar de Koning.
+00019  * Portions created by the Initial Developer are Copyright (C) 2010-2011
+00020  * the Initial Developer. All Rights Reserved.
+00021  *
+00022  * Contributor(s):
+00023  *
+00024  * ***** END LICENSE BLOCK ***** */
+00025 
+00026 /*
+00027     psimpl - generic n-dimensional polyline simplification
+00028     Copyright (C) 2010-2011 Elmar de Koning, edekoning@gmail.com
+00029 
+00030     This file is part of psimpl, and is hosted at SourceForge:
+00031     http://sourceforge.net/projects/psimpl/
+00032 */
+00033 
+00092 #ifndef PSIMPL_GENERIC
+00093 #define PSIMPL_GENERIC
+00094 
+00095 
+00096 #include <queue>
+00097 #include <stack>
+00098 #include <numeric>
+00099 #include <algorithm>
+00100 #include <cmath>
+00101 
+00102 
+00106 namespace psimpl
+00107 {
+00111     namespace util
+00112     {
+00118         template <typename T>
+00119         class scoped_array
+00120         {
+00121         public:
+00122             scoped_array (unsigned n) {
+00123                 array = new T [n];
+00124             }
+00125 
+00126             ~scoped_array () {
+00127                 delete [] array;
+00128             }
+00129 
+00130             T& operator [] (int offset) {
+00131                 return array [offset];
+00132             }
+00133 
+00134             const T& operator [] (int offset) const {
+00135                 return array [offset];
+00136             }
+00137 
+00138             T* get () const {
+00139                 return array;
+00140             }
+00141 
+00142             void swap (scoped_array& b) {
+00143                 T* tmp = b.array;
+00144                 b.array = array;
+00145                 array = tmp;
+00146             }
+00147 
+00148         private:
+00149             scoped_array (const scoped_array&);
+00150             scoped_array& operator= (const scoped_array&);
+00151 
+00152         private:
+00153             T* array;
+00154         };
+00155 
+00156         template <typename T> inline void swap (scoped_array <T>& a, scoped_array <T>& b) {
+00157             a.swap (b);
+00158         }
+00159     }
+00160 
+00164     namespace math
+00165     {
+00169         struct Statistics
+00170         {
+00171             Statistics () :
+00172                 max (0),
+00173                 sum (0),
+00174                 mean (0),
+00175                 std (0)
+00176             {}
+00177 
+00178             double max;
+00179             double sum;
+00180             double mean;
+00181             double std;     
+00182         };
+00183 
+00191         template <unsigned DIM, class InputIterator>
+00192         inline bool equal (
+00193             InputIterator p1,
+00194             InputIterator p2)
+00195         {
+00196             for (unsigned d = 0; d < DIM; ++d) {
+00197                 if (*p1 != *p2) {
+00198                     return false;
+00199                 }
+00200                 ++p1;
+00201                 ++p2;
+00202             }
+00203             return true;
+00204         }
+00205 
+00214         template <unsigned DIM, class InputIterator, class OutputIterator>
+00215         inline OutputIterator make_vector (
+00216             InputIterator p1,
+00217             InputIterator p2,
+00218             OutputIterator result)
+00219         {
+00220             for (unsigned d = 0; d < DIM; ++d) {
+00221                 *result = *p2 - *p1;
+00222                 ++result;
+00223                 ++p1;
+00224                 ++p2;
+00225             }
+00226             return result;
+00227         }
+00228 
+00236         template <unsigned DIM, class InputIterator>
+00237         inline typename std::iterator_traits <InputIterator>::value_type dot (
+00238             InputIterator v1,
+00239             InputIterator v2)
+00240         {
+00241             typename std::iterator_traits <InputIterator>::value_type result = 0;
+00242             for (unsigned d = 0; d < DIM; ++d) {
+00243                 result += (*v1) * (*v2);
+00244                 ++v1;
+00245                 ++v2;
+00246             }
+00247             return result;
+00248         }
+00249 
+00259         template <unsigned DIM, class InputIterator, class OutputIterator>
+00260         inline OutputIterator interpolate (
+00261             InputIterator p1,
+00262             InputIterator p2,
+00263             float fraction,
+00264             OutputIterator result)
+00265         {
+00266             typedef typename std::iterator_traits <InputIterator>::value_type value_type;
+00267 
+00268             for (unsigned d = 0; d < DIM; ++d) {
+00269                 *result = *p1 + static_cast <value_type> (fraction * (*p2 - *p1));
+00270                 ++result;
+00271                 ++p1;
+00272                 ++p2;
+00273             }
+00274             return result;
+00275         }
+00276 
+00284         template <unsigned DIM, class InputIterator1, class InputIterator2>
+00285         inline typename std::iterator_traits <InputIterator1>::value_type point_distance2 (
+00286             InputIterator1 p1,
+00287             InputIterator2 p2)
+00288         {
+00289             typename std::iterator_traits <InputIterator1>::value_type result = 0;
+00290             for (unsigned d = 0; d < DIM; ++d) {
+00291                 result += (*p1 - *p2) * (*p1 - *p2);
+00292                 ++p1;
+00293                 ++p2;
+00294             }
+00295             return result;
+00296         }
+00297 
+00306         template <unsigned DIM, class InputIterator>
+00307         inline typename std::iterator_traits <InputIterator>::value_type line_distance2 (
+00308             InputIterator l1,
+00309             InputIterator l2,
+00310             InputIterator p)
+00311         {
+00312             typedef typename std::iterator_traits <InputIterator>::value_type value_type;
+00313 
+00314             value_type v [DIM];                 // vector l1 --> l2
+00315             value_type w [DIM];                 // vector l1 --> p
+00316 
+00317             make_vector <DIM> (l1, l2, v);
+00318             make_vector <DIM> (l1, p,  w);
+00319 
+00320             value_type cv = dot <DIM> (v, v);   // squared length of v
+00321             value_type cw = dot <DIM> (w, v);   // project w onto v
+00322 
+00323             // avoid problems with divisions when value_type is an integer type
+00324             float fraction = cv == 0 ? 0 : static_cast <float> (cw) / static_cast <float> (cv);
+00325 
+00326             value_type proj [DIM];              // p projected onto line (l1, l2)
+00327             interpolate <DIM> (l1, l2, fraction, proj);
+00328 
+00329             return point_distance2 <DIM> (p, proj);
+00330         }
+00331 
+00340         template <unsigned DIM, class InputIterator>
+00341         inline typename std::iterator_traits <InputIterator>::value_type segment_distance2 (
+00342             InputIterator s1,
+00343             InputIterator s2,
+00344             InputIterator p)
+00345         {
+00346             typedef typename std::iterator_traits <InputIterator>::value_type value_type;
+00347 
+00348             value_type v [DIM];        // vector s1 --> s2
+00349             value_type w [DIM];        // vector s1 --> p
+00350 
+00351             make_vector <DIM> (s1, s2, v);
+00352             make_vector <DIM> (s1, p,  w);
+00353 
+00354             value_type cw = dot <DIM> (w, v);   // project w onto v
+00355             if (cw <= 0) {
+00356                 // projection of w lies to the left of s1
+00357                 return point_distance2 <DIM> (p, s1);
+00358             }
+00359 
+00360             value_type cv = dot <DIM> (v, v);   // squared length of v
+00361             if (cv <= cw) {
+00362                 // projection of w lies to the right of s2
+00363                 return point_distance2 <DIM> (p, s2);
+00364             }
+00365 
+00366             // avoid problems with divisions when value_type is an integer type
+00367             float fraction = cv == 0 ? 0 : static_cast <float> (cw) / static_cast <float> (cv);
+00368 
+00369             value_type proj [DIM];    // p projected onto segement (s1, s2)
+00370             interpolate <DIM> (s1, s2, fraction, proj);
+00371 
+00372             return point_distance2 <DIM> (p, proj);
+00373         }
+00374 
+00383         template <unsigned DIM, class InputIterator>
+00384         inline typename std::iterator_traits <InputIterator>::value_type ray_distance2 (
+00385             InputIterator r1,
+00386             InputIterator r2,
+00387             InputIterator p)
+00388         {
+00389             typedef typename std::iterator_traits <InputIterator>::value_type value_type;
+00390 
+00391             value_type v [DIM];        // vector r1 --> r2
+00392             value_type w [DIM];        // vector r1 --> p
+00393 
+00394             make_vector <DIM> (r1, r2, v);
+00395             make_vector <DIM> (r1, p,  w);
+00396 
+00397             value_type cv = dot <DIM> (v, v);    // squared length of v
+00398             value_type cw = dot <DIM> (w, v);    // project w onto v
+00399 
+00400             if (cw <= 0) {
+00401                 // projection of w lies to the left of r1 (not on the ray)
+00402                 return point_distance2 <DIM> (p, r1);
+00403             }
+00404 
+00405             // avoid problems with divisions when value_type is an integer type
+00406             float fraction = cv == 0 ? 0 : static_cast <float> (cw) / static_cast <float> (cv);
+00407 
+00408             value_type proj [DIM];    // p projected onto ray (r1, r2)
+00409             interpolate <DIM> (r1, r2, fraction, proj);
+00410 
+00411             return point_distance2 <DIM> (p, proj);
+00412         }
+00413 
+00421         template <class InputIterator>
+00422         inline Statistics compute_statistics (
+00423             InputIterator first,
+00424             InputIterator last)
+00425         {
+00426             typedef typename std::iterator_traits <InputIterator>::value_type value_type;
+00427             typedef typename std::iterator_traits <InputIterator>::difference_type diff_type;
+00428 
+00429             Statistics stats;
+00430 
+00431             diff_type count = std::distance (first, last);
+00432             if (count == 0) {
+00433                 return stats;
+00434             }
+00435 
+00436             value_type init = 0;
+00437             stats.max = static_cast <double> (*std::max_element (first, last));
+00438             stats.sum = static_cast <double> (std::accumulate (first, last, init));
+00439             stats.mean = stats.sum / count;
+00440             std::transform (first, last, first, std::bind2nd (std::minus <value_type> (), stats.mean));
+00441             stats.std = std::sqrt (static_cast <double> (std::inner_product (first, last, first, init)) / count);
+00442             return stats;
+00443         }
+00444     }
+00445 
+00453     template <unsigned DIM, class InputIterator, class OutputIterator>
+00454     class PolylineSimplification
+00455     {
+00456         typedef typename std::iterator_traits <InputIterator>::difference_type diff_type;
+00457         typedef typename std::iterator_traits <InputIterator>::value_type value_type;
+00458         typedef typename std::iterator_traits <const value_type*>::difference_type ptr_diff_type;
+00459 
+00460     public:
+00492         OutputIterator NthPoint (
+00493             InputIterator first,
+00494             InputIterator last,
+00495             unsigned n,
+00496             OutputIterator result)
+00497         {
+00498             diff_type coordCount = std::distance (first, last);
+00499             diff_type pointCount = DIM              // protect against zero DIM
+00500                                    ? coordCount / DIM
+00501                                    : 0;
+00502 
+00503             // validate input and check if simplification required
+00504             if (coordCount % DIM || pointCount < 3 || n < 2) {
+00505                 return std::copy (first, last, result);
+00506             }
+00507 
+00508             unsigned remaining = pointCount - 1;    // the number of points remaining after key
+00509             InputIterator key = first;              // indicates the current key
+00510 
+00511             // the first point is always part of the simplification
+00512             CopyKey (key, result);
+00513 
+00514             // copy each nth point
+00515             while (Forward (key, n, remaining)) {
+00516                 CopyKey (key, result);
+00517             }
+00518 
+00519             return result;
+00520         }
+00521 
+00554         OutputIterator RadialDistance (
+00555             InputIterator first,
+00556             InputIterator last,
+00557             value_type tol,
+00558             OutputIterator result)
+00559         {
+00560             diff_type coordCount = std::distance (first, last);
+00561             diff_type pointCount = DIM      // protect against zero DIM
+00562                                    ? coordCount / DIM
+00563                                    : 0;
+00564             value_type tol2 = tol * tol;    // squared distance tolerance
+00565 
+00566             // validate input and check if simplification required
+00567             if (coordCount % DIM || pointCount < 3 || tol2 == 0) {
+00568                 return std::copy (first, last, result);
+00569             }
+00570 
+00571             InputIterator current = first;  // indicates the current key
+00572             InputIterator next = first;     // used to find the next key
+00573 
+00574             // the first point is always part of the simplification
+00575             CopyKeyAdvance (next, result);
+00576 
+00577             // Skip first and last point, because they are always part of the simplification
+00578             for (diff_type index = 1; index < pointCount - 1; ++index) {
+00579                 if (math::point_distance2 <DIM> (current, next) < tol2) {
+00580                     Advance (next);
+00581                     continue;
+00582                 }
+00583                 current = next;
+00584                 CopyKeyAdvance (next, result);
+00585             }
+00586             // the last point is always part of the simplification
+00587             CopyKeyAdvance (next, result);
+00588 
+00589             return result;
+00590         }
+00591 
+00608         OutputIterator PerpendicularDistance (
+00609             InputIterator first,
+00610             InputIterator last,
+00611             value_type tol,
+00612             unsigned repeat,
+00613             OutputIterator result)
+00614         {
+00615             if (repeat == 1) {
+00616                 // single pass
+00617                 return PerpendicularDistance (first, last, tol, result);
+00618             }
+00619             // only validate repeat; other input is validated by simplify_perpendicular_distance
+00620             if (repeat < 1) {
+00621                 return std::copy (first, last, result);
+00622             }
+00623             diff_type coordCount = std::distance (first, last);
+00624 
+00625             // first pass: [first, last) --> temporary array 'tempPoly'
+00626             util::scoped_array <value_type> tempPoly (coordCount);
+00627             PolylineSimplification <DIM, InputIterator, value_type*> psimpl_to_array;
+00628             diff_type tempCoordCount = std::distance (tempPoly.get (),
+00629                 psimpl_to_array.PerpendicularDistance (first, last, tol, tempPoly.get ()));
+00630 
+00631             // check if simplification did not improved
+00632             if (coordCount == tempCoordCount) {
+00633                 return std::copy (tempPoly.get (), tempPoly.get () + coordCount, result);
+00634             }
+00635             std::swap (coordCount, tempCoordCount);
+00636             --repeat;
+00637 
+00638             // intermediate passes: temporary array 'tempPoly' --> temporary array 'tempResult'
+00639             if (1 < repeat) {
+00640                 util::scoped_array <value_type> tempResult (coordCount);
+00641                 PolylineSimplification <DIM, value_type*, value_type*> psimpl_arrays;
+00642 
+00643                 while (--repeat) {
+00644                     tempCoordCount = std::distance (tempResult.get (),
+00645                         psimpl_arrays.PerpendicularDistance (
+00646                             tempPoly.get (), tempPoly.get () + coordCount, tol, tempResult.get ()));
+00647 
+00648                     // check if simplification did not improved
+00649                     if (coordCount == tempCoordCount) {
+00650                         return std::copy (tempPoly.get (), tempPoly.get () + coordCount, result);
+00651                     }
+00652                     util::swap (tempPoly, tempResult);
+00653                     std::swap (coordCount, tempCoordCount);
+00654                 }
+00655             }
+00656 
+00657             // final pass: temporary array 'tempPoly' --> result
+00658             PolylineSimplification <DIM, value_type*, OutputIterator> psimpl_from_array;
+00659             return psimpl_from_array.PerpendicularDistance (
+00660                 tempPoly.get (), tempPoly.get () + coordCount, tol, result);
+00661         }
+00662 
+00697         OutputIterator PerpendicularDistance (
+00698             InputIterator first,
+00699             InputIterator last,
+00700             value_type tol,
+00701             OutputIterator result)
+00702         {
+00703             diff_type coordCount = std::distance (first, last);
+00704             diff_type pointCount = DIM      // protect against zero DIM
+00705                                    ? coordCount / DIM
+00706                                    : 0;
+00707             value_type tol2 = tol * tol;    // squared distance tolerance
+00708 
+00709             // validate input and check if simplification required
+00710             if (coordCount % DIM || pointCount < 3 || tol2 == 0) {
+00711                 return std::copy (first, last, result);
+00712             }
+00713 
+00714             InputIterator p0 = first;
+00715             InputIterator p1 = AdvanceCopy(p0);
+00716             InputIterator p2 = AdvanceCopy(p1);
+00717 
+00718             // the first point is always part of the simplification
+00719             CopyKey (p0, result);
+00720 
+00721             while (p2 != last) {
+00722                 // test p1 against line segment S(p0, p2)
+00723                 if (math::segment_distance2 <DIM> (p0, p2, p1) < tol2) {
+00724                     CopyKey (p2, result);
+00725                     // move up by two points
+00726                     p0 = p2;
+00727                     Advance (p1, 2);
+00728                     if (p1 == last) {
+00729                         // protect against advancing p2 beyond last
+00730                         break;
+00731                     }
+00732                     Advance (p2, 2);
+00733                 }
+00734                 else {
+00735                     CopyKey (p1, result);
+00736                     // move up by one point
+00737                     p0 = p1;
+00738                     p1 = p2;
+00739                     Advance (p2);
+00740                 }
+00741             }
+00742             // make sure the last point is part of the simplification
+00743             if (p1 != last) {
+00744                 CopyKey (p1, result);
+00745             }
+00746             return result;
+00747         }
+00748 
+00783         OutputIterator ReumannWitkam (
+00784             InputIterator first,
+00785             InputIterator last,
+00786             value_type tol,
+00787             OutputIterator result)
+00788         {
+00789             diff_type coordCount = std::distance (first, last);
+00790             diff_type pointCount = DIM      // protect against zero DIM
+00791                                    ? coordCount / DIM
+00792                                    : 0;
+00793             value_type tol2 = tol * tol;    // squared distance tolerance
+00794 
+00795             // validate input and check if simplification required
+00796             if (coordCount % DIM || pointCount < 3 || tol2 == 0) {
+00797                 return std::copy (first, last, result);
+00798             }
+00799 
+00800             // define the line L(p0, p1)
+00801             InputIterator p0 = first;               // indicates the current key
+00802             InputIterator p1 = AdvanceCopy (first); // indicates the next point after p0
+00803 
+00804             // keep track of two test points
+00805             InputIterator pi = p1;     // the previous test point
+00806             InputIterator pj = p1;     // the current test point (pi+1)
+00807 
+00808             // the first point is always part of the simplification
+00809             CopyKey (p0, result);
+00810 
+00811             // check each point pj against L(p0, p1)
+00812             for (diff_type j = 2; j < pointCount; ++j) {
+00813                 pi = pj;
+00814                 Advance (pj);
+00815 
+00816                 if (math::line_distance2 <DIM> (p0, p1, pj) < tol2) {
+00817                     continue;
+00818                 }
+00819                 // found the next key at pi
+00820                 CopyKey (pi, result);
+00821                 // define new line L(pi, pj)
+00822                 p0 = pi;
+00823                 p1 = pj;
+00824             }
+00825             // the last point is always part of the simplification
+00826             CopyKey (pj, result);
+00827 
+00828             return result;
+00829         }
+00830 
+00872         OutputIterator Opheim (
+00873             InputIterator first,
+00874             InputIterator last,
+00875             value_type min_tol,
+00876             value_type max_tol,
+00877             OutputIterator result)
+00878         {
+00879             diff_type coordCount = std::distance (first, last);
+00880             diff_type pointCount = DIM                    // protect against zero DIM
+00881                                    ? coordCount / DIM
+00882                                    : 0;
+00883             value_type min_tol2 = min_tol * min_tol;    // squared minimum distance tolerance
+00884             value_type max_tol2 = max_tol * max_tol;    // squared maximum distance tolerance
+00885 
+00886             // validate input and check if simplification required
+00887             if (coordCount % DIM || pointCount < 3 || min_tol2 == 0 || max_tol2 == 0) {
+00888                 return std::copy (first, last, result);
+00889             }
+00890 
+00891             // define the ray R(r0, r1)
+00892             InputIterator r0 = first;  // indicates the current key and start of the ray
+00893             InputIterator r1 = first;  // indicates a point on the ray
+00894             bool rayDefined = false;
+00895 
+00896             // keep track of two test points
+00897             InputIterator pi = r0;     // the previous test point
+00898             InputIterator pj =         // the current test point (pi+1)
+00899                 AdvanceCopy (pi);
+00900 
+00901             // the first point is always part of the simplification
+00902             CopyKey (r0, result);
+00903 
+00904             for (diff_type j = 2; j < pointCount; ++j) {
+00905                 pi = pj;
+00906                 Advance (pj);
+00907 
+00908                 if (!rayDefined) {
+00909                     // discard each point within minimum tolerance
+00910                     if (math::point_distance2 <DIM> (r0, pj) < min_tol2) {
+00911                         continue;
+00912                     }
+00913                     // the last point within minimum tolerance pi defines the ray R(r0, r1)
+00914                     r1 = pi;
+00915                     rayDefined = true;
+00916                 }
+00917 
+00918                 // check each point pj against R(r0, r1)
+00919                 if (math::point_distance2 <DIM> (r0, pj) < max_tol2 &&
+00920                     math::ray_distance2 <DIM> (r0, r1, pj) < min_tol2)
+00921                 {
+00922                     continue;
+00923                 }
+00924                 // found the next key at pi
+00925                 CopyKey (pi, result);
+00926                 // define new ray R(pi, pj)
+00927                 r0 = pi;
+00928                 rayDefined = false;
+00929             }
+00930             // the last point is always part of the simplification
+00931             CopyKey (pj, result);
+00932 
+00933             return result;
+00934         }
+00935 
+00978         OutputIterator Lang (
+00979             InputIterator first,
+00980             InputIterator last,
+00981             value_type tol,
+00982             unsigned look_ahead,
+00983             OutputIterator result)
+00984         {
+00985             diff_type coordCount = std::distance (first, last);
+00986             diff_type pointCount = DIM      // protect against zero DIM
+00987                                    ? coordCount / DIM
+00988                                    : 0;
+00989             value_type tol2 = tol * tol;    // squared minimum distance tolerance
+00990             
+00991             // validate input and check if simplification required
+00992             if (coordCount % DIM || pointCount < 3 || look_ahead < 2 || tol2 == 0) {
+00993                 return std::copy (first, last, result);
+00994             }
+00995 
+00996             InputIterator current = first;          // indicates the current key
+00997             InputIterator next = first;             // used to find the next key
+00998 
+00999             unsigned remaining = pointCount - 1;    // the number of points remaining after current
+01000             unsigned moved = Forward (next, look_ahead, remaining);
+01001 
+01002             // the first point is always part of the simplification
+01003             CopyKey (current, result);
+01004 
+01005             while (moved) {
+01006                 value_type d2 = 0;
+01007                 InputIterator p = AdvanceCopy (current);
+01008 
+01009                 while (p != next) {
+01010                     d2 = std::max (d2, math::segment_distance2 <DIM> (current, next, p));
+01011                     if (tol2 < d2) {
+01012                         break;
+01013                     }
+01014                     Advance (p);
+01015                 }
+01016                 if (d2 < tol2) {
+01017                     current = next;
+01018                     CopyKey (current, result);
+01019                     moved = Forward (next, look_ahead, remaining);
+01020                 }
+01021                 else {
+01022                     Backward (next, remaining);
+01023                 }
+01024             }
+01025             return result;
+01026         }
+01027 
+01070         OutputIterator DouglasPeucker (
+01071             InputIterator first,
+01072             InputIterator last,
+01073             value_type tol,
+01074             OutputIterator result)
+01075         {
+01076             diff_type coordCount = std::distance (first, last);
+01077             diff_type pointCount = DIM      // protect against zero DIM
+01078                                    ? coordCount / DIM
+01079                                    : 0;
+01080             // validate input and check if simplification required
+01081             if (coordCount % DIM || pointCount < 3 || tol == 0) {
+01082                 return std::copy (first, last, result);
+01083             }
+01084             // radial distance routine as preprocessing
+01085             util::scoped_array <value_type> reduced (coordCount);   // radial distance results
+01086             PolylineSimplification <DIM, InputIterator, value_type*> psimpl_to_array;
+01087             ptr_diff_type reducedCoordCount = std::distance (reduced.get (),
+01088                 psimpl_to_array.RadialDistance (first, last, tol, reduced.get ()));
+01089             ptr_diff_type reducedPointCount = reducedCoordCount / DIM;
+01090 
+01091             // douglas-peucker approximation
+01092             util::scoped_array <unsigned char> keys (pointCount);         // douglas-peucker results
+01093             DPHelper::Approximate (reduced.get (), reducedCoordCount, tol, keys.get ());
+01094 
+01095             // copy all keys
+01096             const value_type* current = reduced.get ();
+01097             for (ptr_diff_type p=0; p<reducedPointCount; ++p, current += DIM) {
+01098                 if (keys [p]) {
+01099                     for (unsigned d = 0; d < DIM; ++d) {
+01100                         *result = current [d];
+01101                         ++result;
+01102                     }
+01103                 }
+01104             }
+01105             return result;
+01106         }
+01107 
+01147         OutputIterator DouglasPeuckerN (
+01148             InputIterator first,
+01149             InputIterator last,
+01150             unsigned count,
+01151             OutputIterator result)
+01152         {
+01153             diff_type coordCount = std::distance (first, last);
+01154             diff_type pointCount = DIM      // protect against zero DIM
+01155                                    ? coordCount / DIM
+01156                                    : 0;
+01157             // validate input and check if simplification required
+01158             if (coordCount % DIM || pointCount <= static_cast <diff_type> (count) || count < 2) {
+01159                 return std::copy (first, last, result);
+01160             }
+01161 
+01162             // copy coords
+01163             util::scoped_array <value_type> coords (coordCount);
+01164             for (ptr_diff_type c=0; c<coordCount; ++c) {
+01165                 coords [c] = *first;
+01166                 ++first;
+01167             }
+01168 
+01169             // douglas-peucker approximation
+01170             util::scoped_array <unsigned char> keys (pointCount);
+01171             DPHelper::ApproximateN (coords.get (), coordCount, count, keys.get ());
+01172 
+01173             // copy keys
+01174             const value_type* current = coords.get ();
+01175             for (ptr_diff_type p=0; p<pointCount; ++p, current += DIM) {
+01176                 if (keys [p]) {
+01177                     for (unsigned d = 0; d < DIM; ++d) {
+01178                         *result = current [d];
+01179                         ++result;
+01180                     }
+01181                 }
+01182             }
+01183             return result;
+01184         }
+01185 
+01224         OutputIterator ComputePositionalErrors2 (
+01225             InputIterator original_first,
+01226             InputIterator original_last,
+01227             InputIterator simplified_first,
+01228             InputIterator simplified_last,
+01229             OutputIterator result,
+01230             bool* valid=0)
+01231         {
+01232             diff_type original_coordCount = std::distance (original_first, original_last);
+01233             diff_type original_pointCount = DIM     // protect against zero DIM
+01234                                             ? original_coordCount / DIM
+01235                                             : 0;
+01236 
+01237             diff_type simplified_coordCount = std::distance (simplified_first, simplified_last);
+01238             diff_type simplified_pointCount = DIM   // protect against zero DIM
+01239                                               ? simplified_coordCount / DIM
+01240                                               : 0;
+01241 
+01242             // validate input
+01243             if (original_coordCount % DIM || original_pointCount < 2 ||
+01244                 simplified_coordCount % DIM || simplified_pointCount < 2 ||
+01245                 original_pointCount < simplified_pointCount ||
+01246                 !math::equal <DIM> (original_first, simplified_first))
+01247             {
+01248                 if (valid) {
+01249                     *valid = false;
+01250                 }
+01251                 return result;
+01252             }
+01253 
+01254             // define (simplified) line segment S(simplified_prev, simplified_first)
+01255             InputIterator simplified_prev = simplified_first;
+01256             std::advance (simplified_first, DIM);
+01257 
+01258             // process each simplified line segment
+01259             while (simplified_first != simplified_last) {
+01260                 // process each original point until it equals the end of the line segment
+01261                 while (original_first != original_last &&
+01262                        !math::equal <DIM> (original_first, simplified_first))
+01263                 {
+01264                     *result = math::segment_distance2 <DIM> (simplified_prev, simplified_first,
+01265                                                              original_first);
+01266                     ++result;
+01267                     std::advance (original_first, DIM);
+01268                 }
+01269                 // update line segment S
+01270                 simplified_prev = simplified_first;
+01271                 std::advance (simplified_first, DIM);
+01272             }
+01273             // check if last original point matched
+01274             if (original_first != original_last) {
+01275                 *result = 0;
+01276                 ++result;
+01277             }
+01278 
+01279             if (valid) {
+01280                 *valid = original_first != original_last;
+01281             }
+01282             return result;
+01283         }
+01284 
+01317         math::Statistics ComputePositionalErrorStatistics (
+01318             InputIterator original_first,
+01319             InputIterator original_last,
+01320             InputIterator simplified_first,
+01321             InputIterator simplified_last,
+01322             bool* valid=0)
+01323         {
+01324             diff_type pointCount = std::distance (original_first, original_last) / DIM;
+01325             util::scoped_array <double> errors (pointCount);
+01326             PolylineSimplification <DIM, InputIterator, double*> ps;
+01327 
+01328             diff_type errorCount = 
+01329                 std::distance (
+01330                     errors.get (), 
+01331                     ps.ComputePositionalErrors2 (original_first, original_last,
+01332                                                  simplified_first, simplified_last,
+01333                                                  errors.get (), valid));
+01334 
+01335             std::transform (errors.get (), errors.get () + errorCount,
+01336                             errors.get (),
+01337                             std::ptr_fun <double, double> (std::sqrt));
+01338 
+01339             return math::compute_statistics (errors.get (), errors.get () + errorCount);
+01340         }
+01341 
+01342     private:
+01351         inline void CopyKeyAdvance (
+01352             InputIterator& key,
+01353             OutputIterator& result)
+01354         {
+01355             for (unsigned d = 0; d < DIM; ++d) {
+01356                 *result = *key;
+01357                 ++result;
+01358                 ++key;
+01359             }
+01360         }
+01361 
+01370         inline void CopyKey (
+01371             InputIterator key,
+01372             OutputIterator& result)
+01373         {
+01374             CopyKeyAdvance (key, result);
+01375         }
+01376 
+01385         inline void Advance (
+01386             InputIterator& it,
+01387             diff_type n = 1)
+01388         {
+01389             std::advance (it, n * static_cast <diff_type> (DIM));
+01390         }
+01391         
+01401         inline InputIterator AdvanceCopy (
+01402             InputIterator it,
+01403             diff_type n = 1)
+01404         {
+01405             Advance (it, n);
+01406             return it;
+01407         }
+01408 
+01422         inline unsigned Forward (
+01423             InputIterator& it,
+01424             unsigned n,
+01425             unsigned& remaining)
+01426         {
+01427             n = std::min (n, remaining);
+01428             Advance (it, n);
+01429             remaining -= n;
+01430             return n;
+01431         }
+01432 
+01441         inline void Backward (
+01442             InputIterator& it,
+01443             unsigned& remaining)
+01444         {
+01445             Advance (it, -1);
+01446             ++remaining;
+01447         }
+01448 
+01449     private:
+01457         class DPHelper
+01458         {
+01460             struct SubPoly {
+01461                 SubPoly (ptr_diff_type first=0, ptr_diff_type last=0) :
+01462                     first (first), last (last) {}
+01463 
+01464                 ptr_diff_type first;    
+01465                 ptr_diff_type last;     
+01466             };
+01467 
+01469             struct KeyInfo {
+01470                 KeyInfo (ptr_diff_type index=0, value_type dist2=0) :
+01471                     index (index), dist2 (dist2) {}
+01472 
+01473                 ptr_diff_type index;    
+01474                 value_type dist2;       
+01475             };
+01476 
+01478             struct SubPolyAlt {
+01479                 SubPolyAlt (ptr_diff_type first=0, ptr_diff_type last=0) :
+01480                     first (first), last (last) {}
+01481 
+01482                 ptr_diff_type first;    
+01483                 ptr_diff_type last;     
+01484                 KeyInfo keyInfo;        
+01485 
+01486                 bool operator< (const SubPolyAlt& other) const {
+01487                     return keyInfo.dist2 < other.keyInfo.dist2;
+01488                 }
+01489             };
+01490 
+01491         public:
+01500             static void Approximate (
+01501                 const value_type* coords,
+01502                 ptr_diff_type coordCount,
+01503                 value_type tol,
+01504                 unsigned char* keys)
+01505             {
+01506                 value_type tol2 = tol * tol;    // squared distance tolerance
+01507                 ptr_diff_type pointCount = coordCount / DIM;
+01508                 // zero out keys
+01509                 std::fill_n (keys, pointCount, 0);
+01510                 keys [0] = 1;                   // the first point is always a key
+01511                 keys [pointCount - 1] = 1;      // the last point is always a key
+01512 
+01513                 typedef std::stack <SubPoly> Stack;
+01514                 Stack stack;                    // LIFO job-queue containing sub-polylines
+01515 
+01516                 SubPoly subPoly (0, coordCount-DIM);
+01517                 stack.push (subPoly);           // add complete poly
+01518 
+01519                 while (!stack.empty ()) {
+01520                     subPoly = stack.top ();     // take a sub poly
+01521                     stack.pop ();               // and find its key
+01522                     KeyInfo keyInfo = FindKey (coords, subPoly.first, subPoly.last);
+01523                     if (keyInfo.index && tol2 < keyInfo.dist2) {
+01524                         // store the key if valid
+01525                         keys [keyInfo.index / DIM] = 1;
+01526                         // split the polyline at the key and recurse
+01527                         stack.push (SubPoly (keyInfo.index, subPoly.last));
+01528                         stack.push (SubPoly (subPoly.first, keyInfo.index));
+01529                     }
+01530                 }
+01531             }
+01532 
+01541             static void ApproximateN (
+01542                 const value_type* coords,
+01543                 ptr_diff_type coordCount,
+01544                 unsigned countTol,
+01545                 unsigned char* keys)
+01546             {
+01547                 ptr_diff_type pointCount = coordCount / DIM;
+01548                 // zero out keys
+01549                 std::fill_n (keys, pointCount, 0);
+01550                 keys [0] = 1;                   // the first point is always a key
+01551                 keys [pointCount - 1] = 1;      // the last point is always a key
+01552                 unsigned keyCount = 2;
+01553 
+01554                 if (countTol == 2) {
+01555                     return;
+01556                 }
+01557 
+01558                 typedef std::priority_queue <SubPolyAlt> PriorityQueue;
+01559                 PriorityQueue queue;    // sorted (max dist2) job queue containing sub-polylines
+01560 
+01561                 SubPolyAlt subPoly (0, coordCount-DIM);
+01562                 subPoly.keyInfo = FindKey (coords, subPoly.first, subPoly.last);
+01563                 queue.push (subPoly);           // add complete poly
+01564 
+01565                 while (!queue.empty ()) {
+01566                     subPoly = queue.top ();     // take a sub poly
+01567                     queue.pop ();
+01568                     // store the key
+01569                     keys [subPoly.keyInfo.index / DIM] = 1;
+01570                     // check point count tolerance
+01571                     keyCount++;
+01572                     if (keyCount == countTol) {
+01573                         break;
+01574                     }
+01575                     // split the polyline at the key and recurse
+01576                     SubPolyAlt left (subPoly.first, subPoly.keyInfo.index);
+01577                     left.keyInfo = FindKey (coords, left.first, left.last);
+01578                     if (left.keyInfo.index) {
+01579                         queue.push (left);
+01580                     }
+01581                     SubPolyAlt right (subPoly.keyInfo.index, subPoly.last);
+01582                     right.keyInfo = FindKey (coords, right.first, right.last);
+01583                     if (right.keyInfo.index) {
+01584                         queue.push (right);
+01585                     }
+01586                 }
+01587             }
+01588 
+01589         private:
+01602             static KeyInfo FindKey (
+01603                 const value_type* coords,
+01604                 ptr_diff_type first,
+01605                 ptr_diff_type last)
+01606             {
+01607                 KeyInfo keyInfo;
+01608 
+01609                 for (ptr_diff_type current = first + DIM; current < last; current += DIM) {
+01610                     value_type d2 = math::segment_distance2 <DIM> (coords + first, coords + last,
+01611                                                                    coords + current);
+01612                     if (d2 < keyInfo.dist2) {
+01613                         continue;
+01614                     }
+01615                     // update maximum squared distance and the point it belongs to
+01616                     keyInfo.index = current;
+01617                     keyInfo.dist2 = d2;
+01618                 }
+01619                 return keyInfo;
+01620             }
+01621         };
+01622     };
+01623 
+01636     template <unsigned DIM, class ForwardIterator, class OutputIterator>
+01637     OutputIterator simplify_nth_point (
+01638         ForwardIterator first,
+01639         ForwardIterator last,
+01640         unsigned n,
+01641         OutputIterator result)
+01642     {
+01643         PolylineSimplification <DIM, ForwardIterator, OutputIterator> ps;
+01644         return ps.NthPoint (first, last, n, result);
+01645     }
+01646 
+01659     template <unsigned DIM, class ForwardIterator, class OutputIterator>
+01660     OutputIterator simplify_radial_distance (
+01661         ForwardIterator first,
+01662         ForwardIterator last,
+01663         typename std::iterator_traits <ForwardIterator>::value_type tol,
+01664         OutputIterator result)
+01665     {
+01666         PolylineSimplification <DIM, ForwardIterator, OutputIterator> ps;
+01667         return ps.RadialDistance (first, last, tol, result);
+01668     }
+01669 
+01683     template <unsigned DIM, class ForwardIterator, class OutputIterator>
+01684     OutputIterator simplify_perpendicular_distance (
+01685         ForwardIterator first,
+01686         ForwardIterator last,
+01687         typename std::iterator_traits <ForwardIterator>::value_type tol,
+01688         unsigned repeat,
+01689         OutputIterator result)
+01690     {
+01691         PolylineSimplification <DIM, ForwardIterator, OutputIterator> ps;
+01692         return ps.PerpendicularDistance (first, last, tol, repeat, result);
+01693     }
+01694 
+01707     template <unsigned DIM, class ForwardIterator, class OutputIterator>
+01708     OutputIterator simplify_perpendicular_distance (
+01709         ForwardIterator first,
+01710         ForwardIterator last,
+01711         typename std::iterator_traits <ForwardIterator>::value_type tol,
+01712         OutputIterator result)
+01713     {
+01714         PolylineSimplification <DIM, ForwardIterator, OutputIterator> ps;
+01715         return ps.PerpendicularDistance (first, last, tol, result);
+01716     }
+01717 
+01730     template <unsigned DIM, class ForwardIterator, class OutputIterator>
+01731     OutputIterator simplify_reumann_witkam (
+01732         ForwardIterator first,
+01733         ForwardIterator last,
+01734         typename std::iterator_traits <ForwardIterator>::value_type tol,
+01735         OutputIterator result)
+01736     {
+01737         PolylineSimplification <DIM, ForwardIterator, OutputIterator> ps;
+01738         return ps.ReumannWitkam (first, last, tol, result);
+01739     }
+01740 
+01754     template <unsigned DIM, class ForwardIterator, class OutputIterator>
+01755     OutputIterator simplify_opheim (
+01756         ForwardIterator first,
+01757         ForwardIterator last,
+01758         typename std::iterator_traits <ForwardIterator>::value_type min_tol,
+01759         typename std::iterator_traits <ForwardIterator>::value_type max_tol,
+01760         OutputIterator result)
+01761     {
+01762         PolylineSimplification <DIM, ForwardIterator, OutputIterator> ps;
+01763         return ps.Opheim (first, last, min_tol, max_tol, result);
+01764     }
+01765 
+01779     template <unsigned DIM, class BidirectionalIterator, class OutputIterator>
+01780     OutputIterator simplify_lang (
+01781         BidirectionalIterator first,
+01782         BidirectionalIterator last,
+01783         typename std::iterator_traits <BidirectionalIterator>::value_type tol,
+01784         unsigned look_ahead,
+01785         OutputIterator result)
+01786     {
+01787         PolylineSimplification <DIM, BidirectionalIterator, OutputIterator> ps;
+01788         return ps.Lang (first, last, tol, look_ahead, result);
+01789     }
+01790 
+01803     template <unsigned DIM, class ForwardIterator, class OutputIterator>
+01804     OutputIterator simplify_douglas_peucker (
+01805         ForwardIterator first,
+01806         ForwardIterator last,
+01807         typename std::iterator_traits <ForwardIterator>::value_type tol,
+01808         OutputIterator result)
+01809     {
+01810         PolylineSimplification <DIM, ForwardIterator, OutputIterator> ps;
+01811         return ps.DouglasPeucker (first, last, tol, result);
+01812     }
+01813 
+01826     template <unsigned DIM, class ForwardIterator, class OutputIterator>
+01827     OutputIterator simplify_douglas_peucker_n (
+01828         ForwardIterator first,
+01829         ForwardIterator last,
+01830         unsigned count,
+01831         OutputIterator result)
+01832     {
+01833         PolylineSimplification <DIM, ForwardIterator, OutputIterator> ps;
+01834         return ps.DouglasPeuckerN (first, last, count, result);
+01835     }
+01836 
+01851     template <unsigned DIM, class ForwardIterator, class OutputIterator>
+01852     OutputIterator compute_positional_errors2 (
+01853         ForwardIterator original_first,
+01854         ForwardIterator original_last,
+01855         ForwardIterator simplified_first,
+01856         ForwardIterator simplified_last,
+01857         OutputIterator result,
+01858         bool* valid=0)
+01859     {
+01860         PolylineSimplification <DIM, ForwardIterator, OutputIterator> ps;
+01861         return ps.ComputePositionalErrors2 (original_first, original_last, simplified_first, simplified_last, result, valid);
+01862     }
+01863 
+01877     template <unsigned DIM, class ForwardIterator>
+01878     math::Statistics compute_positional_error_statistics (
+01879         ForwardIterator original_first,
+01880         ForwardIterator original_last,
+01881         ForwardIterator simplified_first,
+01882         ForwardIterator simplified_last,
+01883         bool* valid=0)
+01884     {
+01885         PolylineSimplification <DIM, ForwardIterator, ForwardIterator> ps;
+01886         return ps.ComputePositionalErrorStatistics (original_first, original_last, simplified_first, simplified_last, valid);
+01887     }
+01888 }
+01889 
+01890 #endif // PSIMPL_GENERIC
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/psimpl_dp.png b/lib/psimpl_v7_src/doc/psimpl_dp.png new file mode 100644 index 0000000..8bb0e7d Binary files /dev/null and b/lib/psimpl_v7_src/doc/psimpl_dp.png differ diff --git a/lib/psimpl_v7_src/doc/psimpl_la.png b/lib/psimpl_v7_src/doc/psimpl_la.png new file mode 100644 index 0000000..19498e8 Binary files /dev/null and b/lib/psimpl_v7_src/doc/psimpl_la.png differ diff --git a/lib/psimpl_v7_src/doc/psimpl_np.png b/lib/psimpl_v7_src/doc/psimpl_np.png new file mode 100644 index 0000000..5ed1767 Binary files /dev/null and b/lib/psimpl_v7_src/doc/psimpl_np.png differ diff --git a/lib/psimpl_v7_src/doc/psimpl_op.png b/lib/psimpl_v7_src/doc/psimpl_op.png new file mode 100644 index 0000000..5884b34 Binary files /dev/null and b/lib/psimpl_v7_src/doc/psimpl_op.png differ diff --git a/lib/psimpl_v7_src/doc/psimpl_pd.png b/lib/psimpl_v7_src/doc/psimpl_pd.png new file mode 100644 index 0000000..f7dc1af Binary files /dev/null and b/lib/psimpl_v7_src/doc/psimpl_pd.png differ diff --git a/lib/psimpl_v7_src/doc/psimpl_pos_error.png b/lib/psimpl_v7_src/doc/psimpl_pos_error.png new file mode 100644 index 0000000..5a19723 Binary files /dev/null and b/lib/psimpl_v7_src/doc/psimpl_pos_error.png differ diff --git a/lib/psimpl_v7_src/doc/psimpl_rd.png b/lib/psimpl_v7_src/doc/psimpl_rd.png new file mode 100644 index 0000000..0ce59d8 Binary files /dev/null and b/lib/psimpl_v7_src/doc/psimpl_rd.png differ diff --git a/lib/psimpl_v7_src/doc/psimpl_rw.png b/lib/psimpl_v7_src/doc/psimpl_rw.png new file mode 100644 index 0000000..e914dc0 Binary files /dev/null and b/lib/psimpl_v7_src/doc/psimpl_rw.png differ diff --git a/lib/psimpl_v7_src/doc/resize.js b/lib/psimpl_v7_src/doc/resize.js new file mode 100644 index 0000000..04fa95c --- /dev/null +++ b/lib/psimpl_v7_src/doc/resize.js @@ -0,0 +1,81 @@ +var cookie_namespace = 'doxygen'; +var sidenav,navtree,content,header; + +function readCookie(cookie) +{ + var myCookie = cookie_namespace+"_"+cookie+"="; + if (document.cookie) + { + var index = document.cookie.indexOf(myCookie); + if (index != -1) + { + var valStart = index + myCookie.length; + var valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) + { + valEnd = document.cookie.length; + } + var val = document.cookie.substring(valStart, valEnd); + return val; + } + } + return 0; +} + +function writeCookie(cookie, val, expiration) +{ + if (val==undefined) return; + if (expiration == null) + { + var date = new Date(); + date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week + expiration = date.toGMTString(); + } + document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/"; +} + +function resizeWidth() +{ + var windowWidth = $(window).width() + "px"; + var sidenavWidth = $(sidenav).width(); + content.css({marginLeft:parseInt(sidenavWidth)+6+"px"}); //account for 6px-wide handle-bar + writeCookie('width',sidenavWidth, null); +} + +function restoreWidth(navWidth) +{ + var windowWidth = $(window).width() + "px"; + content.css({marginLeft:parseInt(navWidth)+6+"px"}); + sidenav.css({width:navWidth + "px"}); +} + +function resizeHeight() +{ + var headerHeight = header.height(); + var footerHeight = footer.height(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + content.css({height:windowHeight + "px"}); + navtree.css({height:windowHeight + "px"}); + sidenav.css({height:windowHeight + "px",top: headerHeight+"px"}); +} + +function initResizable() +{ + header = $("#top"); + sidenav = $("#side-nav"); + content = $("#doc-content"); + navtree = $("#nav-tree"); + footer = $("#nav-path"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); + $(window).resize(function() { resizeHeight(); }); + var width = readCookie('width'); + if (width) { restoreWidth(width); } else { resizeWidth(); } + resizeHeight(); + var url = location.href; + var i=url.indexOf("#"); + if (i>=0) window.location.hash=url.substr(i); + var _preventDefault = function(evt) { evt.preventDefault(); }; + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); +} + + diff --git a/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_key_info-members.html b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_key_info-members.html new file mode 100644 index 0000000..50a57b8 --- /dev/null +++ b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_key_info-members.html @@ -0,0 +1,80 @@ + + + + +psimpl: Member List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo Member List
+
+ +
+ + + + diff --git a/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_key_info.html b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_key_info.html new file mode 100644 index 0000000..c408fae --- /dev/null +++ b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_key_info.html @@ -0,0 +1,169 @@ + + + + +psimpl: psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo Struct Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo Struct Reference
+
+
+ +

Defines the key of a polyline. + More...

+ +

List of all members.

+ + + + + + + +

+Public Member Functions

 KeyInfo (ptr_diff_type index=0, value_type dist2=0)

+Public Attributes

ptr_diff_type index
value_type dist2
 coord index of the key
+

Detailed Description

+

template<unsigned DIM, class InputIterator, class OutputIterator>
+struct psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo

+ +

Defines the key of a polyline.

+

Constructor & Destructor Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + +
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo::KeyInfo (ptr_diff_type index = 0,
value_type dist2 = 0 
) [inline]
+
+
+ +
+
+

Member Data Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
value_type psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo::dist2
+
+
+ +

coord index of the key

+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
ptr_diff_type psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::KeyInfo::index
+
+
+ +
+
+
The documentation for this struct was generated from the following file:
    +
  • D:/Code/Projects/psimpl/trunk/lib/psimpl.h
  • +
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly-members.html b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly-members.html new file mode 100644 index 0000000..7ef09b1 --- /dev/null +++ b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly-members.html @@ -0,0 +1,80 @@ + + + + +psimpl: Member List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly Member List
+
+ +
+ + + + diff --git a/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly.html b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly.html new file mode 100644 index 0000000..a96e4d3 --- /dev/null +++ b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly.html @@ -0,0 +1,169 @@ + + + + +psimpl: psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly Struct Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly Struct Reference
+
+
+ +

Defines a sub polyline. + More...

+ +

List of all members.

+ + + + + + + +

+Public Member Functions

 SubPoly (ptr_diff_type first=0, ptr_diff_type last=0)

+Public Attributes

ptr_diff_type first
ptr_diff_type last
 coord index of the first point
+

Detailed Description

+

template<unsigned DIM, class InputIterator, class OutputIterator>
+struct psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly

+ +

Defines a sub polyline.

+

Constructor & Destructor Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + +
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly::SubPoly (ptr_diff_type first = 0,
ptr_diff_type last = 0 
) [inline]
+
+
+ +
+
+

Member Data Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
ptr_diff_type psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly::first
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
ptr_diff_type psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPoly::last
+
+
+ +

coord index of the first point

+ +
+
+
The documentation for this struct was generated from the following file:
    +
  • D:/Code/Projects/psimpl/trunk/lib/psimpl.h
  • +
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly_alt-members.html b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly_alt-members.html new file mode 100644 index 0000000..0fb7c0b --- /dev/null +++ b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly_alt-members.html @@ -0,0 +1,82 @@ + + + + +psimpl: Member List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ + + + + + diff --git a/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly_alt.html b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly_alt.html new file mode 100644 index 0000000..edfff6e --- /dev/null +++ b/lib/psimpl_v7_src/doc/structpsimpl_1_1_polyline_simplification_1_1_d_p_helper_1_1_sub_poly_alt.html @@ -0,0 +1,212 @@ + + + + +psimpl: psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt Struct Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt Struct Reference
+
+
+ +

Defines a sub polyline including its key. + More...

+ +

List of all members.

+ + + + + + + + + + + +

+Public Member Functions

 SubPolyAlt (ptr_diff_type first=0, ptr_diff_type last=0)
bool operator< (const SubPolyAlt &other) const
 key of this sub poly

+Public Attributes

ptr_diff_type first
ptr_diff_type last
 coord index of the first point
KeyInfo keyInfo
 coord index of the last point
+

Detailed Description

+

template<unsigned DIM, class InputIterator, class OutputIterator>
+struct psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt

+ +

Defines a sub polyline including its key.

+

Constructor & Destructor Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + + + + + + + + + + + +
psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt::SubPolyAlt (ptr_diff_type first = 0,
ptr_diff_type last = 0 
) [inline]
+
+
+ +
+
+

Member Function Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + + + + + +
bool psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt::operator< (const SubPolyAltother) const [inline]
+
+
+ +

key of this sub poly

+ +
+
+

Member Data Documentation

+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
ptr_diff_type psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt::first
+
+
+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
KeyInfo psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt::keyInfo
+
+
+ +

coord index of the last point

+ +
+
+ +
+
+
+template<unsigned DIM, class InputIterator, class OutputIterator>
+ + + + +
ptr_diff_type psimpl::PolylineSimplification< DIM, InputIterator, OutputIterator >::DPHelper::SubPolyAlt::last
+
+
+ +

coord index of the first point

+ +
+
+
The documentation for this struct was generated from the following file:
    +
  • D:/Code/Projects/psimpl/trunk/lib/psimpl.h
  • +
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/structpsimpl_1_1math_1_1_statistics-members.html b/lib/psimpl_v7_src/doc/structpsimpl_1_1math_1_1_statistics-members.html new file mode 100644 index 0000000..bb4d208 --- /dev/null +++ b/lib/psimpl_v7_src/doc/structpsimpl_1_1math_1_1_statistics-members.html @@ -0,0 +1,82 @@ + + + + +psimpl: Member List + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+
+
psimpl::math::Statistics Member List
+
+ +
+ + + + diff --git a/lib/psimpl_v7_src/doc/structpsimpl_1_1math_1_1_statistics.html b/lib/psimpl_v7_src/doc/structpsimpl_1_1math_1_1_statistics.html new file mode 100644 index 0000000..3fe0be0 --- /dev/null +++ b/lib/psimpl_v7_src/doc/structpsimpl_1_1math_1_1_statistics.html @@ -0,0 +1,175 @@ + + + + +psimpl: psimpl::math::Statistics Struct Reference + + + + + + + + + + +
+
+ + + + + + +
+
psimpl 7
+
+
+ + +
+
+ +
+
+
+ +
+
+ +
+
psimpl::math::Statistics Struct Reference
+
+
+ +

POD structure for storing several statistical values. + More...

+ +

#include <psimpl.h>

+ +

List of all members.

+ + + + + + + + +

+Public Member Functions

 Statistics ()

+Public Attributes

double max
double sum
double mean
double std
+

Detailed Description

+

POD structure for storing several statistical values.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + +
psimpl::math::Statistics::Statistics () [inline]
+
+
+ +
+
+

Member Data Documentation

+ +
+
+ + + + +
double psimpl::math::Statistics::max
+
+
+ +
+
+ +
+
+ + + + +
double psimpl::math::Statistics::mean
+
+
+ +
+
+ +
+
+ + + + +
double psimpl::math::Statistics::std
+
+
+ +
+
+ +
+
+ + + + +
double psimpl::math::Statistics::sum
+
+
+ +
+
+
The documentation for this struct was generated from the following file:
    +
  • D:/Code/Projects/psimpl/trunk/lib/psimpl.h
  • +
+
+
+ + + + diff --git a/lib/psimpl_v7_src/doc/tab_a.png b/lib/psimpl_v7_src/doc/tab_a.png new file mode 100644 index 0000000..2d99ef2 Binary files /dev/null and b/lib/psimpl_v7_src/doc/tab_a.png differ diff --git a/lib/psimpl_v7_src/doc/tab_b.png b/lib/psimpl_v7_src/doc/tab_b.png new file mode 100644 index 0000000..b2c3d2b Binary files /dev/null and b/lib/psimpl_v7_src/doc/tab_b.png differ diff --git a/lib/psimpl_v7_src/doc/tab_h.png b/lib/psimpl_v7_src/doc/tab_h.png new file mode 100644 index 0000000..c11f48f Binary files /dev/null and b/lib/psimpl_v7_src/doc/tab_h.png differ diff --git a/lib/psimpl_v7_src/doc/tab_s.png b/lib/psimpl_v7_src/doc/tab_s.png new file mode 100644 index 0000000..978943a Binary files /dev/null and b/lib/psimpl_v7_src/doc/tab_s.png differ diff --git a/lib/psimpl_v7_src/doc/tabs.css b/lib/psimpl_v7_src/doc/tabs.css new file mode 100644 index 0000000..2192056 --- /dev/null +++ b/lib/psimpl_v7_src/doc/tabs.css @@ -0,0 +1,59 @@ +.tabs, .tabs2, .tabs3 { + background-image: url('tab_b.png'); + width: 100%; + z-index: 101; + font-size: 13px; +} + +.tabs2 { + font-size: 10px; +} +.tabs3 { + font-size: 9px; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + float: left; + display: table-cell; + background-image: url('tab_b.png'); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + background-image:url('tab_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #283A5D; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: url('tab_h.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + text-decoration: none; +} + +.tablist li.current a { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} diff --git a/lib/psimpl/psimpl.h b/lib/psimpl_v7_src/psimpl.h similarity index 100% rename from lib/psimpl/psimpl.h rename to lib/psimpl_v7_src/psimpl.h