Changeset 8656:3c44c299e169 in orange


Ignore:
Timestamp:
08/11/11 07:26:27 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
a413e7045066fc5a3827694f3e1e7eb72cebb5cb
Message:

A faster method to return selected points when using only one curve.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Prototypes/OWScatterPlotGraphQt.py

    r8643 r8656  
    504504            self.potentialsImageFromClassifier = self.potentialsClassifier 
    505505 
    506  
    507     def drawCanvas(self, painter): 
    508         if self.showProbabilities and getattr(self, "potentialsClassifier", None): 
    509             if not (self.potentialsClassifier is getattr(self,"potentialsImageFromClassifier", None)): 
    510                 self.computePotentials() 
    511             target = QRectF(self.transform(xBottom, self.xmin), self.transform(yLeft, self.ymax), 
    512                             self.transform(xBottom, self.xmax) - self.transform(xBottom,self.xmin), 
    513                             self.transform(yLeft, self.ymin) - self.transform(yLeft, self.ymax)) 
    514             source = QRectF(0, 0, self.potentialsImage.size().width(), self.potentialsImage.size().height()) 
    515             painter.drawImage(target, self.potentialsImage, source) 
    516 #            painter.drawImage(self.transform(xBottom, self.xmin), self.transform(yLeft, self.ymax), self.potentialsImage) 
    517         OWPlot.drawCanvas(self, painter) 
    518  
    519  
    520  
    521  
    522506if __name__== "__main__": 
    523507    #Draw a simple graph 
  • orange/OrangeWidgets/Prototypes/OWScatterPlotQt.py

    r8633 r8656  
    144144        OWGUI.checkBox(box, self, 'autoSendSelection', 'Adding/Removing selection areas', callback = self.selectionChanged, tooltip = "Send selected data whenever a selection area is added or removed") 
    145145        OWGUI.checkBox(box, self, 'graph.sendSelectionOnUpdate', 'Moving/Resizing selection areas', tooltip = "Send selected data when a user moves or resizes an existing selection area") 
    146         self.graph.autoSendSelectionCallback = self.selectionChanged 
     146        self.graph.selection_changed.connect(self.selectionChanged) 
    147147 
    148148        self.GeneralTab.layout().addStretch(100) 
  • orange/OrangeWidgets/plot/owplot.py

    r8655 r8656  
    11031103         
    11041104    def get_selected_points(self, xData, yData, validData): 
    1105         selected = [] 
    1106         unselected = [] 
    1107         for i in self.selected_points(xData, yData): 
    1108             selected.append(i) 
    1109             unselected.append(not i) 
     1105        if self.main_curve: 
     1106            selected = [point.is_selected() for point in self.main_curve.points()] 
     1107        else: 
     1108            selected = self.selected_points(xData, yData) 
     1109        unselected = [not i for i in selected] 
    11101110        return selected, unselected 
    11111111         
  • source/orangeplot/curve.sip

    r8613 r8656  
    9393   
    9494  void set_dirty(Curve::UpdateFlags flags = Curve::UpdateAll); 
     95 
     96  void set_points(const QList<Point*>& points); 
     97  QList<Point*> points(); 
    9598   
    9699protected: 
Note: See TracChangeset for help on using the changeset viewer.