diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2015-05-09 20:48:48 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2015-05-09 20:48:48 +0000 |
| commit | 3ce6cb91e8259ec064956c79c2cc4f9050dccbce (patch) | |
| tree | 32c37696d62b47f8e01dae448a07fdaff70d471b /src | |
| parent | update to trunk (diff) | |
| download | inkscape-3ce6cb91e8259ec064956c79c2cc4f9050dccbce.tar.gz inkscape-3ce6cb91e8259ec064956c79c2cc4f9050dccbce.zip | |
fixing review
(bzr r13645.1.86)
Diffstat (limited to 'src')
| -rw-r--r-- | src/helper/geom-pathinfo.cpp | 73 | ||||
| -rw-r--r-- | src/helper/geom-pathinfo.h | 25 | ||||
| -rw-r--r-- | src/helper/geom-pointwise.cpp | 45 | ||||
| -rw-r--r-- | src/helper/geom-pointwise.h | 23 | ||||
| -rw-r--r-- | src/helper/geom-satellite-enum.h | 39 | ||||
| -rw-r--r-- | src/helper/geom-satellite.cpp | 201 | ||||
| -rw-r--r-- | src/helper/geom-satellite.h | 50 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.cpp | 40 | ||||
| -rw-r--r-- | src/live_effects/lpe-fillet-chamfer.h | 4 | ||||
| -rw-r--r-- | src/live_effects/parameter/array.cpp | 14 | ||||
| -rw-r--r-- | src/live_effects/parameter/array.h | 7 | ||||
| -rw-r--r-- | src/live_effects/parameter/satellitearray.cpp | 20 | ||||
| -rw-r--r-- | src/live_effects/parameter/satellitearray.h | 8 |
13 files changed, 245 insertions, 304 deletions
diff --git a/src/helper/geom-pathinfo.cpp b/src/helper/geom-pathinfo.cpp index 38d58d417..9e5e409c3 100644 --- a/src/helper/geom-pathinfo.cpp +++ b/src/helper/geom-pathinfo.cpp @@ -1,6 +1,6 @@ /** * \file - * \brief Pathinfo store the data of a pathvector and allow get info about it + * \brief Pathinfo store the _data of a pathvector and allow get info about it */ /* * Authors: * 2015 Jabier Arraiza Cenoz<jabier.arraiza@marker.es> @@ -11,48 +11,37 @@ #include <helper/geom-pathinfo.h> #include <2geom/sbasis-to-bezier.h> -namespace Geom { - /** - * @brief Pathinfo store the data of a pathvector and allow get info about it + * @brief Pathinfo store the _data of a pathvector and allow get info about it * */ Pathinfo::Pathinfo(Piecewise<D2<SBasis> > pwd2) { - _setPathInfo(pwd2); + set(pwd2); } -; + Pathinfo::Pathinfo(Geom::PathVector path_vector, bool skip_degenerate) { - _setPathInfo(path_vector, skip_degenerate); + set(path_vector, skip_degenerate); } -; -Pathinfo::~Pathinfo() {} -; -void Pathinfo::setPwd2(Piecewise<D2<SBasis> > pwd2) -{ - _setPathInfo(pwd2); -} +Pathinfo::~Pathinfo() {} -void Pathinfo::setPathVector(Geom::PathVector path_vector, bool skip_degenerate) -{ - _setPathInfo(path_vector, skip_degenerate); -} -void Pathinfo::_setPathInfo(Piecewise<D2<SBasis> > pwd2) +void Pathinfo::set(Piecewise<D2<SBasis> > pwd2) { - _setPathInfo(path_from_piecewise(remove_short_cuts(pwd2, 0.1), 0.001)); + set(path_from_piecewise(remove_short_cuts(pwd2, 0.1), 0.001)); } -/** Store the base path data +/** Store the base path _data */ -void Pathinfo::_setPathInfo(Geom::PathVector path_vector, bool skip_degenerate) +void Pathinfo::set(Geom::PathVector path_vector, bool skip_degenerate) { - data.clear(); + _data.clear(); size_t counter = 0; for (PathVector::const_iterator path_it = path_vector.begin(); - path_it != path_vector.end(); ++path_it) { + path_it != path_vector.end(); ++path_it) + { if (path_it->empty()) { continue; } @@ -73,31 +62,31 @@ void Pathinfo::_setPathInfo(Geom::PathVector path_vector, bool skip_degenerate) counter++; } if (path_it->closed()) { - data.push_back(std::make_pair(counter - 1, true)); + _data.push_back(std::make_pair(counter - 1, true)); } else { - data.push_back(std::make_pair(counter - 1, false)); + _data.push_back(std::make_pair(counter - 1, false)); } } } -size_t Pathinfo::size() const +size_t Pathinfo::subPathCounter() const { - return data.back().first + 1; + return _data.back().first + 1; } size_t Pathinfo::subPathSize(size_t index) const { size_t size = 0; - if( data.size() > index){ - size = data[index].first + 1; + if( _data.size() > index){ + size = _data[index].first + 1; } return size; } size_t Pathinfo::subPathIndex(size_t index) const { - for (size_t i = 0; i < data.size(); i++) { - if (index <= data[i].first) { + for (size_t i = 0; i < _data.size(); i++) { + if (index <= _data[i].first) { return i; } } @@ -106,9 +95,9 @@ size_t Pathinfo::subPathIndex(size_t index) const size_t Pathinfo::last(size_t index) const { - for (size_t i = 0; i < data.size(); i++) { - if (index <= data[i].first) { - return data[i].first; + for (size_t i = 0; i < _data.size(); i++) { + if (index <= _data[i].first) { + return _data[i].first; } } return 0; @@ -116,12 +105,12 @@ size_t Pathinfo::last(size_t index) const size_t Pathinfo::first(size_t index) const { - for (size_t i = 0; i < data.size(); i++) { - if (index <= data[i].first) { + for (size_t i = 0; i < _data.size(); i++) { + if (index <= _data[i].first) { if (i == 0) { return 0; } else { - return data[i - 1].first + 1; + return _data[i - 1].first + 1; } } } @@ -152,16 +141,14 @@ boost::optional<size_t> Pathinfo::next(size_t index) const bool Pathinfo::closed(size_t index) const { - for (size_t i = 0; i < data.size(); i++) { - if (index <= data[i].first) { - return data[i].second; + for (size_t i = 0; i < _data.size(); i++) { + if (index <= _data[i].first) { + return _data[i].second; } } return false; } -}; // namespace Geom - /* Local Variables: mode:c++ diff --git a/src/helper/geom-pathinfo.h b/src/helper/geom-pathinfo.h index 85c4ca6fa..ae05f5b89 100644 --- a/src/helper/geom-pathinfo.h +++ b/src/helper/geom-pathinfo.h @@ -1,6 +1,7 @@ /** * \file - * \brief Pathinfo store the data of a pathvector and allow get info about it + * \brief Pathinfo store data of a pathvector and allow get info about it + * \ */ /* * Authors: * 2015 Jabier Arraiza Cenoz<jabier.arraiza@marker.es> @@ -8,26 +9,26 @@ * This code is in public domain */ -#ifndef SEEN_GEOM_PATHINFO_H -#define SEEN_GEOM_PATHINFO_H +#ifndef SEEN_PATHINFO_H +#define SEEN_PATHINFO_H #include <2geom/path.h> #include <boost/optional.hpp> -namespace Geom { - /** * @brief Pathinfo store the data of a pathvector and allow get info about it * */ +using namespace Geom; class Pathinfo { public: Pathinfo(Piecewise<D2<SBasis> > pwd2); Pathinfo(Geom::PathVector path_vector, bool skip_degenerate = false); virtual ~Pathinfo(); - void setPwd2(Piecewise<D2<SBasis> > pwd2); - void setPathVector(Geom::PathVector path_vector, bool skip_degenerate = false); - size_t size() const; + void set(Piecewise<D2<SBasis> > pwd2); + void set(Geom::PathVector path_vector, bool skip_degenerate = false); + std::vector<std::pair<size_t, bool> > get(){return _data;}; + size_t subPathCounter() const; size_t subPathSize(size_t index) const; size_t subPathIndex(size_t index) const; size_t last(size_t index) const; @@ -35,16 +36,12 @@ public: boost::optional<size_t> previous(size_t index) const; boost::optional<size_t> next(size_t index) const; bool closed(size_t index) const; - std::vector<std::pair<size_t, bool> > data; private: - void _setPathInfo(Piecewise<D2<SBasis> > pwd2); - void _setPathInfo(Geom::PathVector path_vector, bool skip_degenerate = false); + std::vector<std::pair<size_t, bool> > _data; }; -} //namespace Geom - -#endif //SEEN_GEOM_PATHINFO_H +#endif //SEEN_PATHINFO_H /* Local Variables: mode:c++ diff --git a/src/helper/geom-pointwise.cpp b/src/helper/geom-pointwise.cpp index 89bde4130..bd03f1d89 100644 --- a/src/helper/geom-pointwise.cpp +++ b/src/helper/geom-pointwise.cpp @@ -10,8 +10,6 @@ #include <helper/geom-pointwise.h> -namespace Geom { - /** * @brief Pointwise a class to manage a vector of satellites per piecewise curve * @@ -31,20 +29,20 @@ Pointwise::Pointwise(Piecewise<D2<SBasis> > pwd2, { setStart(); } -; + Pointwise::~Pointwise() {} -; + Piecewise<D2<SBasis> > Pointwise::getPwd2() const { return _pwd2; } -void Pointwise::setPwd2(Piecewise<D2<SBasis> > pwd2_in) +void Pointwise::setPwd2(Piecewise<D2<SBasis> > const pwd2_in) { _pwd2 = pwd2_in; - _path_info.setPwd2(_pwd2); + _path_info.set(_pwd2); } std::vector<Satellite> Pointwise::getSatellites() const @@ -52,7 +50,7 @@ std::vector<Satellite> Pointwise::getSatellites() const return _satellites; } -void Pointwise::setSatellites(std::vector<Satellite> sats) +void Pointwise::setSatellites(std::vector<Satellite> const sats) { _satellites = sats; setStart(); @@ -62,7 +60,7 @@ void Pointwise::setSatellites(std::vector<Satellite> sats) */ void Pointwise::setStart() { - std::vector<std::pair<size_t, bool> > path_info = _path_info.data; + std::vector<std::pair<size_t, bool> > path_info = _path_info.get(); for (size_t i = 0; i < path_info.size(); i++) { size_t firstNode = _path_info.first(path_info[i].first); size_t lastNode = _path_info.last(path_info[i].first); @@ -78,7 +76,7 @@ void Pointwise::setStart() /** Fired when a path is modified. */ -void Pointwise::recalculateForNewPwd2(Piecewise<D2<SBasis> > A, Geom::PathVector B, Satellite S) +void Pointwise::recalculateForNewPwd2(Piecewise<D2<SBasis> > const A, Geom::PathVector const B, Satellite const S) { if (_pwd2.size() > A.size()) { pwd2Sustract(A); @@ -91,7 +89,7 @@ void Pointwise::recalculateForNewPwd2(Piecewise<D2<SBasis> > A, Geom::PathVector /** Some nodes/subpaths are removed. */ -void Pointwise::pwd2Sustract(Piecewise<D2<SBasis> > A) +void Pointwise::pwd2Sustract(Piecewise<D2<SBasis> > const A) { size_t counter = 0; std::vector<Satellite> sats; @@ -99,7 +97,8 @@ void Pointwise::pwd2Sustract(Piecewise<D2<SBasis> > A) setPwd2(A); for (size_t i = 0; i < _satellites.size(); i++) { if (_path_info.last(i - counter) < i - counter || - !are_near(pwd2[i].at0(), A[i - counter].at0())) { + !are_near(pwd2[i].at0(), A[i - counter].at0())) + { counter++; } else { sats.push_back(_satellites[i - counter]); @@ -110,7 +109,7 @@ void Pointwise::pwd2Sustract(Piecewise<D2<SBasis> > A) /** Append nodes/subpaths to current pointwise */ -void Pointwise::pwd2Append(Piecewise<D2<SBasis> > A, Satellite S) +void Pointwise::pwd2Append(Piecewise<D2<SBasis> > const A, Satellite const S) { size_t counter = 0; std::vector<Satellite> sats; @@ -120,9 +119,9 @@ void Pointwise::pwd2Append(Piecewise<D2<SBasis> > A, Satellite S) size_t last = _path_info.last(i - counter); //Check for subpath closed. If a subpath is closed, is not reversed or moved //to back - _path_info.setPwd2(A); + _path_info.set(A); size_t new_subpath_index = _path_info.subPathIndex(i); - _path_info.setPwd2(_pwd2); + _path_info.set(_pwd2); bool subpath_is_changed = false; if (_pwd2.size() <= i - counter) { subpath_is_changed = false; @@ -163,7 +162,8 @@ void Pointwise::subpathToBack(size_t subpath) std::vector<Geom::Path> tmp_path; Geom::Path to_back; for (PathVector::const_iterator path_it = path_in.begin(); - path_it != path_in.end(); ++path_it) { + path_it != path_in.end(); ++path_it) + { if (path_it->empty()) { continue; } @@ -208,7 +208,8 @@ void Pointwise::subpathReverse(size_t start, size_t end) std::vector<Geom::Path> tmp_path; Geom::Path rev; for (PathVector::const_iterator path_it = path_in.begin(); - path_it != path_in.end(); ++path_it) { + path_it != path_in.end(); ++path_it) + { if (path_it->empty()) { continue; } @@ -225,11 +226,11 @@ void Pointwise::subpathReverse(size_t start, size_t end) /** Fired when a path is modified duplicating a node. Piecewise ignore degenerated curves. */ -void Pointwise::insertDegenerateSatellites(Piecewise<D2<SBasis> > A, Geom::PathVector B, Satellite S) +void Pointwise::insertDegenerateSatellites(Piecewise<D2<SBasis> > const A, Geom::PathVector const B, Satellite const S) { size_t size_A = A.size(); - _path_info.setPathVector(B); - size_t size_B = _path_info.size(); + _path_info.set(B); + size_t size_B = _path_info.subPathCounter(); size_t satellite_gap = size_B - size_A; if (satellite_gap == 0){ return; @@ -237,7 +238,8 @@ void Pointwise::insertDegenerateSatellites(Piecewise<D2<SBasis> > A, Geom::PathV size_t counter = 0; size_t counter_added = 0; for (PathVector::const_iterator path_it = B.begin(); - path_it != B.end(); ++path_it) { + path_it != B.end(); ++path_it) + { if (path_it->empty()) { continue; } @@ -259,11 +261,10 @@ void Pointwise::insertDegenerateSatellites(Piecewise<D2<SBasis> > A, Geom::PathV } } - _path_info.setPwd2(A); + _path_info.set(A); setPwd2(A); } -} // namespace Geom /* Local Variables: mode:c++ diff --git a/src/helper/geom-pointwise.h b/src/helper/geom-pointwise.h index e4b9f2b05..787cdbfff 100644 --- a/src/helper/geom-pointwise.h +++ b/src/helper/geom-pointwise.h @@ -8,8 +8,8 @@ * This code is in public domain */ -#ifndef SEEN_GEOM_POINTWISE_H -#define SEEN_GEOM_POINTWISE_H +#ifndef SEEN_POINTWISE_H +#define SEEN_POINTWISE_H #include <helper/geom-satellite.h> #include <helper/geom-pathinfo.h> @@ -20,8 +20,6 @@ #include <2geom/path.h> #include <boost/optional.hpp> -namespace Geom { - /** * @brief Pointwise a class to manage a vector of satellites per piecewise curve * @@ -35,25 +33,26 @@ namespace Geom { * optional satellites, and remove the active variable in satellites. * */ +using namespace Geom; class Pointwise { public: Pointwise(Piecewise<D2<SBasis> > pwd2, std::vector<Satellite> satellites); virtual ~Pointwise(); Piecewise<D2<SBasis> > getPwd2() const; - void setPwd2(Piecewise<D2<SBasis> > pwd2_in); + void setPwd2(Piecewise<D2<SBasis> > const pwd2_in); std::vector<Satellite> getSatellites() const; - void setSatellites(std::vector<Satellite> sats); + void setSatellites(std::vector<Satellite> const sats); void setStart(); - void recalculateForNewPwd2(Piecewise<D2<SBasis> > A, Geom::PathVector B, Satellite S); - void pwd2Sustract(Piecewise<D2<SBasis> > A); - void pwd2Append(Piecewise<D2<SBasis> > A, Satellite S); + void recalculateForNewPwd2(Piecewise<D2<SBasis> > const A, Geom::PathVector const B, Satellite const S); + void pwd2Sustract(Piecewise<D2<SBasis> > const A); + void pwd2Append(Piecewise<D2<SBasis> > const A, Satellite const S); void subpathToBack(size_t subpath); void subpathReverse(size_t start, size_t end); - void insertDegenerateSatellites(Piecewise<D2<SBasis> > A, Geom::PathVector B, Satellite S); + void insertDegenerateSatellites(Piecewise<D2<SBasis> > const A, Geom::PathVector const B, Satellite const S); private: Piecewise<D2<SBasis> > _pwd2; @@ -61,9 +60,7 @@ private: Pathinfo _path_info; }; -} // end namespace Geom - -#endif //SEEN_GEOM_POINTWISE_H +#endif //SEEN_POINTWISE_H /* Local Variables: mode:c++ diff --git a/src/helper/geom-satellite-enum.h b/src/helper/geom-satellite-enum.h deleted file mode 100644 index d82cdabe0..000000000 --- a/src/helper/geom-satellite-enum.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef LIB2GEOM_SEEN_SATELLITE_ENUM_H -#define LIB2GEOM_SEEN_SATELLITE_ENUM_H - -/** - * \file - * \brief Satellite types enum - */ /* - * Authors: - * 2015 Jabier Arraiza Cenoz<jabier.arraiza@marker.es> - * - * This code is in public domain - */ - -#include "util/enums.h" - -namespace Geom { - -enum SatelliteType { - F = 0, //Fillet - IF, //Inverse Fillet - C, //Chamfer - IC, //Inverse Chamfer - KO // Invalid Satellite) -}; - -} //namespace Geom - -#endif - -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/helper/geom-satellite.cpp b/src/helper/geom-satellite.cpp index efe6bb37a..397a556a9 100644 --- a/src/helper/geom-satellite.cpp +++ b/src/helper/geom-satellite.cpp @@ -17,38 +17,32 @@ #include <2geom/ray.h> #include <boost/optional.hpp> -namespace Geom { - /** * @brief Satellite a per ?node/curve holder of data. */ Satellite::Satellite() {} -; -Satellite::Satellite(SatelliteType satelliteType, bool isTime, bool active, - bool hasMirror, bool hidden, double amount, double angle, - size_t steps) - : satelliteType(satelliteType), isTime(isTime), active(active), - hasMirror(hasMirror), hidden(hidden), amount(amount), angle(angle), - steps(steps) {} -; + +Satellite::Satellite(SatelliteType satellite_type) + : satellite_type(satellite_type) +{} Satellite::~Satellite() {} -; /** * Calculate the time in d2_in with a size of A + * TODO: find a better place to it */ -double Satellite::toTime(double A, Geom::D2<Geom::SBasis> d2_in) const +double timeAtArcLength(double A, Geom::D2<Geom::SBasis> const d2_in) { if (!d2_in.isFinite() || d2_in.isZero() || A == 0) { return 0; } double t = 0; - double lenghtPart = Geom::length(d2_in, Geom::EPSILON); - if (A > lenghtPart || d2_in[0].degreesOfFreedom() == 2) { - if (lenghtPart != 0) { - t = A / lenghtPart; + double length_part = Geom::length(d2_in, Geom::EPSILON); + if (A > length_part || d2_in[0].degreesOfFreedom() == 2) { + if (length_part != 0) { + t = A / length_part; } } else if (d2_in[0].degreesOfFreedom() != 2) { Geom::Piecewise<Geom::D2<Geom::SBasis> > u; @@ -65,16 +59,17 @@ double Satellite::toTime(double A, Geom::D2<Geom::SBasis> d2_in) const /** * Calculate the size in d2_in with a point at A + * TODO: find a better place to it */ -double Satellite::toSize(double A, Geom::D2<Geom::SBasis> d2_in) const +double arcLengthAt(double A, Geom::D2<Geom::SBasis> const d2_in) { if (!d2_in.isFinite() || d2_in.isZero() || A == 0) { return 0; } double s = 0; - double lenghtPart = Geom::length(d2_in, Geom::EPSILON); - if (A > lenghtPart || d2_in[0].degreesOfFreedom() == 2) { - s = (A * lenghtPart); + double length_part = Geom::length(d2_in, Geom::EPSILON); + if (A > length_part || d2_in[0].degreesOfFreedom() == 2) { + s = (A * length_part); } else if (d2_in[0].degreesOfFreedom() != 2) { Geom::Piecewise<Geom::D2<Geom::SBasis> > u; u.push_cut(0); @@ -86,81 +81,79 @@ double Satellite::toSize(double A, Geom::D2<Geom::SBasis> d2_in) const } /** - * Calculate the lenght of a satellite from a radious A input. + * Calculate the length of a satellite from a radious A input. + * convert a arc radius to a satellite length */ double Satellite::radToLen( - double A, boost::optional<Geom::D2<Geom::SBasis> > d2_in, - Geom::D2<Geom::SBasis> d2_out, - boost::optional<Geom::Satellite> previousSatellite) const + double A, Geom::D2<Geom::SBasis> const d2_in, + Geom::D2<Geom::SBasis> const d2_out, + Satellite const previousSatellite) const { double len = 0; - if (d2_in && previousSatellite) { - Piecewise<D2<SBasis> > offset_curve0 = - Piecewise<D2<SBasis> >(*d2_in) + - rot90(unitVector(derivative(*d2_in))) * (A); - Piecewise<D2<SBasis> > offset_curve1 = - Piecewise<D2<SBasis> >(d2_out) + - rot90(unitVector(derivative(d2_out))) * (A); - Geom::Path p0 = path_from_piecewise(offset_curve0, 0.1)[0]; - Geom::Path p1 = path_from_piecewise(offset_curve1, 0.1)[0]; - Geom::Crossings cs = Geom::crossings(p0, p1); - if (cs.size() > 0) { - Point cp = p0(cs[0].ta); - double p0pt = nearest_point(cp, d2_out); - len = (*previousSatellite).toSize(p0pt, d2_out); - } else { - if (A > 0) { - len = radToLen(A * -1, *d2_in, d2_out, previousSatellite); - } + Piecewise<D2<SBasis> > offset_curve0 = + Piecewise<D2<SBasis> >(d2_in) + + rot90(unitVector(derivative(d2_in))) * (A); + Piecewise<D2<SBasis> > offset_curve1 = + Piecewise<D2<SBasis> >(d2_out) + + rot90(unitVector(derivative(d2_out))) * (A); + Geom::Path p0 = path_from_piecewise(offset_curve0, 0.1)[0]; + Geom::Path p1 = path_from_piecewise(offset_curve1, 0.1)[0]; + Geom::Crossings cs = Geom::crossings(p0, p1); + if (cs.size() > 0) { + Point cp = p0(cs[0].ta); + double p0pt = nearest_point(cp, d2_out); + len = arcLengthAt(p0pt, d2_out); + } else { + if (A > 0) { + len = radToLen(A * -1, d2_in, d2_out, previousSatellite); } } return len; } /** -* Calculate the radious of a satellite from a lenght A input. +* Calculate the radious of a satellite from a length A input. +* convert a satellite length to a arc radius */ double Satellite::lenToRad( - double A, boost::optional<Geom::D2<Geom::SBasis> > d2_in, - Geom::D2<Geom::SBasis> d2_out, - boost::optional<Geom::Satellite> previousSatellite) const + double A, Geom::D2<Geom::SBasis> const d2_in, + Geom::D2<Geom::SBasis> const d2_out, + Satellite const previousSatellite) const { - if (d2_in && previousSatellite) { - double time_in = (*previousSatellite).time(A, true, *d2_in); - double time_out = (*previousSatellite).toTime(A, d2_out); - Geom::Point startArcPoint = (*d2_in).valueAt(time_in); - Geom::Point endArcPoint = d2_out.valueAt(time_out); - Piecewise<D2<SBasis> > u; - u.push_cut(0); - u.push(*d2_in, 1); - Geom::Curve *C = path_from_piecewise(u, 0.1)[0][0].duplicate(); - Piecewise<D2<SBasis> > u2; - u2.push_cut(0); - u2.push(d2_out, 1); - Geom::Curve *D = path_from_piecewise(u2, 0.1)[0][0].duplicate(); - Curve *knotCurve1 = C->portion(0, time_in); - Curve *knotCurve2 = D->portion(time_out, 1); - Geom::CubicBezier const *cubic1 = - dynamic_cast<Geom::CubicBezier const *>(&*knotCurve1); - Ray ray1(startArcPoint, (*d2_in).valueAt(1)); - if (cubic1) { - ray1.setPoints((*cubic1)[2], startArcPoint); - } - Geom::CubicBezier const *cubic2 = - dynamic_cast<Geom::CubicBezier const *>(&*knotCurve2); - Ray ray2(d2_out.valueAt(0), endArcPoint); - if (cubic2) { - ray2.setPoints(endArcPoint, (*cubic2)[1]); - } - bool ccwToggle = cross((*d2_in).valueAt(1) - startArcPoint, - endArcPoint - startArcPoint) < 0; - double distanceArc = - Geom::distance(startArcPoint, middle_point(startArcPoint, endArcPoint)); - double angleBetween = angle_between(ray1, ray2, ccwToggle); - double divisor = std::sin(angleBetween / 2.0); - if (divisor > 0) { - return distanceArc / divisor; - } + double time_in = (previousSatellite).time(A, true, d2_in); + double time_out = timeAtArcLength(A, d2_out); + Geom::Point startArcPoint = (d2_in).valueAt(time_in); + Geom::Point endArcPoint = d2_out.valueAt(time_out); + Piecewise<D2<SBasis> > u; + u.push_cut(0); + u.push(d2_in, 1); + Geom::Curve *C = path_from_piecewise(u, 0.1)[0][0].duplicate(); + Piecewise<D2<SBasis> > u2; + u2.push_cut(0); + u2.push(d2_out, 1); + Geom::Curve *D = path_from_piecewise(u2, 0.1)[0][0].duplicate(); + Curve *knotCurve1 = C->portion(0, time_in); + Curve *knotCurve2 = D->portion(time_out, 1); + Geom::CubicBezier const *cubic1 = + dynamic_cast<Geom::CubicBezier const *>(&*knotCurve1); + Ray ray1(startArcPoint, (d2_in).valueAt(1)); + if (cubic1) { + ray1.setPoints((*cubic1)[2], startArcPoint); + } + Geom::CubicBezier const *cubic2 = + dynamic_cast<Geom::CubicBezier const *>(&*knotCurve2); + Ray ray2(d2_out.valueAt(0), endArcPoint); + if (cubic2) { + ray2.setPoints(endArcPoint, (*cubic2)[1]); + } + bool ccwToggle = cross((d2_in).valueAt(1) - startArcPoint, + endArcPoint - startArcPoint) < 0; + double distanceArc = + Geom::distance(startArcPoint, middle_point(startArcPoint, endArcPoint)); + double angleBetween = angle_between(ray1, ray2, ccwToggle); + double divisor = std::sin(angleBetween / 2.0); + if (divisor > 0) { + return distanceArc / divisor; } return 0; } @@ -171,8 +164,8 @@ double Satellite::lenToRad( double Satellite::time(Geom::D2<Geom::SBasis> d2_in) const { double t = amount; - if (!isTime) { - t = toTime(t, d2_in); + if (!is_time) { + t = timeAtArcLength(t, d2_in); } if (t > 1) { t = 1; @@ -181,7 +174,7 @@ double Satellite::time(Geom::D2<Geom::SBasis> d2_in) const } /**. - * Get the time from a lenght A in other curve, a bolean I gived to reverse time + * Get the time from a length A in other curve, a bolean I gived to reverse time */ double Satellite::time(double A, bool I, Geom::D2<Geom::SBasis> d2_in) const @@ -193,21 +186,21 @@ double Satellite::time(double A, bool I, return 0; } if (!I) { - return toTime(A, d2_in); + return timeAtArcLength(A, d2_in); } - double lenghtPart = Geom::length(d2_in, Geom::EPSILON); - A = lenghtPart - A; - return toTime(A, d2_in); + double length_part = Geom::length(d2_in, Geom::EPSILON); + A = length_part - A; + return timeAtArcLength(A, d2_in); } /** - * Get the lenght of the satellite in d2_in + * Get the length of the satellite in d2_in */ -double Satellite::size(Geom::D2<Geom::SBasis> d2_in) const +double Satellite::arcDistance(Geom::D2<Geom::SBasis> d2_in) const { double s = amount; - if (isTime) { - s = toSize(s, d2_in); + if (is_time) { + s = arcLengthAt(s, d2_in); } return s; } @@ -227,8 +220,8 @@ Geom::Point Satellite::getPosition(Geom::D2<Geom::SBasis> d2_in) const void Satellite::setPosition(Geom::Point p, Geom::D2<Geom::SBasis> d2_in) { double A = Geom::nearest_point(p, d2_in); - if (!isTime) { - A = toSize(A, d2_in); + if (!is_time) { + A = arcLengthAt(A, d2_in); } amount = A; } @@ -238,9 +231,13 @@ void Satellite::setPosition(Geom::Point p, Geom::D2<Geom::SBasis> d2_in) */ void Satellite::setSatelliteType(gchar const *A) { - std::map<std::string, SatelliteType> GcharMapToSatelliteType = - boost::assign::map_list_of("F", F)("IF", IF)("C", C)("IC", IC)("KO", KO); - satelliteType = GcharMapToSatelliteType.find(std::string(A))->second; + std::map<std::string, SatelliteType> gchar_map_to_satellite_type = + boost::assign::map_list_of("F", FILLET)("IF", INVERSE_FILLET)("C", CHAMFER)("IC", INVERSE_CHAMFER)("KO", INVALID_SATELLITE); + std::map<std::string, SatelliteType>::iterator it = gchar_map_to_satellite_type.find(std::string(A)); + if(it != gchar_map_to_satellite_type.end()) + { + satellite_type = it->second; + } } /** @@ -248,13 +245,11 @@ void Satellite::setSatelliteType(gchar const *A) */ gchar const *Satellite::getSatelliteTypeGchar() const { - std::map<SatelliteType, gchar const *> SatelliteTypeToGcharMap = - boost::assign::map_list_of(F, "F")(IF, "IF")(C, "C")(IC, "IC")(KO, "KO"); - return SatelliteTypeToGcharMap.at(satelliteType); + std::map<SatelliteType, gchar const *> satellite_type_to_gchar_map = + boost::assign::map_list_of(FILLET, "F")(INVERSE_FILLET, "IF")(CHAMFER, "C")(INVERSE_CHAMFER, "IC")(INVALID_SATELLITE, "KO"); + return satellite_type_to_gchar_map.at(satellite_type); } -} //namespace Geom - /* Local Variables: mode:c++ diff --git a/src/helper/geom-satellite.h b/src/helper/geom-satellite.h index df54819fd..263cefa68 100644 --- a/src/helper/geom-satellite.h +++ b/src/helper/geom-satellite.h @@ -8,61 +8,67 @@ * This code is in public domain */ -#ifndef LIB2GEOM_SEEN_SATELLITE_H -#define LIB2GEOM_SEEN_SATELLITE_H +#ifndef SEEN_SATELLITE_H +#define SEEN_SATELLITE_H -#include <helper/geom-satellite-enum.h> #include <2geom/d2.h> #include <map> #include <boost/assign.hpp> +#include "util/enums.h" -namespace Geom { +enum SatelliteType { + FILLET = 0, //Fillet + INVERSE_FILLET, //Inverse Fillet + CHAMFER, //Chamfer + INVERSE_CHAMFER, //Inverse Chamfer + INVALID_SATELLITE // Invalid Satellite) +}; /** * @brief Satellite a per ?node/curve holder of data. */ +using namespace Geom; class Satellite { public: Satellite(); - Satellite(SatelliteType satelliteType, bool isTime, bool active, - bool hasMirror, bool hidden, double amount, double angle, - size_t steps); + Satellite(SatelliteType satellite_type); virtual ~Satellite(); - - double toSize(double A, Geom::D2<Geom::SBasis> d2_in) const; - double toTime(double A, Geom::D2<Geom::SBasis> d2_in) const; - double lenToRad(double A, boost::optional<Geom::D2<Geom::SBasis> > d2_in, + void setIsTime(bool set_is_time){is_time = set_is_time;} + void setActive(bool set_active){active = set_active;} + void setHasMirror(bool set_has_mirror){has_mirror = set_has_mirror;} + void setHidden(bool set_hidden){hidden = set_hidden;} + void setAmount(bool set_amount){amount = set_amount;} + void setAngle(bool set_angle){angle = set_angle;} + void setSteps(bool set_steps){steps = set_steps;} + double lenToRad(double A, Geom::D2<Geom::SBasis> d2_in, Geom::D2<Geom::SBasis> d2_out, - boost::optional<Geom::Satellite> previousSatellite) const; - double radToLen(double A, boost::optional<Geom::D2<Geom::SBasis> > d2_in, + Satellite previousSatellite) const; + double radToLen(double A, Geom::D2<Geom::SBasis> d2_in, Geom::D2<Geom::SBasis> d2_out, - boost::optional<Geom::Satellite> previousSatellite) const; + Satellite previousSatellite) const; double time(Geom::D2<Geom::SBasis> d2_in) const; double time(double A, bool I, Geom::D2<Geom::SBasis> d2_in) const; - double size(Geom::D2<Geom::SBasis> d2_in) const; + double arcDistance(Geom::D2<Geom::SBasis> d2_in) const; void setPosition(Geom::Point p, Geom::D2<Geom::SBasis> d2_in); Geom::Point getPosition(Geom::D2<Geom::SBasis> d2_in) const; void setSatelliteType(gchar const *A); gchar const *getSatelliteTypeGchar() const; - //TODO: maybe make after variables protected? - SatelliteType satelliteType; - bool isTime; + SatelliteType satellite_type; + bool is_time; bool active; - bool hasMirror; + bool has_mirror; bool hidden; double amount; double angle; size_t steps; }; -} // end namespace Geom - -#endif // LIB2GEOM_SEEN_SATELLITE_H +#endif // SEEN_SATELLITE_H /* Local Variables: diff --git a/src/live_effects/lpe-fillet-chamfer.cpp b/src/live_effects/lpe-fillet-chamfer.cpp index 1b7f232ed..d26f47541 100644 --- a/src/live_effects/lpe-fillet-chamfer.cpp +++ b/src/live_effects/lpe-fillet-chamfer.cpp @@ -97,12 +97,12 @@ void LPEFilletChamfer::doOnApply(SPLPEItem const *lpeItem) SPLPEItem *splpeitem = const_cast<SPLPEItem *>(lpeItem); SPShape *shape = dynamic_cast<SPShape *>(splpeitem); if (shape) { - PathVector const &original_pathv = + PathVector const original_pathv = pathv_to_linear_and_cubic_beziers(shape->getCurve()->get_pathvector()); Piecewise<D2<SBasis> > pwd2_in = paths_to_pw(original_pathv); pwd2_in = remove_short_cuts(pwd2_in, 0.01); int global_counter = 0; - std::vector<Geom::Satellite> satellites; + std::vector<Satellite> satellites; for (PathVector::const_iterator path_it = original_pathv.begin(); path_it != original_pathv.end(); ++path_it) { if (path_it->empty()) { @@ -111,7 +111,7 @@ void LPEFilletChamfer::doOnApply(SPLPEItem const *lpeItem) Geom::Path::const_iterator curve_it1 = path_it->begin(); Geom::Path::const_iterator curve_endit = path_it->end_default(); if (path_it->closed()) { - const Curve &closingline = path_it->back_closed(); + Curve const &closingline = path_it->back_closed(); // the closing line segment is always of type // LineSegment. if (are_near(closingline.initialPoint(), closingline.finalPoint())) { @@ -168,13 +168,12 @@ Gtk::Widget *LPEFilletChamfer::newWidget() if (param->param_key == "radius") { Inkscape::UI::Widget::Scalar *widg_registered = Gtk::manage(dynamic_cast<Inkscape::UI::Widget::Scalar *>(widg)); - widg_registered->signal_value_changed() - .connect(sigc::mem_fun(*this, &LPEFilletChamfer::updateAmount)); + widg_registered->signal_value_changed().connect( + sigc::mem_fun(*this, &LPEFilletChamfer::updateAmount)); widg = widg_registered; if (widg) { Gtk::HBox *scalar_parameter = dynamic_cast<Gtk::HBox *>(widg); - std::vector<Gtk::Widget *> childList = - scalar_parameter->get_children(); + std::vector<Gtk::Widget *> childList = scalar_parameter->get_children(); Gtk::Entry *entry_widget = dynamic_cast<Gtk::Entry *>(childList[1]); entry_widget->set_width_chars(6); } @@ -186,16 +185,15 @@ Gtk::Widget *LPEFilletChamfer::newWidget() widg = widg_registered; if (widg) { Gtk::HBox *scalar_parameter = dynamic_cast<Gtk::HBox *>(widg); - std::vector<Gtk::Widget *> childList = - scalar_parameter->get_children(); + std::vector<Gtk::Widget *> childList = scalar_parameter->get_children(); Gtk::Entry *entry_widget = dynamic_cast<Gtk::Entry *>(childList[1]); entry_widget->set_width_chars(3); } } else if (param->param_key == "helper_size") { Inkscape::UI::Widget::Scalar *widg_registered = Gtk::manage(dynamic_cast<Inkscape::UI::Widget::Scalar *>(widg)); - widg_registered->signal_value_changed() - .connect(sigc::mem_fun(*this, &LPEFilletChamfer::refreshKnots)); + widg_registered->signal_value_changed().connect( + sigc::mem_fun(*this, &LPEFilletChamfer::refreshKnots)); } else if (param->param_key == "only_selected") { Gtk::manage(widg); } @@ -280,10 +278,10 @@ void LPEFilletChamfer::updateAmount() } else { power = radius / 100; } - std::vector<Geom::Satellite> satellites = pointwise->getSatellites(); + std::vector<Satellite> satellites = pointwise->getSatellites(); Piecewise<D2<SBasis> > pwd2 = pointwise->getPwd2(); Pathinfo path_info(pwd2); - for (std::vector<Geom::Satellite>::iterator it = satellites.begin(); + for (std::vector<Satellite>::iterator it = satellites.begin(); it != satellites.end(); ++it) { if (!path_info.closed(it - satellites.begin()) && path_info.first(it - satellites.begin()) == @@ -297,7 +295,7 @@ void LPEFilletChamfer::updateAmount() boost::optional<size_t> previous = path_info.previous(it - satellites.begin()); boost::optional<Geom::D2<Geom::SBasis> > previous_d2 = boost::none; - boost::optional<Geom::Satellite> previous_satellite = boost::none; + boost::optional<Satellite> previous_satellite = boost::none; if (previous) { previous_d2 = pwd2[*previous]; previous_satellite = satellites[*previous]; @@ -327,9 +325,9 @@ void LPEFilletChamfer::updateAmount() void LPEFilletChamfer::updateChamferSteps() { - std::vector<Geom::Satellite> satellites = pointwise->getSatellites(); + std::vector<Satellite> satellites = pointwise->getSatellites(); Piecewise<D2<SBasis> > pwd2 = pointwise->getPwd2(); - for (std::vector<Geom::Satellite>::iterator it = satellites.begin(); + for (std::vector<Satellite>::iterator it = satellites.begin(); it != satellites.end(); ++it) { if (ignore_radius_0 && it->amount == 0) { continue; @@ -347,11 +345,11 @@ void LPEFilletChamfer::updateChamferSteps() satellites_param.setPointwise(pointwise); } -void LPEFilletChamfer::updateSatelliteType(Geom::SatelliteType satellitetype) +void LPEFilletChamfer::updateSatelliteType(SatelliteType satellitetype) { - std::vector<Geom::Satellite> satellites = pointwise->getSatellites(); + std::vector<Satellite> satellites = pointwise->getSatellites(); Piecewise<D2<SBasis> > pwd2 = pointwise->getPwd2(); - for (std::vector<Geom::Satellite>::iterator it = satellites.begin(); + for (std::vector<Satellite>::iterator it = satellites.begin(); it != satellites.end(); ++it) { if (ignore_radius_0 && it->amount == 0) { continue; @@ -391,7 +389,7 @@ void LPEFilletChamfer::doBeforeEffect(SPLPEItem const *lpeItem) pathv_to_linear_and_cubic_beziers(c->get_pathvector()); Piecewise<D2<SBasis> > pwd2_in = paths_to_pw(original_pathv); pwd2_in = remove_short_cuts(pwd2_in, 0.01); - std::vector<Geom::Satellite> sats = satellites_param.data(); + std::vector<Satellite> sats = satellites_param.data(); if(sats.empty()){ doOnApply(lpeItem); sats = satellites_param.data(); @@ -491,7 +489,7 @@ LPEFilletChamfer::doEffect_path(std::vector<Geom::Path> const &path_in) size_t counter_curves = 0; size_t first = counter; double time0 = 0; - std::vector<Geom::Satellite> sats = pointwise->getSatellites(); + std::vector<Satellite> sats = pointwise->getSatellites(); while (curve_it1 != curve_endit) { if (curve_it2 != curve_endit && (*curve_it2).isDegenerate()) { ++curve_it2; diff --git a/src/live_effects/lpe-fillet-chamfer.h b/src/live_effects/lpe-fillet-chamfer.h index 9ec5b5e04..48056924a 100644 --- a/src/live_effects/lpe-fillet-chamfer.h +++ b/src/live_effects/lpe-fillet-chamfer.h @@ -41,7 +41,7 @@ public: virtual void doOnApply(SPLPEItem const *lpeItem); virtual Gtk::Widget *newWidget(); void addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector<Geom::PathVector> &hp_vec); - void updateSatelliteType(Geom::SatelliteType satellitetype); + void updateSatelliteType(SatelliteType satellitetype); void updateChamferSteps(); void updateAmount(); void refreshKnots(); @@ -64,7 +64,7 @@ private: BoolParam ignore_radius_0; ScalarParam helper_size; - Geom::Pointwise *pointwise; + Pointwise *pointwise; Geom::PathVector _hp; LPEFilletChamfer(const LPEFilletChamfer &); diff --git a/src/live_effects/parameter/array.cpp b/src/live_effects/parameter/array.cpp index c8ee63fec..c71b8ed55 100644 --- a/src/live_effects/parameter/array.cpp +++ b/src/live_effects/parameter/array.cpp @@ -15,16 +15,16 @@ namespace LivePathEffect { //TODO: move maybe to svg-lenght.cpp unsigned int -sp_svg_satellite_read_d(gchar const *str, Geom::Satellite *sat){ +sp_svg_satellite_read_d(gchar const *str, Satellite *sat){ if (!str) { return 0; } gchar ** strarray = g_strsplit(str, ",", 8); if(strarray[7] && !strarray[8]){ sat->setSatelliteType(g_strstrip(strarray[0])); - sat->isTime = strncmp(strarray[1],"1",1) == 0; + sat->is_time = strncmp(strarray[1],"1",1) == 0; sat->active = strncmp(strarray[2],"1",1) == 0; - sat->hasMirror = strncmp(strarray[3],"1",1) == 0; + sat->has_mirror = strncmp(strarray[3],"1",1) == 0; sat->hidden = strncmp(strarray[4],"1",1) == 0; double amount,angle; float stepsTmp; @@ -76,14 +76,14 @@ ArrayParam<Geom::Point>::readsvg(const gchar * str) } template <> -Geom::Satellite -ArrayParam<Geom::Satellite >::readsvg(const gchar * str) +Satellite +ArrayParam<Satellite >::readsvg(const gchar * str) { - Geom::Satellite sat; + Satellite sat; if (sp_svg_satellite_read_d(str, &sat)) { return sat; } - Geom::Satellite satellite(Geom::F, true, false, false, true, 0.0, 0.0, 0); + Satellite satellite(Geom::F, true, false, false, true, 0.0, 0.0, 0); return satellite; } diff --git a/src/live_effects/parameter/array.h b/src/live_effects/parameter/array.h index 25e479304..66ed6344b 100644 --- a/src/live_effects/parameter/array.h +++ b/src/live_effects/parameter/array.h @@ -16,7 +16,6 @@ #include "live_effects/parameter/parameter.h" #include "helper/geom-satellite.h" -#include "helper/geom-satellite-enum.h" #include "svg/svg.h" #include "svg/stringstream.h" @@ -111,14 +110,14 @@ protected: str << nVector; } - void writesvgData(SVGOStringStream &str, Geom::Satellite const &nVector) const { + void writesvgData(SVGOStringStream &str, Satellite const &nVector) const { str << nVector.getSatelliteTypeGchar(); str << ","; - str << nVector.isTime; + str << nVector.is_time; str << ","; str << nVector.active; str << ","; - str << nVector.hasMirror; + str << nVector.has_mirror; str << ","; str << nVector.hidden; str << ","; diff --git a/src/live_effects/parameter/satellitearray.cpp b/src/live_effects/parameter/satellitearray.cpp index b0b036962..5a3b64dd3 100644 --- a/src/live_effects/parameter/satellitearray.cpp +++ b/src/live_effects/parameter/satellitearray.cpp @@ -30,7 +30,7 @@ SatelliteArrayParam::SatelliteArrayParam(const Glib::ustring &label, const Glib::ustring &key, Inkscape::UI::Widget::Registry *wr, Effect *effect) - : ArrayParam<Geom::Satellite>(label, tip, key, wr, effect, 0), knoth(NULL) + : ArrayParam<Satellite>(label, tip, key, wr, effect, 0), knoth(NULL) { _knot_shape = SP_KNOT_SHAPE_DIAMOND; _knot_mode = SP_KNOT_MODE_XOR; @@ -52,7 +52,7 @@ void SatelliteArrayParam::set_oncanvas_looks(SPKnotShapeType shape, _knot_color = color; } -void SatelliteArrayParam::setPointwise(Geom::Pointwise *pointwise) +void SatelliteArrayParam::setPointwise(Pointwise *pointwise) { _last_pointwise = pointwise; param_set_and_write_new_value(_last_pointwise->getSatellites()); @@ -280,11 +280,11 @@ void FilletChamferKnotHolderEntity::knot_set(Point const &p, return; } - Geom::Satellite satellite = _pparam->_vector.at(index); + Satellite satellite = _pparam->_vector.at(index); if (!satellite.active || satellite.hidden) { return; } - Geom::Pointwise *pointwise = _pparam->_last_pointwise; + Pointwise *pointwise = _pparam->_last_pointwise; Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = pointwise->getPwd2(); Pathinfo path_info(pwd2); if (_pparam->_vector.size() <= _index) { @@ -293,7 +293,7 @@ void FilletChamferKnotHolderEntity::knot_set(Point const &p, Geom::D2<Geom::SBasis> d2_in = pwd2[*d2_prev_index]; double mirror_time = Geom::nearest_point(s, d2_in); double time_start = 0; - std::vector<Geom::Satellite> sats = pointwise->getSatellites(); + std::vector<Satellite> sats = pointwise->getSatellites(); time_start = sats[*d2_prev_index].time(d2_in); if (time_start > mirror_time) { mirror_time = time_start; @@ -325,14 +325,14 @@ Geom::Point FilletChamferKnotHolderEntity::knot_get() const if (!valid_index(index)) { return Point(infinity(), infinity()); } - Geom::Satellite satellite = _pparam->_vector.at(index); + Satellite satellite = _pparam->_vector.at(index); if (!_pparam->_last_pointwise) { return Point(infinity(), infinity()); } if (!satellite.active || satellite.hidden) { return Point(infinity(), infinity()); } - Geom::Pointwise *pointwise = _pparam->_last_pointwise; + Pointwise *pointwise = _pparam->_last_pointwise; Geom::Piecewise<Geom::D2<Geom::SBasis> > pwd2 = pointwise->getPwd2(); Pathinfo path_info(pwd2); if (pwd2.size() <= index) { @@ -429,7 +429,7 @@ void FilletChamferKnotHolderEntity::knot_click(guint state) if (!_pparam->_use_distance && !_pparam->_vector.at(index).isTime) { boost::optional<size_t> prev = path_info.previous(index); boost::optional<Geom::D2<Geom::SBasis> > prevPwd2 = boost::none; - boost::optional<Geom::Satellite> prevSat = boost::none; + boost::optional<Satellite> prevSat = boost::none; if (prev) { prevPwd2 = pwd2[*prev]; prevSat = _pparam->_vector.at(*prev); @@ -456,7 +456,7 @@ void FilletChamferKnotHolderEntity::knot_click(guint state) } } -void FilletChamferKnotHolderEntity::knot_set_offset(Geom::Satellite satellite) +void FilletChamferKnotHolderEntity::knot_set_offset(Satellite satellite) { if (!_pparam->_last_pointwise) { return; @@ -472,7 +472,7 @@ void FilletChamferKnotHolderEntity::knot_set_offset(Geom::Satellite satellite) Pathinfo path_info(pwd2); boost::optional<size_t> prev = path_info.previous(index); boost::optional<Geom::D2<Geom::SBasis> > prevPwd2 = boost::none; - boost::optional<Geom::Satellite> prevSat = boost::none; + boost::optional<Satellite> prevSat = boost::none; if (prev) { prevPwd2 = pwd2[*prev]; prevSat = _pparam->_vector.at(*prev); diff --git a/src/live_effects/parameter/satellitearray.h b/src/live_effects/parameter/satellitearray.h index 2845e3969..cc09e7589 100644 --- a/src/live_effects/parameter/satellitearray.h +++ b/src/live_effects/parameter/satellitearray.h @@ -30,7 +30,7 @@ namespace LivePathEffect { class FilletChamferKnotHolderEntity; -class SatelliteArrayParam : public ArrayParam<Geom::Satellite> { +class SatelliteArrayParam : public ArrayParam<Satellite> { public: SatelliteArrayParam(const Glib::ustring &label, const Glib::ustring &tip, const Glib::ustring &key, @@ -57,7 +57,7 @@ public: void param_transform_multiply(Geom::Affine const &postmul, bool /*set*/); void setUseDistance(bool use_knot_distance); void setEffectType(EffectType et); - void setPointwise(Geom::Pointwise *pointwise); + void setPointwise(Pointwise *pointwise); void set_oncanvas_looks(SPKnotShapeType shape, SPKnotModeType mode, guint32 color); @@ -78,7 +78,7 @@ private: int _helper_size; bool _use_distance; EffectType _effectType; - Geom::Pointwise *_last_pointwise; + Pointwise *_last_pointwise; }; @@ -94,7 +94,7 @@ public: guint state); virtual Geom::Point knot_get() const; virtual void knot_click(guint state); - void knot_set_offset(Geom::Satellite); + void knot_set_offset(Satellite); /** Checks whether the index falls within the size of the parameter's vector */ bool valid_index(size_t index) const |
