summaryrefslogtreecommitdiffstats
path: root/src/extension
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2015-07-04 16:15:46 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2015-07-04 16:15:46 +0000
commit1112ab0a12fc0cb5a6b00d1bbd5b100c55eedff8 (patch)
treea91517f9165322b4e42c6cdeb4263beaedc4d02f /src/extension
parentPackaging. New Win32 installer Danish translation. (diff)
parentUpgrade to 2Geom r2413 (diff)
downloadinkscape-1112ab0a12fc0cb5a6b00d1bbd5b100c55eedff8.tar.gz
inkscape-1112ab0a12fc0cb5a6b00d1bbd5b100c55eedff8.zip
Sync 2Geom to revision 2413.
May introduce regressions. (bzr r14226)
Diffstat (limited to 'src/extension')
-rw-r--r--src/extension/implementation/implementation.h9
-rw-r--r--src/extension/internal/emf-print.cpp20
-rw-r--r--src/extension/internal/javafx-out.cpp9
-rw-r--r--src/extension/internal/latex-pstricks.cpp5
-rw-r--r--src/extension/internal/metafile-print.cpp8
-rw-r--r--src/extension/internal/odf.cpp5
-rw-r--r--src/extension/internal/pov-out.cpp5
-rw-r--r--src/extension/internal/wmf-print.cpp19
8 files changed, 33 insertions, 47 deletions
diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h
index fb323cd78..f6f933aaf 100644
--- a/src/extension/implementation/implementation.h
+++ b/src/extension/implementation/implementation.h
@@ -15,14 +15,7 @@
#include <vector>
#include <sigc++/signal.h>
#include <glibmm/value.h>
-
-namespace Geom {
- class Affine;
- class OptRect;
- class Path;
- typedef std::vector<Path> PathVector;
- class Point;
-}
+#include <2geom/forward.h>
namespace Gtk {
class Widget;
diff --git a/src/extension/internal/emf-print.cpp b/src/extension/internal/emf-print.cpp
index 40d0955e3..5b8aae655 100644
--- a/src/extension/internal/emf-print.cpp
+++ b/src/extension/internal/emf-print.cpp
@@ -860,7 +860,7 @@ Geom::Path PrintEmf::pathv_to_rect(Geom::PathVector const &pathv, bool *is_rect,
/* Get the ends of the LAST line segment.
Find minimum rotation to align rectangle with X,Y axes. (Very degenerate if it is rotated 45 degrees.) */
*angle = 10.0; /* must be > than the actual angle in radians. */
- for(Geom::Path::const_iterator cit = pR.begin(); cit != pR.end_open(); ++cit){
+ for(Geom::Path::iterator cit = pR.begin(); cit != pR.end_open(); ++cit){
P1_trail = cit->initialPoint();
P1 = cit->finalPoint();
v1 = unit_vector(P1 - P1_trail);
@@ -874,7 +874,7 @@ Geom::Path PrintEmf::pathv_to_rect(Geom::PathVector const &pathv, bool *is_rect,
double convert = 36000.0/ (2.0 * M_PI);
*angle = round(*angle * convert)/convert;
- for(Geom::Path::const_iterator cit = pR.begin(); cit != pR.end_open();++cit) {
+ for(Geom::Path::iterator cit = pR.begin(); cit != pR.end_open();++cit) {
P1_lead = cit->finalPoint();
v1 = unit_vector(P1 - P1_trail);
v2 = unit_vector(P1_lead - P1 );
@@ -924,7 +924,7 @@ int PrintEmf::vector_rect_alignment(double angle, Geom::Point vtest){
*/
Geom::Point PrintEmf::get_pathrect_corner(Geom::Path pathRect, double angle, int corner){
Geom::Point center(0,0);
- for(Geom::Path::const_iterator cit = pathRect.begin(); cit != pathRect.end_open(); ++cit) {
+ for(Geom::Path::iterator cit = pathRect.begin(); cit != pathRect.end_open(); ++cit) {
center += cit->initialPoint()/4.0;
}
@@ -952,7 +952,7 @@ Geom::Point PrintEmf::get_pathrect_corner(Geom::Path pathRect, double angle, int
Geom::Point v1 = Geom::Point(1,0) * Geom::Rotate(-angle); // unit horizontal side (sign change because Y increases DOWN)
Geom::Point v2 = Geom::Point(0,1) * Geom::Rotate(-angle); // unit vertical side (sign change because Y increases DOWN)
Geom::Point P1;
- for(Geom::Path::const_iterator cit = pathRect.begin(); cit != pathRect.end_open(); ++cit) {
+ for(Geom::Path::iterator cit = pathRect.begin(); cit != pathRect.end_open(); ++cit) {
P1 = cit->initialPoint();
if ( ( LR == (dot(P1 - center,v1) > 0 ? 0 : 1) )
@@ -1494,11 +1494,11 @@ bool PrintEmf::print_simple_shape(Geom::PathVector const &pathv, const Geom::Aff
int curves = 0;
char *rec = NULL;
- for (Geom::PathVector::const_iterator pit = pv.begin(); pit != pv.end(); ++pit) {
+ for (Geom::PathVector::iterator pit = pv.begin(); pit != pv.end(); ++pit) {
moves++;
nodes++;
- for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_open(); ++cit) {
+ for (Geom::Path::iterator cit = pit->begin(); cit != pit->end_open(); ++cit) {
nodes++;
if (is_straight_curve(*cit)) {
@@ -1519,7 +1519,7 @@ bool PrintEmf::print_simple_shape(Geom::PathVector const &pathv, const Geom::Aff
/**
* For all Subpaths in the <path>
*/
- for (Geom::PathVector::const_iterator pit = pv.begin(); pit != pv.end(); ++pit) {
+ for (Geom::PathVector::iterator pit = pv.begin(); pit != pv.end(); ++pit) {
using Geom::X;
using Geom::Y;
@@ -1538,7 +1538,7 @@ bool PrintEmf::print_simple_shape(Geom::PathVector const &pathv, const Geom::Aff
/**
* For all segments in the subpath
*/
- for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_open(); ++cit) {
+ for (Geom::Path::iterator cit = pit->begin(); cit != pit->end_open(); ++cit) {
if (is_straight_curve(*cit)) {
//Geom::Point p0 = cit->initialPoint();
Geom::Point p1 = cit->finalPoint();
@@ -1557,7 +1557,7 @@ bool PrintEmf::print_simple_shape(Geom::PathVector const &pathv, const Geom::Aff
lpPoints[i].y = y1;
i = i + 1;
} else if (Geom::CubicBezier const *cubic = dynamic_cast<Geom::CubicBezier const *>(&*cit)) {
- std::vector<Geom::Point> points = cubic->points();
+ std::vector<Geom::Point> points = cubic->controlPoints();
//Geom::Point p0 = points[0];
Geom::Point p1 = points[1];
Geom::Point p2 = points[2];
@@ -1846,7 +1846,7 @@ unsigned int PrintEmf::draw_pathv_to_EMF(Geom::PathVector const &pathv, const Ge
g_error("Fatal programming error in PrintEmf::print_pathv at U_EMRLINETO_set");
}
} else if (Geom::CubicBezier const *cubic = dynamic_cast<Geom::CubicBezier const *>(&*cit)) {
- std::vector<Geom::Point> points = cubic->points();
+ std::vector<Geom::Point> points = cubic->controlPoints();
//Geom::Point p0 = points[0];
Geom::Point p1 = points[1];
Geom::Point p2 = points[2];
diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp
index 19946022c..386bde1d6 100644
--- a/src/extension/internal/javafx-out.cpp
+++ b/src/extension/internal/javafx-out.cpp
@@ -35,8 +35,7 @@
#include <extension/system.h>
#include <2geom/pathvector.h>
#include <2geom/rect.h>
-#include <2geom/bezier-curve.h>
-#include <2geom/hvlinesegment.h>
+#include <2geom/curves.h>
#include "helper/geom.h"
#include "helper/geom-curves.h"
#include <io/sys.h>
@@ -531,9 +530,7 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id)
for (Geom::Path::const_iterator cit = pit->begin(); cit != pit->end_closed(); ++cit)
{
//### LINE
- if ( dynamic_cast<Geom::LineSegment const *> (&*cit) ||
- dynamic_cast<Geom::HLineSegment const *> (&*cit) ||
- dynamic_cast<Geom::VLineSegment const *> (&*cit) )
+ if ( dynamic_cast<Geom::LineSegment const *> (&*cit) )
{
Geom::Point p = cit->finalPoint();
out(" LineTo {\n");
@@ -545,7 +542,7 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id)
//### BEZIER
else if (Geom::CubicBezier const *cubic = dynamic_cast<Geom::CubicBezier const*>(&*cit))
{
- std::vector<Geom::Point> points = cubic->points();
+ std::vector<Geom::Point> points = cubic->controlPoints();
Geom::Point p1 = points[1];
Geom::Point p2 = points[2];
Geom::Point p3 = points[3];
diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp
index 6aaa1bca4..ae8f30a5c 100644
--- a/src/extension/internal/latex-pstricks.cpp
+++ b/src/extension/internal/latex-pstricks.cpp
@@ -17,8 +17,7 @@
#include <2geom/pathvector.h>
#include <2geom/sbasis-to-bezier.h>
-#include <2geom/bezier-curve.h>
-#include <2geom/hvlinesegment.h>
+#include <2geom/curves.h>
#include <errno.h>
#include <signal.h>
#include "util/units.h"
@@ -300,7 +299,7 @@ PrintLatex::print_2geomcurve(SVGOStringStream &os, Geom::Curve const &c)
os << "\\lineto(" << c.finalPoint()[X] << "," << c.finalPoint()[Y] << ")\n";
}
else if(Geom::CubicBezier const *cubic_bezier = dynamic_cast<Geom::CubicBezier const*>(&c)) {
- std::vector<Geom::Point> points = cubic_bezier->points();
+ std::vector<Geom::Point> points = cubic_bezier->controlPoints();
os << "\\curveto(" << points[1][X] << "," << points[1][Y] << ")("
<< points[2][X] << "," << points[2][Y] << ")("
<< points[3][X] << "," << points[3][Y] << ")\n";
diff --git a/src/extension/internal/metafile-print.cpp b/src/extension/internal/metafile-print.cpp
index 73d63f27d..2fb36be85 100644
--- a/src/extension/internal/metafile-print.cpp
+++ b/src/extension/internal/metafile-print.cpp
@@ -389,7 +389,7 @@ Geom::PathVector PrintMetafile::center_ellipse_as_SVG_PathV(Geom::Point ctr, dou
char text[256];
sprintf(text, " M %f,%f A %f %f %f 0 0 %f %f A %f %f %f 0 0 %f %f z", x1, y1, rx, ry, F * 360. / (2.*M_PI), x2, y2, rx, ry, F * 360. / (2.*M_PI), x1, y1);
- std::vector<Geom::Path> outres = Geom::parse_svg_path(text);
+ Geom::PathVector outres = Geom::parse_svg_path(text);
return outres;
}
@@ -419,7 +419,7 @@ Geom::PathVector PrintMetafile::center_elliptical_ring_as_SVG_PathV(Geom::Point
sprintf(text, " M %f,%f A %f %f %f 0 1 %f %f A %f %f %f 0 1 %f %f z M %f,%f A %f %f %f 0 0 %f %f A %f %f %f 0 0 %f %f z",
x11, y11, rx1, ry1, degrot, x12, y12, rx1, ry1, degrot, x11, y11,
x21, y21, rx2, ry2, degrot, x22, y22, rx2, ry2, degrot, x21, y21);
- std::vector<Geom::Path> outres = Geom::parse_svg_path(text);
+ Geom::PathVector outres = Geom::parse_svg_path(text);
return outres;
}
@@ -440,7 +440,7 @@ Geom::PathVector PrintMetafile::center_elliptical_hole_as_SVG_PathV(Geom::Point
char text[256];
sprintf(text, " M %f,%f A %f %f %f 0 0 %f %f A %f %f %f 0 0 %f %f z M 50000,50000 50000,-50000 -50000,-50000 -50000,50000 z",
x1, y1, rx, ry, F * 360. / (2.*M_PI), x2, y2, rx, ry, F * 360. / (2.*M_PI), x1, y1);
- std::vector<Geom::Path> outres = Geom::parse_svg_path(text);
+ Geom::PathVector outres = Geom::parse_svg_path(text);
return outres;
}
@@ -452,7 +452,7 @@ width vector to side edge
*/
Geom::PathVector PrintMetafile::rect_cutter(Geom::Point ctr, Geom::Point pos, Geom::Point neg, Geom::Point width)
{
- std::vector<Geom::Path> outres;
+ Geom::PathVector outres;
Geom::Path cutter;
cutter.start(ctr + pos - width);
cutter.appendNew<Geom::LineSegment>(ctr + pos + width);
diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp
index 52fabcf3c..6904eb2fd 100644
--- a/src/extension/internal/odf.cpp
+++ b/src/extension/internal/odf.cpp
@@ -55,8 +55,7 @@
#include <style.h>
#include "display/curve.h"
#include <2geom/pathvector.h>
-#include <2geom/bezier-curve.h>
-#include <2geom/hvlinesegment.h>
+#include <2geom/curves.h>
#include <2geom/transforms.h>
#include <helper/geom.h>
#include "helper/geom-curves.h"
@@ -1299,7 +1298,7 @@ writePath(Writer &outs, Geom::PathVector const &pathv,
outs.printf("L %.3f %.3f ", destx, desty);
}
else if(Geom::CubicBezier const *cubic = dynamic_cast<Geom::CubicBezier const*>(&*cit)) {
- std::vector<Geom::Point> points = cubic->points();
+ std::vector<Geom::Point> points = cubic->controlPoints();
for (unsigned i = 1; i <= 3; i++) {
if (fabs(points[i][X])<1.0) points[i][X] = 0.0; // Why is this needed? Shouldn't we just round all numbers then?
if (fabs(points[i][Y])<1.0) points[i][Y] = 0.0;
diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp
index 3d149928f..bd2168b68 100644
--- a/src/extension/internal/pov-out.cpp
+++ b/src/extension/internal/pov-out.cpp
@@ -30,8 +30,7 @@
#include <extension/system.h>
#include <2geom/pathvector.h>
#include <2geom/rect.h>
-#include <2geom/bezier-curve.h>
-#include <2geom/hvlinesegment.h>
+#include <2geom/curves.h>
#include "helper/geom.h"
#include "helper/geom-curves.h"
#include <io/sys.h>
@@ -388,7 +387,7 @@ bool PovOutput::doCurve(SPItem *item, const String &id)
}
else if(Geom::CubicBezier const *cubic = dynamic_cast<Geom::CubicBezier const*>(&*cit))
{
- std::vector<Geom::Point> points = cubic->points();
+ std::vector<Geom::Point> points = cubic->controlPoints();
Geom::Point p0 = points[0];
Geom::Point p1 = points[1];
Geom::Point p2 = points[2];
diff --git a/src/extension/internal/wmf-print.cpp b/src/extension/internal/wmf-print.cpp
index 768909173..431053085 100644
--- a/src/extension/internal/wmf-print.cpp
+++ b/src/extension/internal/wmf-print.cpp
@@ -29,14 +29,13 @@
#endif
-#include "2geom/sbasis-to-bezier.h"
-#include "2geom/svg-elliptical-arc.h"
-
-#include "2geom/path.h"
-#include "2geom/pathvector.h"
-#include "2geom/rect.h"
-#include "2geom/bezier-curve.h"
-#include "2geom/hvlinesegment.h"
+#include <2geom/sbasis-to-bezier.h>
+#include <2geom/elliptical-arc.h>
+
+#include <2geom/path.h>
+#include <2geom/pathvector.h>
+#include <2geom/rect.h>
+#include <2geom/curves.h>
#include "helper/geom.h"
#include "helper/geom-curves.h"
#include "sp-item.h"
@@ -59,7 +58,7 @@
#include "display/cairo-utils.h"
#include "splivarot.h" // pieces for union on shapes
-#include "2geom/svg-path-parser.h" // to get from SVG text to Geom::Path
+#include <2geom/svg-path-parser.h> // to get from SVG text to Geom::Path
#include "display/canvas-bpath.h" // for SPWindRule
#include "display/cairo-utils.h" // for Inkscape::Pixbuf::PF_CAIRO
@@ -984,7 +983,7 @@ bool PrintWmf::print_simple_shape(Geom::PathVector const &pathv, const Geom::Aff
lpPoints[i].y = y1;
i = i + 1;
} else if (Geom::CubicBezier const *cubic = dynamic_cast<Geom::CubicBezier const *>(&*cit)) {
- std::vector<Geom::Point> points = cubic->points();
+ std::vector<Geom::Point> points = cubic->controlPoints();
//Geom::Point p0 = points[0];
Geom::Point p1 = points[1];
Geom::Point p2 = points[2];