示例#1
0
                'Load Shapefile').sigActivated.connect(self.load)

        self.no_shapefiles += 1

    def load(self):
        fn = str(
            pg.QtGui.QFileDialog.getOpenFileName(self.qtwidget,
                                                 "Load Shapefile", "",
                                                 "Shapefile (*.shp)"))
        self.param('Shapefile').param('Shapefile Loaded').setValue(fn)

        if fn == '':
            return


pTypes.registerParameterType('ShapefileGroup', ShapefileGroup)


class XMLNamespaces:
    xsi = "http://www.w3.org/2001/XMLSchema-instance"
    trans = "http://www.opengis.net/citygml/transportation/1.0"
    wtr = "http://www.opengis.net/citygml/waterbody/1.0"
    gml = "http://www.opengis.net/gml"
    smil20lang = "http://www.w3.org/2001/SMIL20/Language"
    xlink = "http://www.w3.org/1999/xlink"
    grp = "http://www.opengis.net/citygml/cityobjectgroup/1.0"
    luse = "http://www.opengis.net/citygml/landuse/1.0"
    frn = "http://www.opengis.net/citygml/cityfurniture/1.0"
    app = "http://www.opengis.net/citygml/appearance/1.0"
    tex = "http://www.opengis.net/citygml/texturedsurface/1.0"
    smil20 = "http://www.w3.org/2001/SMIL20/"
示例#2
0
        self.restoreState(kwds, removeChildren=False)
            
    def buildClocks(self):
        x0 = self['Initial Position']
        y0 = self['Vertical Position']
        color = self['Color']
        m = self['Rest Mass']
        size = self['Size']
        prog = self.param('Acceleration').generate()
        c = Clock(x0=x0, m0=m, y0=y0, color=color, prog=prog, size=size)
        return {self.name(): c}
        
    def clockNames(self):
        return [self.name()]

pTypes.registerParameterType('Clock', ClockParam)
    
class GridParam(pTypes.GroupParameter):
    def __init__(self, **kwds):
        defs = dict(name="Grid", autoIncrementName=True, renamable=True, removable=True, children=[
            dict(name='Number of Clocks', type='int', value=5, limits=[1, None]),
            dict(name='Spacing', type='float', value=1.0, step=0.1),
            ClockParam(name='ClockTemplate'),
            ])
        #defs.update(kwds)
        pTypes.GroupParameter.__init__(self, **defs)
        self.restoreState(kwds, removeChildren=False)
            
    def buildClocks(self):
        clocks = {}
        template = self.param('ClockTemplate')
        self.restoreState(kwds, removeChildren=False)
            
    def buildClocks(self):
        x0 = self['Initial Position']
        y0 = self['Vertical Position']
        color = self['Color']
        m = self['Rest Mass']
        size = self['Size']
        prog = self.param('Acceleration').generate()
        c = Clock(x0=x0, m0=m, y0=y0, color=color, prog=prog, size=size)
        return {self.name(): c}
        
    def clockNames(self):
        return [self.name()]

pTypes.registerParameterType('Clock', ClockParam)
    
class GridParam(pTypes.GroupParameter):
    def __init__(self, **kwds):
        defs = dict(name="Grid", autoIncrementName=True, renamable=True, removable=True, children=[
            dict(name='Number of Clocks', type='int', value=5, limits=[1, None]),
            dict(name='Spacing', type='float', value=1.0, step=0.1),
            ClockParam(name='ClockTemplate'),
            ])
        #defs.update(kwds)
        pTypes.GroupParameter.__init__(self, **defs)
        self.restoreState(kwds, removeChildren=False)
            
    def buildClocks(self):
        clocks = {}
        template = self.param('ClockTemplate')