[Lemon-commits] [lemon_svn] hegyi: r2107 - hugo/trunk/gui
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:50:12 CET 2006
Author: hegyi
Date: Thu Jul 28 19:06:13 2005
New Revision: 2107
Modified:
hugo/trunk/gui/broken_edge.cc
Log:
Tooltip should be turn up on CreateNode tool.
Modified: hugo/trunk/gui/broken_edge.cc
==============================================================================
--- hugo/trunk/gui/broken_edge.cc (original)
+++ hugo/trunk/gui/broken_edge.cc Thu Jul 28 19:06:13 2005
@@ -45,17 +45,18 @@
{
//arrow keeps its position-left button
- // if(p.size()==2)
- // {
- // Gnome::Canvas::Points points;
- // my_points[0]=p[0];
- // my_points[2]=p[1];
- // for(int i=0;i<3;i++)
- // {
- // points.push_back(my_points[i]);
- // }
- // property_points().set_value(points);
- // }
+ if(p.size()==2)
+ {
+ Gnome::Canvas::Points points;
+ my_points[0]=p[0];
+ my_points[2]=p[1];
+ for(int i=0;i<3;i++)
+ {
+ points.push_back(my_points[i]);
+ }
+ property_points().set_value(points);
+ }
+ set_arrow=true;
//////////////////////////////////////////////////////////////////////////////////////////////////////
/////////// kepps shape-with angles
@@ -184,54 +185,54 @@
/////////// kepps shape-with scalar multiplication
//////////////////////////////////////////////////////////////////////////////////////////////////////
- if(p.size()==2)
- {
- //old vector from one to the other node - a
- xy<double> a_v(my_points[2].get_x()-my_points[0].get_x(),my_points[2].get_y()-my_points[0].get_y());
- //new vector from one to the other node - b
- xy<double> b_v(p[1].get_x()-p[0].get_x(),p[1].get_y()-p[0].get_y());
-
- //old vector from one node to the breakpoint - c
- xy<double> c_v(my_points[1].get_x()-my_points[0].get_x(),my_points[1].get_y()-my_points[0].get_y());
-
- //new vector from one node to the breakpoint - d - we have to calculate this one
- xy<double> d_v;
-
- //scalar product of a and b (old and new vector from first point to the other)
- double sab=a_v*b_v;
- //scalar product of c and d (old and new vector from first point to breakpoint)
- double scd=sab*c_v.normSquare()/a_v.normSquare();
-
- std::cout<<" a " << a_v<<" b " <<b_v<<" c " <<c_v<<" sab " <<sab<<" scd "<<scd<<std::endl;
-
- double a=c_v.normSquare();
- double b=2*scd*c_v.y;
- double c=scd*scd-b_v.normSquare()/a_v.normSquare()*c_v.normSquare()*c_v.x*c_v.x;
-
- std::cout<<" a " << a<<" b " <<b<<" c " <<c<<std::endl;
-
- d_v.y=(-b-sqrt(b*b-4*a*c))/2/a;
-
- if(c_v.x!=0)
- {
- d_v.x=(scd-c_v.y*d_v.y)/c_v.x;
- }
- else
- {
- d_v.x=my_points[1].get_x();
- }
-
- std::cout<<" d " << d_v<<std::endl;
-
- my_points[1]=Gnome::Art::Point(d_v.x+p[0].get_x(),d_v.y+p[0].get_y());
-
- Gnome::Canvas::Points points;
- for(int i=0;i<3;i++)
- {
- points.push_back(my_points[i]);
- }
- property_points().set_value(points);
- }
+// if(p.size()==2)
+// {
+// //old vector from one to the other node - a
+// xy<double> a_v(my_points[2].get_x()-my_points[0].get_x(),my_points[2].get_y()-my_points[0].get_y());
+// //new vector from one to the other node - b
+// xy<double> b_v(p[1].get_x()-p[0].get_x(),p[1].get_y()-p[0].get_y());
+
+// //old vector from one node to the breakpoint - c
+// xy<double> c_v(my_points[1].get_x()-my_points[0].get_x(),my_points[1].get_y()-my_points[0].get_y());
+
+// //new vector from one node to the breakpoint - d - we have to calculate this one
+// xy<double> d_v;
+
+// //scalar product of a and b (old and new vector from first point to the other)
+// double sab=a_v*b_v;
+// //scalar product of c and d (old and new vector from first point to breakpoint)
+// double scd=sab*c_v.normSquare()/a_v.normSquare();
+
+// std::cout<<" a " << a_v<<" b " <<b_v<<" c " <<c_v<<" sab " <<sab<<" scd "<<scd<<std::endl;
+
+// double a=c_v.normSquare();
+// double b=2*scd*c_v.y;
+// double c=scd*scd-b_v.normSquare()/a_v.normSquare()*c_v.normSquare()*c_v.x*c_v.x;
+
+// std::cout<<" a " << a<<" b " <<b<<" c " <<c<<std::endl;
+
+// d_v.y=(-b-sqrt(b*b-4*a*c))/2/a;
+
+// if(c_v.x!=0)
+// {
+// d_v.x=(scd-c_v.y*d_v.y)/c_v.x;
+// }
+// else
+// {
+// d_v.x=my_points[1].get_x();
+// }
+
+// std::cout<<" d " << d_v<<std::endl;
+
+// my_points[1]=Gnome::Art::Point(d_v.x+p[0].get_x(),d_v.y+p[0].get_y());
+
+// Gnome::Canvas::Points points;
+// for(int i=0;i<3;i++)
+// {
+// points.push_back(my_points[i]);
+// }
+// property_points().set_value(points);
+// }
}
if(set_arrow)
{
More information about the Lemon-commits
mailing list