Author: Carlos Lopez <[email protected]>
Date: Sun Oct 2 20:09:31 2011 +0200
Initial version for a ValueNode_WPList converter from width data
---
synfig-studio/src/synfigapp/Makefile.am | 2 +
synfig-studio/src/synfigapp/wplistconverter.cpp | 66 ++++++++++++++++++++++
synfig-studio/src/synfigapp/wplistconverter.h | 69 +++++++++++++++++++++++
3 files changed, 137 insertions(+), 0 deletions(-)
diff --git a/synfig-studio/src/synfigapp/Makefile.am
b/synfig-studio/src/synfigapp/Makefile.am
index e7bf777..fedc583 100644
--- a/synfig-studio/src/synfigapp/Makefile.am
+++ b/synfig-studio/src/synfigapp/Makefile.am
@@ -246,6 +246,7 @@ SYNFIGAPPHH = \
action_param.h \
action_system.h \
blineconvert.h \
+ wplistconverter.h \
canvasinterface.h \
cvs.h \
inputdevice.h \
@@ -262,6 +263,7 @@ SYNFIGAPPCC = \
action_param.cpp \
action_system.cpp \
blineconvert.cpp \
+ wplistconverter.cpp \
canvasinterface.cpp \
cvs.cpp \
inputdevice.cpp \
diff --git a/synfig-studio/src/synfigapp/wplistconverter.cpp
b/synfig-studio/src/synfigapp/wplistconverter.cpp
new file mode 100644
index 0000000..75eb50c
--- /dev/null
+++ b/synfig-studio/src/synfigapp/wplistconverter.cpp
@@ -0,0 +1,66 @@
+/* === S Y N F I G ========================================================= */
+/*! \file wplistconverter.cpp
+** \brief Implementation for a converter between widths and positions
+** form a extended device and a equivalent ValueNode_WPList
+**
+** $Id$
+**
+** \legal
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2011 Carlos López
+**
+** This package is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public License as
+** published by the Free Software Foundation; either version 2 of
+** the License, or (at your option) any later version.
+**
+** This package is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** General Public License for more details.
+** \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+# include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#endif
+
+#include "wplistconverter.h"
+
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace synfigapp;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+WPListConverter::WPListConverter()
+{
+ err2max=0.01;
+}
+
+void
+WPListConverter::operator()(std::list<synfig::WidthPoint> &wp_out, const
std::list<synfig::Point> &p, const std::list<synfig::Real> &w)
+{
+}
+
+/* === E N T R Y P O I N T ================================================= */
+
+
diff --git a/synfig-studio/src/synfigapp/wplistconverter.h
b/synfig-studio/src/synfigapp/wplistconverter.h
new file mode 100644
index 0000000..9ae3b0b
--- /dev/null
+++ b/synfig-studio/src/synfigapp/wplistconverter.h
@@ -0,0 +1,69 @@
+/* === S Y N F I G ========================================================= */
+/*! \file wplistconverter.h
+** \brief Header for a converter between widths and positions
+** form a extended device and a equivalent ValueNode_WPList
+**
+** $Id$
+**
+** \legal
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2011 Carlos López
+**
+** This package is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public License as
+** published by the Free Software Foundation; either version 2 of
+** the License, or (at your option) any later version.
+**
+** This package is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** General Public License for more details.
+** \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SYNFIG_WPLISTCONVERTER_H
+#define __SYNFIG_WPLISTCONVERTER_H
+
+/* === H E A D E R S ======================================================= */
+
+#include <synfig/general.h>
+#include <synfig/widthpoint.h>
+#include <list>
+#include <vector>
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace synfigapp {
+
+class WPListConverter
+{
+private:
+ //! Cache of points ready to be processed after remove duplicated
+ std::vector<synfig::Point> points;
+ //! Cache of widthd ready to be processed after remove duplicated
+ std::vector<synfig::Real> widths;
+ //! Calculated cummulated distances to origin
+ std::vector<synfig::Real> distances;
+ //! Calculated cummulated distances to origin normalized
+ std::vector<synfig::Real> norm_distances;
+
+ void clear();
+
+public:
+ synfig::Real err2max;
+ WPListConverter();
+ void operator()(std::list<synfig::WidthPoint> &wp_out, const
std::list<synfig::Point> &p, const std::list<synfig::Real> &w);
+};
+
+}; // END of namespace synfigapp
+
+/* === E N D =============================================================== */
+
+#endif
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl