Changeset 8544:250cd2a1ecec in orange


Ignore:
Timestamp:
07/31/11 00:28:34 (3 years ago)
Author:
matejd <matejd@…>
Branch:
default
Convert:
d1c541061aec9f2a330d023b56e35a0695ce9502
Message:

Work on Radviz3d

Location:
orange/OrangeWidgets/Prototypes
Files:
2 edited

Legend:

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

    r8543 r8544  
    66 
    77from plot.owplot3d import * 
     8from plot.owprimitives3d import get_symbol_data 
    89from plot.owplotgui import OWPlotGUI 
    910from OWLinProjQt import * 
     
    2324        self.gui = OWPlotGUI(self) 
    2425 
     26        self.sphere_data = get_symbol_data(Symbol.CIRCLE) 
     27        self.show_axes = self.show_chassis = self.show_grid = False 
     28 
    2529    def setData(self, data, subsetData=None, **args): 
    2630        orngScaleLinProjData.setData(self, data, subsetData, **args) 
     31 
     32    def updateGraph(self, attrList=None, setAnchors=0, insideColors=None, **args): 
     33        pass 
     34 
     35    def draw_callback(self): 
     36        glDisable(GL_DEPTH_TEST) 
     37        glDisable(GL_BLEND) 
     38        glColor4f(1,0,0,1) 
     39 
     40        glScalef(5, 5, 5) 
     41        glBegin(GL_TRIANGLES) 
     42        for v0, v1, v2, n0, n1, n2 in self.sphere_data: 
     43            glVertex3f(*v0) 
     44            glVertex3f(*v1) 
     45            glVertex3f(*v2) 
     46        glEnd() 
    2747 
    2848    def setCanvasColor(self, c): 
     
    3050 
    3151    def updateData(self, labels=None, setAnchors=0, **args): 
    32         pass 
     52        self.commands.append(('custom', self.draw_callback)) 
     53        self.updateGL() 
    3354 
    3455    def getSelectionsAsExampleTables(self, attrList, useAnchorData=1, addProjectedPositions=0): 
    3556        return (None, None) 
    3657 
     58    def removeAllSelections(self): 
     59        pass 
     60 
    3761    def replot(self): 
    3862        pass 
     63 
     64    # TODO: catch mouseEvents 
    3965 
    4066class OWRadviz3D(OWLinProjQt): 
  • orange/OrangeWidgets/Prototypes/OWRadvizQt.py

    r8387 r8544  
    3535    ow.show() 
    3636    #data = orange.ExampleTable(r"e:\Development\Orange Datasets\UCI\wine.tab") 
    37     data = orange.ExampleTable(r"e:\Development\Orange Datasets\UCI\iris.tab") 
     37    data = orange.ExampleTable('../../doc/datasets/iris') 
    3838    ow.setData(data) 
    3939    ow.handleNewSignals() 
Note: See TracChangeset for help on using the changeset viewer.