1 /* === S Y N F I G ========================================================= */
2 /*! \file valuenode_bline.cpp
3 ** \brief Implementation of the "BLine" valuenode conversion.
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 ** Copyright (c) 2007, 2008 Chris Moore
11 ** This package is free software; you can redistribute it and/or
12 ** modify it under the terms of the GNU General Public License as
13 ** published by the Free Software Foundation; either version 2 of
14 ** the License, or (at your option) any later version.
16 ** This package is distributed in the hope that it will be useful,
17 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 ** General Public License for more details.
22 /* ========================================================================= */
24 /* === H E A D E R S ======================================================= */
33 #include "valuenode_bline.h"
34 #include "valuenode_const.h"
35 #include "valuenode_composite.h"
37 #include "exception.h"
38 #include "blinepoint.h"
42 #include <ETL/hermite>
43 #include <ETL/calculus>
45 #include "curve_helper.h"
49 /* === U S I N G =========================================================== */
53 using namespace synfig;
55 /* === M A C R O S ========================================================= */
57 #define EPSILON 0.0000001f
59 /* === G L O B A L S ======================================================= */
61 /* === P R O C E D U R E S ================================================= */
64 linear_interpolation(const float& a, const float& b, float c)
68 linear_interpolation(const Vector& a, const Vector& b, float c)
72 radial_interpolation(const Vector& a, const Vector& b, float c)
74 // if either extreme is zero then use linear interpolation instead
75 if (a.is_equal_to(Vector::zero()) || b.is_equal_to(Vector::zero()))
76 return linear_interpolation(a, b, c);
78 affine_combo<Real,float> mag_combo;
79 affine_combo<Angle,float> ang_combo;
81 Real mag(mag_combo(a.mag(),b.mag(),c));
82 Angle angle_a(Angle::tan(a[1],a[0]));
83 Angle angle_b(Angle::tan(b[1],b[0]));
84 float diff = Angle::deg(angle_b - angle_a).get();
85 if (diff < -180) angle_b += Angle::deg(360);
86 else if (diff > 180) angle_a += Angle::deg(360);
87 Angle ang(ang_combo(angle_a, angle_b, c));
89 return Point( mag*Angle::cos(ang).get(),mag*Angle::sin(ang).get() );
93 transform_coords(Vector in, Vector& out, const Point& coord_origin, const Point *coord_sys)
96 out[0] = in * coord_sys[0];
97 out[1] = in * coord_sys[1];
101 untransform_coords(const Vector& in, Vector& out, const Point& coord_origin, const Point *coord_sys)
103 out[0] = in * coord_sys[0];
104 out[1] = in * coord_sys[1];
109 synfig::convert_bline_to_segment_list(const ValueBase& bline)
111 std::vector<Segment> ret;
113 // std::vector<BLinePoint> list(bline.operator std::vector<BLinePoint>());
114 //std::vector<BLinePoint> list(bline);
115 std::vector<BLinePoint> list(bline.get_list().begin(),bline.get_list().end());
116 std::vector<BLinePoint>::const_iterator iter;
118 BLinePoint prev,first;
120 //start with prev = first and iter on the second...
122 if(list.empty()) return ValueBase(ret,bline.get_loop());
123 first = prev = list.front();
125 for(iter=++list.begin();iter!=list.end();++iter)
148 return ValueBase(ret,bline.get_loop());
152 synfig::convert_bline_to_width_list(const ValueBase& bline)
154 std::vector<Real> ret;
155 // std::vector<BLinePoint> list(bline.operator std::vector<BLinePoint>());
156 //std::vector<BLinePoint> list(bline);
157 std::vector<BLinePoint> list(bline.get_list().begin(),bline.get_list().end());
158 std::vector<BLinePoint>::const_iterator iter;
161 return ValueBase(ValueBase::TYPE_LIST);
163 for(iter=list.begin();iter!=list.end();++iter)
164 ret.push_back(iter->get_width());
167 ret.push_back(list.front().get_width());
169 return ValueBase(ret,bline.get_loop());
173 synfig::find_closest_point(const ValueBase &bline, const Point &pos, Real &radius, bool loop, Point *out_point)
179 synfig::Point best_point;
181 if(radius==0)radius=10000000;
182 Real closest(10000000);
185 std::vector<BLinePoint> list(bline.get_list().begin(),bline.get_list().end());
186 typedef std::vector<BLinePoint>::const_iterator iterT;
187 iterT iter, prev, first;
188 for(iter=list.begin(); iter!=list.end(); ++i, ++iter)
190 if( first == iterT() )
193 if( prev != iterT() )
197 curve[0] = (*prev).get_vertex();
198 curve[1] = curve[0] + (*prev).get_tangent2()/3;
199 curve[3] = (*iter).get_vertex();
200 curve[2] = curve[3] - (*iter).get_tangent1()/3;
204 // I don't know why this doesn't work
205 time=curve.find_closest(pos,6);
206 d=((curve(time)-pos).mag_squared());
209 //set the step size based on the size of the picture
210 d = (curve[1] - curve[0]).mag() + (curve[2]-curve[1]).mag() + (curve[3]-curve[2]).mag();
212 step = d/(2*radius); //want to make the distance between lines happy
214 step = max(step,0.01); //100 samples should be plenty
215 step = min(step,0.1); //10 is minimum
217 d = find_closest(curve,pos,step,&closest,&time);
225 best_point = curve(best_time);
234 if( loop && ( first != iterT() ) && ( prev != iterT() ) )
238 curve[0] = (*prev).get_vertex();
239 curve[1] = curve[0] + (*prev).get_tangent2()/3;
240 curve[3] = (*first).get_vertex();
241 curve[2] = curve[3] - (*first).get_tangent1()/3;
245 // I don't know why this doesn't work
246 time=curve.find_closest(pos,6);
247 d=((curve(time)-pos).mag_squared());
250 //set the step size based on the size of the picture
251 d = (curve[1] - curve[0]).mag() + (curve[2]-curve[1]).mag() + (curve[3]-curve[2]).mag();
253 step = d/(2*radius); //want to make the distance between lines happy
255 step = max(step,0.01); //100 samples should be plenty
256 step = min(step,0.1); //10 is minimum
258 d = find_closest(curve,pos,step,&closest,&time);
266 best_point = curve(best_time);
273 *out_point = best_point;
275 int loop_adjust(loop ? 0 : -1);
276 int size = list.size();
277 Real amount = (best_index + best_time + loop_adjust) / (size + loop_adjust);
285 /* === M E T H O D S ======================================================= */
288 ValueNode_BLine::ValueNode_BLine():
289 ValueNode_DynamicList(ValueBase::TYPE_BLINEPOINT)
293 ValueNode_BLine::~ValueNode_BLine()
298 ValueNode_BLine::create(const ValueBase &value)
300 if(value.get_type()!=ValueBase::TYPE_LIST)
303 ValueNode_BLine* value_node(new ValueNode_BLine());
307 switch(value.get_contained_type())
309 case ValueBase::TYPE_BLINEPOINT:
311 // std::vector<BLinePoint> bline_points(value.operator std::vector<BLinePoint>());
312 //std::vector<BLinePoint> bline_points(value);
313 std::vector<BLinePoint> bline_points(value.get_list().begin(),value.get_list().end());
314 std::vector<BLinePoint>::const_iterator iter;
316 for(iter=bline_points.begin();iter!=bline_points.end();iter++)
318 value_node->add(ValueNode::Handle(ValueNode_Composite::create(*iter)));
320 value_node->set_loop(value.get_loop());
323 case ValueBase::TYPE_SEGMENT:
325 // Here, we want to convert a list of segments
326 // into a list of BLinePoints. We make an assumption
327 // that the segment list is continuous(sp), but not necessarily
330 value_node->set_loop(false);
331 // std::vector<Segment> segments(value.operator std::vector<Segment>());
332 // std::vector<Segment> segments(value);
333 std::vector<Segment> segments(value.get_list().begin(),value.get_list().end());
334 std::vector<Segment>::const_iterator iter,last(segments.end());
336 ValueNode_Const::Handle prev,first;
338 for(iter=segments.begin();iter!=segments.end();iter++)
340 #define PREV_POINT prev->get_value().get(BLinePoint())
341 #define FIRST_POINT first->get_value().get(BLinePoint())
342 #define CURR_POINT curr->get_value().get(BLinePoint())
343 if(iter==segments.begin())
345 prev=ValueNode_Const::create(ValueBase::TYPE_BLINEPOINT);
347 BLinePoint prev_point(PREV_POINT);
348 prev_point.set_vertex(iter->p1);
349 prev_point.set_tangent1(iter->t1);
350 prev_point.set_width(0.01);
351 prev_point.set_origin(0.5);
352 prev_point.set_split_tangent_flag(false);
353 prev->set_value(prev_point);
356 value_node->add(ValueNode::Handle(prev));
359 if(iter==last && iter->p2.is_equal_to(FIRST_POINT.get_vertex()))
361 value_node->set_loop(true);
362 if(!iter->t2.is_equal_to(FIRST_POINT.get_tangent1()))
364 BLinePoint first_point(FIRST_POINT);
365 first_point.set_tangent1(iter->t2);
366 first->set_value(first_point);
371 ValueNode_Const::Handle curr;
372 curr=ValueNode_Const::create(ValueBase::TYPE_BLINEPOINT);
374 BLinePoint curr_point(CURR_POINT);
375 curr_point.set_vertex(iter->p2);
376 curr_point.set_tangent1(iter->t2);
377 curr_point.set_width(0.01);
378 curr_point.set_origin(0.5);
379 curr_point.set_split_tangent_flag(false);
380 curr->set_value(curr_point);
382 if(!PREV_POINT.get_tangent1().is_equal_to(iter->t1))
384 BLinePoint prev_point(PREV_POINT);
385 prev_point.set_split_tangent_flag(true);
386 prev_point.set_tangent2(iter->t1);
387 prev->set_value(prev_point);
389 value_node->add(ValueNode::Handle(curr));
396 // We got a list of who-knows-what. We don't have any idea
397 // what to do with it.
406 ValueNode_BLine::ListEntry
407 ValueNode_BLine::create_list_entry(int index, Time time, Real origin)
409 ValueNode_BLine::ListEntry ret;
411 synfig::BLinePoint prev,next;
415 index=index%link_count();
419 ret.set_parent_value_node(this);
421 if(!list[index].status_at_time(time))
422 next_i=find_next_valid_entry(index,time);
425 prev_i=find_prev_valid_entry(index,time);
427 //synfig::info("index=%d, next_i=%d, prev_i=%d",index,next_i,prev_i);
429 next=(*list[next_i].value_node)(time);
430 prev=(*list[prev_i].value_node)(time);
432 etl::hermite<Vector> curve(prev.get_vertex(),next.get_vertex(),prev.get_tangent2(),next.get_tangent1());
433 etl::derivative< etl::hermite<Vector> > deriv(curve);
435 synfig::BLinePoint bline_point;
436 bline_point.set_vertex(curve(origin));
437 bline_point.set_width((next.get_width()-prev.get_width())*origin+prev.get_width());
438 bline_point.set_tangent1(deriv(origin)*min(1.0-origin,origin));
439 bline_point.set_tangent2(bline_point.get_tangent1());
440 bline_point.set_split_tangent_flag(false);
441 bline_point.set_origin(origin);
443 ret.value_node=ValueNode_Composite::create(bline_point);
448 static int instance_count;
451 ValueNode_BLine::operator()(Time t)const
453 if (getenv("SYNFIG_DEBUG_VALUENODE_OPERATORS"))
454 printf("%s:%d operator()\n", __FILE__, __LINE__);
456 std::vector<BLinePoint> ret_list;
458 std::vector<ListEntry>::const_iterator iter,first_iter;
459 bool first_flag(true);
462 float next_scale(1.0f);
464 BLinePoint prev,first;
465 first.set_origin(100.0f);
467 // loop through all the list's entries
468 for(iter=list.begin();iter!=list.end();++iter,index++)
470 // how 'on' is this vertex?
471 float amount(iter->amount_at_time(t,&rising));
473 assert(amount>=0.0f);
474 assert(amount<=1.0f);
477 if (amount > 1.0f - EPSILON)
482 first=prev=(*iter->value_node)(t).get(prev);
484 ret_list.push_back(first);
489 curr=(*iter->value_node)(t).get(prev);
493 ret_list.back().set_split_tangent_flag(true);
494 ret_list.back().set_tangent2(prev.get_tangent2()*next_scale);
496 ret_list.push_back(curr);
498 ret_list.back().set_split_tangent_flag(true);
499 ret_list.back().set_tangent2(curr.get_tangent2());
500 ret_list.back().set_tangent1(curr.get_tangent1()*next_scale);
506 ret_list.push_back(curr);
514 std::vector<ListEntry>::const_iterator begin_iter,end_iter;
516 // This is where the interesting stuff happens
517 // We need to seek forward in the list to see what the next
520 BLinePoint blp_here_on; // the current vertex, when fully on
521 BLinePoint blp_here_off; // the current vertex, when fully off
522 BLinePoint blp_here_now; // the current vertex, right now (between on and off)
523 BLinePoint blp_prev_off; // the beginning of dynamic group when fully off
524 BLinePoint blp_next_off; // the end of the dynamic group when fully off
526 int dist_from_begin(0), dist_from_end(0);
527 Time off_time, on_time;
529 if(!rising) // if not rising, then we were fully on in the past, and will be fully off in the future
531 try{ on_time=iter->find_prev(t)->get_time(); }
532 catch(...) { on_time=Time::begin(); }
533 try{ off_time=iter->find_next(t)->get_time(); }
534 catch(...) { off_time=Time::end(); }
536 else // otherwise we were fully off in the past, and will be fully on in the future
538 try{ off_time=iter->find_prev(t)->get_time(); }
539 catch(...) { off_time=Time::begin(); }
540 try{ on_time=iter->find_next(t)->get_time(); }
541 catch(...) { on_time=Time::end(); }
544 blp_here_on=(*iter->value_node)(on_time).get(blp_here_on);
545 // blp_here_on=(*iter->value_node)(t).get(blp_here_on);
547 // Find "end" of dynamic group - ie. search forward along
548 // the bline from the current point until we find a point
549 // which is more 'on' than the current one
551 // for(++end_iter;begin_iter!=list.end();++end_iter)
552 for(++end_iter;end_iter!=list.end();++end_iter)
553 if(end_iter->amount_at_time(t)>amount)
556 // If we did not find an end of the dynamic group...
557 // Writeme! at least now it doesn't crash if first_iter
559 if(end_iter==list.end())
561 if(get_loop() && !first_flag)
564 end_iter=--list.end();
567 blp_next_off=(*end_iter->value_node)(off_time).get(prev);
569 // Find "begin" of dynamic group
571 blp_prev_off.set_origin(100.0f); // set the origin to 100 (which is crazy) so that we can check to see if it was found
574 if(begin_iter==list.begin())
577 begin_iter=list.end();
585 // if we've gone all around the loop, give up
589 if(begin_iter->amount_at_time(t)>amount)
591 blp_prev_off=(*begin_iter->value_node)(off_time).get(prev);
596 // If we did not find a begin
597 if(blp_prev_off.get_origin()==100.0f)
599 // Writeme! - this needs work, but at least now it
602 begin_iter=list.begin();
604 begin_iter=first_iter;
605 blp_prev_off=(*begin_iter->value_node)(off_time).get(prev);
608 // this is how the curve looks when we have completely vanished
609 etl::hermite<Vector> curve(blp_prev_off.get_vertex(), blp_next_off.get_vertex(),
610 blp_prev_off.get_tangent2(), blp_next_off.get_tangent1());
611 etl::derivative< etl::hermite<Vector> > deriv(curve);
613 // where would we be on this curve, how wide will we be, and
614 // where will our tangents point (all assuming that we hadn't vanished)
615 blp_here_off.set_vertex(curve(blp_here_on.get_origin()));
616 blp_here_off.set_width((blp_next_off.get_width()-blp_prev_off.get_width())*blp_here_on.get_origin()+blp_prev_off.get_width());
617 blp_here_off.set_tangent1(deriv(blp_here_on.get_origin()));
618 blp_here_off.set_tangent2(deriv(blp_here_on.get_origin()));
620 float prev_tangent_scalar(1.0f);
621 float next_tangent_scalar(1.0f);
623 //synfig::info("index_%d:dist_from_begin=%d",index,dist_from_begin);
624 //synfig::info("index_%d:dist_from_end=%d",index,dist_from_end);
626 // If we are the next to the begin
627 if(begin_iter==--std::vector<ListEntry>::const_iterator(iter) || dist_from_begin==1)
628 prev_tangent_scalar=linear_interpolation(blp_here_on.get_origin(), 1.0f, amount);
630 prev_tangent_scalar=linear_interpolation(blp_here_on.get_origin()-prev.get_origin(), 1.0f, amount);
632 // If we are the next to the end
633 if(end_iter==++std::vector<ListEntry>::const_iterator(iter) || dist_from_end==1)
634 next_tangent_scalar=linear_interpolation(1.0-blp_here_on.get_origin(), 1.0f, amount);
635 else if(list.end()!=++std::vector<ListEntry>::const_iterator(iter))
638 next=((*(++std::vector<ListEntry>::const_iterator(iter))->value_node)(t).get(prev));
639 next_tangent_scalar=linear_interpolation(next.get_origin()-blp_here_on.get_origin(), 1.0f, amount);
642 //! \todo this isn't quite right; we should handle looped blines identically no matter where the loop happens
643 //! and we currently don't. this at least makes it a lot better than it was before
644 next_tangent_scalar=linear_interpolation(blp_next_off.get_origin()-blp_here_on.get_origin(), 1.0f, amount);
645 next_scale=next_tangent_scalar;
647 //blp_here_now.set_vertex(linear_interpolation(blp_here_off.get_vertex(), blp_here_on.get_vertex(), amount));
651 // Point ref_point_begin(((*begin_iter->value_node)(off_time).get(prev).get_vertex() +
652 // (*end_iter->value_node)(off_time).get(prev).get_vertex()) * 0.5);
653 // Point ref_point_end(((*begin_iter->value_node)(on_time).get(prev).get_vertex() +
654 // (*end_iter->value_node)(on_time).get(prev).get_vertex()) * 0.5);
655 // Point ref_point_now(((*begin_iter->value_node)(t).get(prev).get_vertex() +
656 // (*end_iter->value_node)(t).get(prev).get_vertex()) * 0.5);
657 // Point ref_point_linear(linear_interpolation(ref_point_begin, ref_point_end, amount));
659 // blp_here_now.set_vertex(linear_interpolation(blp_here_off.get_vertex(), blp_here_on.get_vertex(), amount) +
660 // (ref_point_now-ref_point_linear));
661 // blp_here_now.set_tangent1(linear_interpolation(blp_here_off.get_tangent1(), blp_here_on.get_tangent1(), amount));
662 // blp_here_now.set_split_tangent_flag(blp_here_on.get_split_tangent_flag());
663 // if(blp_here_now.get_split_tangent_flag())
664 // blp_here_now.set_tangent2(linear_interpolation(blp_here_off.get_tangent2(), blp_here_on.get_tangent2(), amount));
670 // define 3 coordinate systems:
671 Point off_coord_sys[2], off_coord_origin; // when the current vertex is completely off
672 Point on_coord_sys[2] , on_coord_origin; // when the current vertex is completely on
673 Point curr_coord_sys[2], curr_coord_origin; // the current state - somewhere in between
675 // for each of the 3 systems, the origin is half way between the previous and next active point
676 // and the axes are based on a vector from the next active point to the previous
678 const Point end_pos_at_off_time(( *end_iter->value_node)(off_time).get(prev).get_vertex());
679 const Point begin_pos_at_off_time((*begin_iter->value_node)(off_time).get(prev).get_vertex());
680 off_coord_origin=(begin_pos_at_off_time + end_pos_at_off_time)/2;
681 off_coord_sys[0]=(begin_pos_at_off_time - end_pos_at_off_time).norm();
682 off_coord_sys[1]=off_coord_sys[0].perp();
684 const Point end_pos_at_on_time(( *end_iter->value_node)(on_time).get(prev).get_vertex());
685 const Point begin_pos_at_on_time((*begin_iter->value_node)(on_time).get(prev).get_vertex());
686 on_coord_origin=(begin_pos_at_on_time + end_pos_at_on_time)/2;
687 on_coord_sys[0]=(begin_pos_at_on_time - end_pos_at_on_time).norm();
688 on_coord_sys[1]=on_coord_sys[0].perp();
690 const Point end_pos_at_current_time(( *end_iter->value_node)(t).get(prev).get_vertex());
691 const Point begin_pos_at_current_time((*begin_iter->value_node)(t).get(prev).get_vertex());
692 curr_coord_origin=(begin_pos_at_current_time + end_pos_at_current_time)/2;
693 curr_coord_sys[0]=(begin_pos_at_current_time - end_pos_at_current_time).norm();
694 curr_coord_sys[1]=curr_coord_sys[0].perp();
696 // Invert (transpose) the last of these matrices, since we use it for transform back
697 swap(curr_coord_sys[0][1],curr_coord_sys[1][0]);
700 /* The code that was here before used just end_iter as the origin, rather than the mid-point */
702 // We know our location and tangent(s) when fully on and fully off
703 // Transform each of these into their corresponding coordinate system
704 Point trans_on_point, trans_off_point;
705 Vector trans_on_t1, trans_on_t2, trans_off_t1, trans_off_t2;
707 transform_coords(blp_here_on.get_vertex(), trans_on_point, on_coord_origin, on_coord_sys);
708 transform_coords(blp_here_off.get_vertex(), trans_off_point, off_coord_origin, off_coord_sys);
710 #define COORD_SYS_RADIAL_TAN_INTERP 1
712 #ifdef COORD_SYS_RADIAL_TAN_INTERP
713 transform_coords(blp_here_on.get_tangent1(), trans_on_t1, Point::zero(), on_coord_sys);
714 transform_coords(blp_here_off.get_tangent1(), trans_off_t1, Point::zero(), off_coord_sys);
716 if(blp_here_on.get_split_tangent_flag())
718 transform_coords(blp_here_on.get_tangent2(), trans_on_t2, Point::zero(), on_coord_sys);
719 transform_coords(blp_here_off.get_tangent2(), trans_off_t2, Point::zero(), off_coord_sys);
724 // Interpolate between the 'on' point and the 'off' point and untransform to get our point's location
726 untransform_coords(linear_interpolation(trans_off_point, trans_on_point, amount),
727 tmp, curr_coord_origin, curr_coord_sys);
728 blp_here_now.set_vertex(tmp);
731 #define INTERP_FUNCTION radial_interpolation
732 //#define INTERP_FUNCTION linear_interpolation
734 #ifdef COORD_SYS_RADIAL_TAN_INTERP
737 untransform_coords(INTERP_FUNCTION(trans_off_t1,trans_on_t1,amount), tmp, Point::zero(), curr_coord_sys);
738 blp_here_now.set_tangent1(tmp);
741 blp_here_now.set_tangent1(radial_interpolation(blp_here_off.get_tangent1(),blp_here_on.get_tangent1(),amount));
744 if (blp_here_on.get_split_tangent_flag())
746 blp_here_now.set_split_tangent_flag(true);
747 #ifdef COORD_SYS_RADIAL_TAN_INTERP
750 untransform_coords(INTERP_FUNCTION(trans_off_t2,trans_on_t2,amount), tmp, Point::zero(), curr_coord_sys);
751 blp_here_now.set_tangent2(tmp);
754 blp_here_now.set_tangent2(radial_interpolation(blp_here_off.get_tangent2(),blp_here_on.get_tangent2(),amount));
758 blp_here_now.set_split_tangent_flag(false);
761 blp_here_now.set_origin(blp_here_on.get_origin());
762 blp_here_now.set_width(linear_interpolation(blp_here_off.get_width(), blp_here_on.get_width(), amount));
764 // Handle the case where we are the first vertex
767 blp_here_now.set_tangent1(blp_here_now.get_tangent1()*prev_tangent_scalar);
769 first=prev=blp_here_now;
771 ret_list.push_back(blp_here_now);
775 ret_list.back().set_split_tangent_flag(true);
776 ret_list.back().set_tangent2(prev.get_tangent2()*prev_tangent_scalar);
777 ret_list.push_back(blp_here_now);
778 ret_list.back().set_split_tangent_flag(true);
779 //ret_list.back().set_tangent2(blp_here_now.get_tangent1());
780 ret_list.back().set_tangent1(blp_here_now.get_tangent1()*prev_tangent_scalar);
788 ret_list.back().set_split_tangent_flag(true);
789 ret_list.back().set_tangent2(prev.get_tangent2()*next_scale);
793 if(get_loop() && !first_flag)
807 synfig::warning(string("ValueNode_BLine::operator()():")+_("No entries in list"));
810 synfig::warning(string("ValueNode_BLine::operator()():")+_("No entries in ret_list"));
812 return ValueBase(ret_list,get_loop());
816 ValueNode_BLine::link_local_name(int i)const
818 assert(i>=0 && (unsigned)i<list.size());
819 return etl::strprintf(_("Vertex %03d"),i+1);
823 ValueNode_BLine::get_name()const
829 ValueNode_BLine::get_local_name()const
835 ValueNode_BLine::create_new()const
837 return new ValueNode_BLine();
841 ValueNode_BLine::check_type(ValueBase::Type type)
843 return type==ValueBase::TYPE_LIST;