Changeset 8617:6e881a7a97e6 in orange


Ignore:
Timestamp:
08/05/11 15:03:11 (3 years ago)
Author:
Noughmad <Noughmad@…>
Branch:
default
Convert:
2e7ef84d992958a8d526ac2d00ca43286ecf5423
Message:

Prevent ULC from calling the Curve class' implementation of update_properties.

Also, fix the CircleCurve and its transparency in LinProj.

Files:
4 edited

Legend:

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

    r8613 r8617  
    110110        if self.showAnchors: 
    111111            if self.hideRadius > 0: 
    112                 circle = CircleCurve(QColor(200,200,200), QColor(200,200,200), radius = hideRadius) 
     112                circle = CircleCurve(QColor(200,200,200), QColor(200,200,200), radius = self.hideRadius) 
     113                circle.ignore_alpha = True 
    113114                self.add_custom_curve(circle) 
    114115                self._extra_curves.append(circle) 
     
    133134                XAnchors = [a[0] for a in shownAnchorData] 
    134135                YAnchors = [a[1] for a in shownAnchorData] 
    135                 self._extra_curves.append(self.addCurve("dots", QColor(160,160,160), QColor(160,160,160), 10, style = Qt.NoPen, symbol = OWPoint.Ellipse, xData = XAnchors, yData = YAnchors, showFilledSymbols = 1)) 
     136                c = self.addCurve("dots", QColor(160,160,160), QColor(160,160,160), 10, style = Qt.NoPen, symbol = OWPoint.Ellipse, xData = XAnchors, yData = YAnchors, showFilledSymbols = 1) 
     137                c.ignore_alpha = True 
     138                self._extra_curves.append(c) 
    136139 
    137140                # draw text at anchors 
     
    143146            # draw "circle" 
    144147            circle = CircleCurve() 
     148            circle.ignore_alpha = True 
    145149            self.add_custom_curve(circle) 
    146150            self._extra_curves.append(circle) 
  • orange/OrangeWidgets/plot/owplot.py

    r8616 r8617  
    168168        self.point_width = 5 
    169169        self.show_filled_symbols = True 
    170         self.alpha_value = 1 
     170        self.alpha_value = 255 
    171171        self.show_grid = False 
    172172         
     
    424424             
    425425    def setShowAxisTitle(self, axis_id, b): 
    426         qDebug(('Showing' if b else 'Hiding') + ' axis title for ' + ('good' if axis_id in self.axes else 'bad') + ' axis ' + str(axis_id)) 
    427         qDebug(repr(b)) 
    428426        if axis_id in self.axes: 
    429427            if b == -1: 
     
    543541    def add_marker(self, name, x, y, alignment = -1, bold = 0, color = None, brushColor = None, size=None, antiAlias = None,  
    544542                    x_axis_key = xBottom, y_axis_key = yLeft): 
    545         qDebug('Adding marker %s at pas %f,%f' % (name,x,y)) 
    546543        m = Marker(name, x, y, alignment, bold, color, brushColor) 
    547544        self._marker_items.append((m, x, y, x_axis_key, y_axis_key)) 
     
    559556            Axes and the grid are not removed 
    560557        ''' 
    561         qDebug(' == OWPlot.clear() == ') 
    562558        for i in self.plot_items(): 
    563559            if i is not self.grid_curve: 
     
    11661162    def update_curves(self): 
    11671163        for c in self.plot_items(): 
    1168             if isinstance(c, orangeplot.Curve): 
     1164            if isinstance(c, orangeplot.Curve) and not getattr(c, 'ignore_alpha', False): 
    11691165                au = c.auto_update() 
    11701166                c.set_auto_update(False) 
  • orange/OrangeWidgets/plot/owtools.py

    r8612 r8617  
    3535''' 
    3636 
    37 from PyQt4.QtGui import QGraphicsItem, QGraphicsRectItem, QPolygonF, QGraphicsPolygonItem, QPen, QBrush 
     37from PyQt4.QtGui import QGraphicsItem, QGraphicsRectItem, QPolygonF, QGraphicsPolygonItem, QGraphicsEllipseItem, QPen, QBrush 
    3838from PyQt4.QtCore import Qt, QRectF, QPointF, qDebug, QPropertyAnimation 
    3939 
     
    193193class UnconnectedLinesCurve(orangeplot.UnconnectedLinesCurve): 
    194194    def __init__(self, name, pen = QPen(Qt.black), xData = None, yData = None): 
    195         qDebug('Creting an ULC') 
    196195        orangeplot.UnconnectedLinesCurve.__init__(self, xData, yData) 
    197196        if pen: 
     
    202201    def __init__(self, pen = QPen(Qt.black), brush = QBrush(Qt.NoBrush), xCenter = 0.0, yCenter = 0.0, radius = 1.0): 
    203202        OWCurve.__init__(self) 
    204         self.set_pen(pen) 
    205         self.set_brush(brush) 
    206203        self._item = QGraphicsEllipseItem(self) 
    207204        self.center = xCenter, yCenter 
    208205        self.radius = radius 
    209206        self._rect = QRectF(xCenter-radius, yCenter-radius, 2*radius, 2*radius) 
     207        self.set_pen(pen) 
     208        self.set_brush(brush) 
    210209         
    211210    def update_properties(self): 
  • source/orangeplot/unconnectedlinescurve.cpp

    r8597 r8617  
    33#include <QtCore/QDebug> 
    44 
    5 UnconnectedLinesCurve::UnconnectedLinesCurve(const QList< double >& x_data, const QList< double >& y_data, QGraphicsItem* parent, QGraphicsScene* scene): Curve(x_data, y_data, parent, scene) 
     5UnconnectedLinesCurve::UnconnectedLinesCurve(const QList< double >& x_data, const QList< double >& y_data, QGraphicsItem* parent, QGraphicsScene* scene): Curve(parent, scene) 
    66{ 
    77    m_path_item = new QGraphicsPathItem(this); 
     8    set_data(x_data, y_data); 
    89} 
    910 
     
    1516void UnconnectedLinesCurve::update_properties() 
    1617{ 
     18    cancelAllUpdates(); 
    1719    if (needs_update() & UpdatePosition) 
    1820    { 
Note: See TracChangeset for help on using the changeset viewer.