Changeset 10924:b5b1c0b30806 in orange for source/orangeqt/networkcurve.cpp
 Timestamp:
 06/17/12 15:28:32 (22 months ago)
 Branch:
 default
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

source/orangeqt/networkcurve.cpp
r10923 r10924 592 592 } 593 593 594 void NetworkCurve::scale_axes() 595 { 596 QRectF r2 = QRectF(plot()>contentsRect()); 597 r2.adjust(1, 1, 1, 1); 598 double t = r2.top(); 599 r2.setTop(r2.bottom()); 600 r2.setBottom(t); 601 602 QPair< int, int > axes_; 603 axes_ = axes(); 604 QRectF r1 = plot()>data_rect_for_axes(axes_.first, axes_.second); 605 606 double dx = r1.width() / 20.0; 607 double dy = r1.height() / 20.0; 608 r1.adjust(dx, dy, dx, dy); 609 610 QTransform tr1 = QTransform().translate(r1.left(), r1.top()); 611 QTransform ts = QTransform().scale(r2.width()/r1.width(), r2.height()/r1.height()); 612 QTransform tr2 = QTransform().translate(r2.left(), r2.top()); 613 set_graph_transform(tr1 * ts * tr2); 614 } 615 594 616 int NetworkCurve::random() 595 617 { … … 657 679 fi = fi  step; 658 680 } 659 //register_points(); 681 660 682 return 0; 661 683 } … … 822 844 vertices.clear(); 823 845 qvertices.clear(); 824 825 //register_points(); 826 846 827 847 return 0; 828 848 } … … 891 911 //clock_t refresh_time = clock() + 0.05 * CLOCKS_PER_SEC; 892 912 Plot *p = plot(); 893 bool animation_enabled = p>animate_points;894 p>animate_points = false;913 //bool animation_enabled = p>animate_points; 914 //p>animate_points = false; 895 915 896 916 QTime refresh_time = QTime::currentTime(); … … 986 1006 if (before_refresh_time > refresh_time && i % 2 == 0) 987 1007 { 988 QRectF r2 = QRectF(plot()>contentsRect()); 989 r2.adjust(1, 1, 1, 1); 990 double t = r2.top(); 991 r2.setTop(r2.bottom()); 992 r2.setBottom(t); 993 994 QPair< int, int > axes_; 995 axes_ = axes(); 996 QRectF r1 = plot()>data_rect_for_axes(axes_.first, axes_.second); 997 998 double dx = r1.width() / 20.0; 999 double dy = r1.height() / 20.0; 1000 r1.adjust(dx, dy, dx, dy); 1001 1002 QTransform tr1 = QTransform().translate(r1.left(), r1.top()); 1003 QTransform ts = QTransform().scale(r2.width()/r1.width(), r2.height()/r1.height()); 1004 QTransform tr2 = QTransform().translate(r2.left(), r2.top()); 1005 set_graph_transform(tr1 * ts * tr2); 1006 1008 scale_axes(); 1007 1009 update_properties(); 1008 1010 QCoreApplication::processEvents(); 1009 1011 int refresh_duration = before_refresh_time.msecsTo(QTime::currentTime()); 1010 1011 1012 refresh_time = before_refresh_time.addMSecs(qMax(refresh_duration * 3, 10)); 1012 1013 } … … 1025 1026 } 1026 1027 1027 p>animate_points = animation_enabled; 1028 //register_points(); 1028 //p>animate_points = animation_enabled; 1029 1029 return 0; 1030 1030 } … … 1041 1041 m_labels = labels; 1042 1042 //Q_ASSERT(m_labels.uniqueKeys() == m_labels.keys()); 1043 //register_points();1044 1043 } 1045 1044 … … 1061 1060 m_labels.unite(labels); 1062 1061 Q_ASSERT(m_labels.uniqueKeys() == m_labels.keys()); 1063 //register_points();1064 1062 } 1065 1063 … … 1091 1089 remove_label(i); 1092 1090 } 1093 1094 1091 } 1095 1092
Note: See TracChangeset
for help on using the changeset viewer.