コード例 #1
0
 def sourceParams(self):
     return [
         whoville.AnyWhoParameter('source', tip="Microstructure or Image")
     ]
コード例 #2
0
ファイル: layereditor.py プロジェクト: creuzige/OOF2
def displayedObjectCB(menuitem, category, object):
    openLayerEditor()
    layerEditor.displayedObjectCB(category, object)


layermenu.addItem(
    OOFMenuItem('DisplayedObject',
                callback=displayedObjectCB,
                params=[
                    whoville.WhoClassParameter(
                        'category',
                        condition=whoville.noSecretClasses,
                        tip='What type of object is being displayed.'),
                    whoville.AnyWhoParameter(
                        'object',
                        tip='The name of the object being displayed.')
                ],
                help="Change what's being displayed by a LayerSet.",
                discussion=xmlmenudump.loadFile(
                    'DISCUSSIONS/common/menu/displayedobject.xml')))


def addMethodCB(menuitem, method):
    openLayerEditor()
    layerEditor.addMethodCB(method)


layermenu.addItem(
    OOFMenuItem('Add_Method',
                callback=addMethodCB,
コード例 #3
0
def invert(selection):
    selection.start()
    selection.invert()


def clear(selection):
    selection.start()
    selection.clear()


for i, func in enumerate((undo, redo, invert, clear)):
    selectmenu.addItem(
        oofmenu.OOFMenuItem(func.__name__.capitalize(),
                            params=[
                                whoville.AnyWhoParameter(
                                    'microstructure',
                                    tip=parameter.emptyTipString)
                            ],
                            callback=SimpleVoxelSelectionCB(func),
                            ordering=0.1 * i))

# Menu item for complex voxel selection operations.  This one *does*
# call PixelSelectionContext.start(), so the subclasses should not
# call it.


def select(menuitem, source, method):
    # source is the name of a Microstructure or Image.  Get the object.
    whopath = labeltree.makePath(source)
    if len(whopath) == 1:
        ms = whoville.getClass('Microstructure')[whopath]