X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Fsvgexporter.cpp;h=11edf645ad7cff6cf2571e383a102e58f4ade6f3;hb=f950f5a77714a155e57c868101911e181a617818;hp=56945f704d8ac44c26047e82bf0287b51ee15397;hpb=6ba6af3637c299ab00828c49de9151429488cc17;p=r2c2.git diff --git a/source/designer/svgexporter.cpp b/source/designer/svgexporter.cpp index 56945f7..11edf64 100644 --- a/source/designer/svgexporter.cpp +++ b/source/designer/svgexporter.cpp @@ -1,20 +1,13 @@ -/* $Id$ - -This file is part of the MSP Märklin suite -Copyright © 2010 Mikkosoft Productions, Mikko Rasa -Distributed under the GPL -*/ - #include -#include -#include "libmarklin/catalogue.h" -#include "libmarklin/track.h" -#include "libmarklin/tracktype.h" +#include +#include "libr2c2/catalogue.h" +#include "libr2c2/track.h" +#include "libr2c2/tracktype.h" #include "svgexporter.h" using namespace std; using namespace Msp; -using namespace Marklin; +using namespace R2C2; SvgExporter::SvgExporter(const Layout &l): layout(l), @@ -27,8 +20,8 @@ void SvgExporter::save(const string &fn) gauge = layout.get_catalogue().get_gauge()*1000; const Profile &rail_profile = layout.get_catalogue().get_rail_profile(); - const Point &rail_min = rail_profile.get_min_coords(); - const Point &rail_max = rail_profile.get_max_coords(); + const Vector &rail_min = rail_profile.get_min_coords(); + const Vector &rail_max = rail_profile.get_max_coords(); rail_width = (rail_max.x-rail_min.x)*1000; xmlpp::Document *doc = new xmlpp::Document; @@ -41,8 +34,8 @@ void SvgExporter::save(const string &fn) ".artnr { text-anchor: middle; font-size: %.3f; }\n", rail_width, rail_width, gauge*0.75)); - Point minp; - Point maxp; + Vector minp; + Vector maxp; const set &tracks = layout.get_tracks(); for(set::const_iterator i=tracks.begin(); i!=tracks.end(); ++i) { @@ -52,7 +45,7 @@ void SvgExporter::save(const string &fn) unsigned n_endpoints = (*i)->get_type().get_endpoints().size(); for(unsigned j=0; jget_endpoint_position(j); + Vector pos = (*i)->get_endpoint_position(j); if(i==tracks.begin() && j==0) minp = maxp = pos; else @@ -73,7 +66,7 @@ void SvgExporter::save(const string &fn) void SvgExporter::save_track(const Track &track, xmlpp::Element &group) { - const Point &pos = track.get_position(); + const Vector &pos = track.get_position(); float rot = track.get_rotation(); string transform = format("translate(%.3f %.3f) rotate(%.3f)", pos.x*1000, -pos.y*1000, -rot*180/M_PI); group.set_attribute("transform", transform);