Esempio n. 1
0
    def __init__(self, view, _robotSystem):
        self.view = view
        self.viewBehaviors = viewbehaviors.ViewBehaviors(view)
        self.robotViewBehaviors = RobotViewEventFilter(self, view)
        self.robotName = _robotSystem.robotName

        self.robotSystem = _robotSystem
        self.robotModel = self.robotSystem.robotStateModel
        if app.getMainWindow() is not None:
            self.robotLinkSelector = RobotLinkSelector()

        viewbehaviors.registerContextMenuActions(self.getRobotActions)
Esempio n. 2
0
            ('Segment Ground', onSegmentGround),
            ('Segment Table', onSegmentTableScene),
            ('Segment Drill Aligned', onSegmentDrillAlignedWithTable),
            ('Local Plane Fit', onLocalPlaneFit),
            ('Orient with Horizontal', onOrientToMajorPlane),
            ('Arrow Glyph', onArrowGlyph),
            ('Disk Glyph', onDiskGlyph),
            ('Cache Pick Point', onCachePickedPoint),
            (None, None),
            ('Open Segmentation Editor', onSegmentationEditor)
            ])

    return actions


viewbehaviors.registerContextMenuActions(getRobotActions)


class RobotViewEventFilter(ViewEventFilter):

    def onMouseWheel(self, event):
        if neckDriver:
            neckDriver.onWheelDelta(event.delta())

    def onMouseMove(self, event):

        for picker in segmentation.viewPickers:
            if not picker.enabled:
                continue

            picker.onMouseMove(self.getMousePositionInView(event), event.modifiers())
                        ('Merge Pointcloud Into', onMergeIntoPointCloud),
                        ('Segment Ground', onSegmentGround),
                        ('Segment Table', onSegmentTableScene),
                        ('Segment Drill Aligned',
                         onSegmentDrillAlignedWithTable),
                        ('Local Plane Fit', onLocalPlaneFit),
                        ('Orient with Horizontal', onOrientToMajorPlane),
                        ('Arrow Glyph', onArrowGlyph),
                        ('Disk Glyph', onDiskGlyph),
                        ('Cache Pick Point', onCachePickedPoint), (None, None),
                        ('Open Segmentation Editor', onSegmentationEditor)])

    return actions


viewbehaviors.registerContextMenuActions(getRobotActions)


class RobotViewEventFilter(ViewEventFilter):
    def onMouseWheel(self, event):
        if neckDriver:
            neckDriver.onWheelDelta(event.delta())

    def onMouseMove(self, event):

        for picker in segmentation.viewPickers:
            if not picker.enabled:
                continue

            picker.onMouseMove(self.getMousePositionInView(event),
                               event.modifiers())
Esempio n. 4
0
    global affordanceToAdd
    affordanceToAdd = pickedObj

    def onSelectAffordanceParent():
        objectPicker.start()

    actions = [
      (None, None),
      ('Select parent...', onSelectAffordanceParent),
      ]

    return actions


viewbehaviors.registerContextMenuActions(getAffordanceContextMenuActions)


app = mainwindowapp.construct()
view = app.view


affordanceManager = affordancemanager.AffordanceObjectModelManager(view)

if affordancemanager.lcmobjectcollection.USE_LCM:
    affordanceitems.MeshAffordanceItem.getMeshManager().collection.sendEchoRequest()
    affordanceManager.collection.sendEchoRequest()

objectPicker = pointpicker.ObjectPicker(view=view, callback=onAffordancePick, getObjectsFunction=affordanceManager.getAffordances)

def registerActions():
    viewbehaviors.registerContextMenuActions(getActions)
    global affordanceToAdd
    affordanceToAdd = pickedObj

    def onSelectAffordanceParent():
        objectPicker.start()

    actions = [
      (None, None),
      ('Select parent...', onSelectAffordanceParent),
      ]

    return actions


viewbehaviors.registerContextMenuActions(getAffordanceContextMenuActions)


app = mainwindowapp.construct()
view = app.view


affordanceManager = affordancemanager.AffordanceObjectModelManager(view)

if affordancemanager.lcmobjectcollection.USE_LCM:
    affordanceitems.MeshAffordanceItem.getMeshManager().collection.sendEchoRequest()
    affordanceManager.collection.sendEchoRequest()

objectPicker = pointpicker.ObjectPicker(view=view, callback=onAffordancePick, getObjectsFunction=affordanceManager.getAffordances)

def registerActions():
    viewbehaviors.registerContextMenuActions(getActions)