Changeset 9047:5be832ede0d2 in orange


Ignore:
Timestamp:
09/30/11 21:23:11 (3 years ago)
Author:
matejd <matejd@…>
Branch:
default
Convert:
3ea966958a5abbf18780ec7e8918b03c554c2a4e
Message:

More work on netexplorer3d, still crashes, but predictably

Location:
orange/OrangeWidgets/Visualize Qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Visualize Qt/OWNxCanvas3D.py

    r9045 r9047  
    11from plot.owplot3d import OWPlot3D 
    2 from PyQt4 import Qt 
     2from PyQt4.QtCore import Qt 
    33import orangeqt 
    44import Orange 
     
    2929            self.set_label(label) 
    3030 
    31 class OWNxCanvas3D(OWPlot3D, orangeqt.Canvas3D): 
     31class OWNxCanvas3D(orangeqt.Canvas3D): 
    3232    def __init__(self, master, parent=None, name='None'): 
    33         OWPlot3D.__init__(self, parent) 
    3433        orangeqt.Canvas3D.__init__(self, parent) 
     34 
     35        self.plot = OWPlot3D(self) 
     36        self.plot.replot = self.plot.update 
     37        self.gui = self.plot.gui 
     38        self.saveToFile = self.plot.save_to_file 
    3539 
    3640        # A little workaround, since NetExplorer sometimes calls networkCurve directly 
    3741        self.networkCurve = self 
    3842 
    39         self.Node3D = orangeqt.Node3D 
     43        self.Node3D = Node3D 
    4044        self.replot = self.update 
    41         self.animate_plot = False 
    42         self.animate_points = False 
    43         self.antialias_plot = False 
    44         self.auto_adjust_performance = False 
     45        self.plot.animate_plot = False 
     46        self.plot.animate_points = False 
     47        self.plot.antialias_plot = False 
     48        self.plot.auto_adjust_performance = False 
    4549 
    4650        self.master = master 
     
    7680        self.title_margin = 0 
    7781        self.graph_margin = 1 
     82        import rpdb2; rpdb2.start_embedded_debugger('pass') 
    7883 
    7984    def update_canvas(self): 
     
    360365 
    361366    def set_graph(self, graph, curve=None, items=None, links=None): 
    362         self.clear() # TODO which one? 
     367        #self.clear() # TODO which one? 
    363368 
    364369        if graph is None: 
     
    383388 
    384389        vertices = dict((v, self.Node3D(v)) for v in self.graph) 
    385         self.set_nodes(vertices) 
     390        orangeqt.Canvas3D.set_nodes(self, vertices) 
    386391 
    387392        self.edge_to_row = {} 
     
    418423 
    419424        self.set_edges(edges) 
    420         self.update_properties() 
     425        #self.update_properties() 
    421426        self.update()   
    422427 
     
    700705        return 0 
    701706 
    702     #def update(self): 
     707    def update(self): 
    703708        #self.set_dirty() 
    704         #OWPlot.update(self) 
    705         #if hasattr(self, 'networkCurve') and self.networkCurve is not None: 
    706             #self.networkCurve.update() 
     709        self.plot.update() 
  • orange/OrangeWidgets/Visualize Qt/OWNxExplorer3D.py

    r9045 r9047  
    99from OWNxExplorerQt import OWNxExplorerQt 
    1010from OWNxCanvas3D import OWNxCanvas3D 
     11import Orange 
     12 
     13from OWNxCanvasQt import Default, AttributeList 
    1114 
    1215class OWNxExplorer3D(OWNxExplorerQt): 
     
    1417        OWNxExplorerQt.__init__(self, parent, signalManager, name, network_canvas) 
    1518 
     19        self.inputs = [("Nx View", Orange.network.NxView, self.set_network_view), 
     20                       ("Network", Orange.network.Graph, self.set_graph, Default), 
     21                       ("Items", Orange.data.Table, self.setItems), 
     22                       ("Items to Mark", Orange.data.Table, self.markItems),  
     23                       ("Items Subset", Orange.data.Table, self.setExampleSubset),  
     24                       ("Items Distance Matrix", Orange.core.SymMatrix, self.set_items_distance_matrix)] 
     25         
     26        self.outputs = [("Selected Network", Orange.network.Graph), 
     27                        ("Selected Items Distance Matrix", Orange.core.SymMatrix), 
     28                        ("Selected Items", Orange.data.Table),  
     29                        ("Unselected Items", Orange.data.Table),  
     30                        ("Marked Items", Orange.data.Table), 
     31                        ("Attribute Selection List", AttributeList)] 
     32 
     33 
Note: See TracChangeset for help on using the changeset viewer.