Changeset 10873:21992f764537 in orange


Ignore:
Timestamp:
05/14/12 10:00:15 (2 years ago)
Author:
mstajdohar
Branch:
default
rebase_source:
a12e566ccd58eed06ce7a9feed14c7872a575531
Message:

Added graph clustering feature.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Unsupervised/OWNxCanvasQt.py

    r10854 r10873  
    618618        old_nodes = set(self.graph.nodes_iter()) 
    619619        new_nodes = set(newgraph.nodes_iter()) 
    620         inter_nodes = old_nodes.intersection(new_nodes) 
    621         remove_nodes = list(old_nodes.difference(inter_nodes)) 
    622         add_nodes = list(new_nodes.difference(inter_nodes)) 
     620        inter_nodes = old_nodes & new_nodes 
     621        remove_nodes = list(old_nodes - inter_nodes) 
     622        add_nodes = list(new_nodes - inter_nodes) 
    623623 
    624624        self.graph = newgraph 
  • Orange/OrangeWidgets/Unsupervised/OWNxClustering.py

    r10872 r10873  
    5757                     callback=lambda b=True: self.cluster(b)) 
    5858 
     59        self.cluster() 
     60 
    5961    def setNetwork(self, net): 
    6062        self.net = net 
  • source/orangeqt/networkcurve.cpp

    r10872 r10873  
    5656        int _size = size() + 5; 
    5757 
    58         painter->setPen(QPen(QBrush(color()), 1, Qt::SolidLine, Qt::RoundCap)); 
     58        int pen_size = (representative) ? 3 : 1; 
     59        painter->setPen(QPen(QBrush(color()), pen_size, Qt::SolidLine, Qt::RoundCap)); 
    5960 
    6061        QRadialGradient gradient(QPointF(0, 0), _size); 
     
    112113} 
    113114 
    114 ModelItem::set_representative(bool value) 
     115void ModelItem::set_representative(bool value) 
    115116{ 
    116117    representative = value; 
    117118} 
    118119 
    119 ModelItem::is_representative() 
     120bool ModelItem::is_representative() const 
    120121{ 
    121122    return representative; 
  • source/orangeqt/networkcurve.sip

    r10872 r10873  
    3535    void set_image(QPixmap* im); 
    3636}; 
    37  
     37     
    3838class ModelItem : NodeItem 
    3939{ 
     
    4242    virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); 
    4343     
    44     void set_representative(double y); 
    45     bool representative() const; 
     44    void set_representative(double y = true); 
     45    bool is_representative() const; 
    4646}; 
    4747 
Note: See TracChangeset for help on using the changeset viewer.