Changeset 8523:d037ca777555 in orange


Ignore:
Timestamp:
07/29/11 09:39:03 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
1799c08f4ef21d4556ce581f4a5f787bfedd43cc
Message:

Make selection work with NetworkCurve and add more plot updates during selection and optimization.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/plot/owplot.py

    r8522 r8523  
    850850    def add_selection(self, reg): 
    851851        self.select_points(reg, self.selection_behavior) 
     852        self.viewport().update() 
    852853        if self.auto_send_selection_callback: 
    853854            self.auto_send_selection_callback() 
  • source/orangeplot/networkcurve.cpp

    r8520 r8523  
    452452            update_properties(); 
    453453            QCoreApplication::processEvents(); 
     454            Plot* p = plot(); 
     455            if (p) 
     456            { 
     457                p->set_dirty(); 
     458                p->replot(); 
     459            } 
    454460        } 
    455461 
     
    687693    { 
    688694        p->remove_all_points(this); 
    689         const Data d = data(); 
    690         const int n = d.size(); 
    691         for (int i = 0; i < n; ++i) 
     695        foreach (NodeItem* node, m_nodes) 
    692696        { 
    693             p->add_point(d[i], m_nodes[i], this); 
     697            DataPoint d; 
     698            d.x = node->x(); 
     699            d.y = node->y(); 
     700            p->add_point(d, node, this); 
    694701        } 
    695702    } 
  • source/orangeplot/networkcurve.h

    r8520 r8523  
    1111{ 
    1212public: 
     13    enum {Type = Point::Type + 1}; 
    1314    NodeItem(int index, int symbol, QColor color, int size, QGraphicsItem* parent = 0); 
    1415    virtual ~NodeItem(); 
    1516 
    1617    virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); 
    17  
     18    virtual int type() const {return Type;} 
     19     
    1820    void set_coordinates(double x, double y); 
    1921 
  • source/orangeplot/plot.cpp

    r8521 r8523  
    3434    foreach (QGraphicsItem* item, scene->items(area, Qt::IntersectsItemBoundingRect)) 
    3535    { 
    36         Point* point = qgraphicsitem_cast<Point*>(item); 
     36        Point* point = dynamic_cast<Point*>(item); 
    3737        if (point) 
    3838        { 
Note: See TracChangeset for help on using the changeset viewer.