summaryrefslogtreecommitdiffstats
path: root/src/live_effects/effect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/live_effects/effect.cpp')
-rw-r--r--src/live_effects/effect.cpp32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index 0a78b199e..f60d628f6 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -400,19 +400,39 @@ Effect::doOnApply (SPLPEItem const*/*lpeitem*/)
}
void
-Effect::setSelectedNodePoints(std::vector<Geom::Point> sNP)
+Effect::setCurrentZoom(double cZ)
{
- selectedNodesPoints = sNP;
+ current_zoom = cZ;
}
void
-Effect::setCurrentZoom(double cZ)
+Effect::setSelectedNodePoints(std::vector<Geom::Point> selected_node_points)
{
- current_zoom = cZ;
+ selectedNodesPoints = selected_node_points;
}
+std::vector<size_t>
+Effect::getSelectedNodes()
+{
+ size_t counter = 0;
+ std::vector<size_t> result;
+ for (size_t i = 0; i < pathvector_before_effect.size(); i++) {
+ for (size_t j = 0; j < pathvector_before_effect[i].size_closed(); j++) {
+ if ((pathvector_before_effect[i].size_closed() == j-1 &&
+ isNodePointSelected( pathvector_before_effect[i][j].finalPoint())) ||
+ isNodePointSelected( pathvector_before_effect[i][j].initialPoint()))
+ {
+ result.push_back(counter);
+ }
+ counter++;
+ }
+ }
+ return result;
+}
+
+
bool
-Effect::isNodePointSelected(Geom::Point const &nodePoint) const
+Effect::isNodePointSelected(Geom::Point const &node_point) const
{
if (selectedNodesPoints.size() > 0) {
using Geom::X;
@@ -421,7 +441,7 @@ Effect::isNodePointSelected(Geom::Point const &nodePoint) const
i != selectedNodesPoints.end(); ++i) {
Geom::Point p = *i;
Geom::Affine transformCoordinate = sp_lpe_item->i2dt_affine();
- Geom::Point p2(nodePoint[X],nodePoint[Y]);
+ Geom::Point p2(node_point[X],node_point[Y]);
p2 *= transformCoordinate;
if (Geom::are_near(p, p2, 0.01)) {
return true;