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/live_effects | |
| parent | update to trunk (diff) | |
| download | inkscape-3ce6cb91e8259ec064956c79c2cc4f9050dccbce.tar.gz inkscape-3ce6cb91e8259ec064956c79c2cc4f9050dccbce.zip | |
fixing review
(bzr r13645.1.86)
Diffstat (limited to 'src/live_effects')
| -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 |
6 files changed, 45 insertions, 48 deletions
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 |
