예제 #1
0
def rayDebug(position, ray):
    d = DebugData()
    d.addLine(position, position + ray * 5.0)
    drcView = app.getViewManager().findView('DRC View')
    obj = vis.updatePolyData(d.getPolyData(),
                             'camera ray',
                             view=drcView,
                             color=[0, 1, 0])
    obj.actor.GetProperty().SetLineWidth(2)
예제 #2
0
def init(poseCollection, costCollection):

    global _spreadsheetView
    _spreadsheetView = app.getViewManager().createView('Spreadsheet View', 'Spreadsheet View')

    updateMethod = functools.partial(updateSpreadsheetPoses, poseCollection)
    poseCollection.connect('itemChanged(const QString&)', updateMethod)
    poseCollection.connect('itemAdded(const QString&)', updateMethod)
    poseCollection.connect('itemRemoved(const QString&)', updateMethod)

    initSpreadsheetColumns(costCollection)
    updateMethod()
예제 #3
0
def init(poseCollection, costCollection):

    global _spreadsheetView
    _spreadsheetView = app.getViewManager().createView('Spreadsheet View',
                                                       'Spreadsheet View')

    updateMethod = functools.partial(updateSpreadsheetPoses, poseCollection)
    poseCollection.connect('itemChanged(const QString&)', updateMethod)
    poseCollection.connect('itemAdded(const QString&)', updateMethod)
    poseCollection.connect('itemRemoved(const QString&)', updateMethod)

    initSpreadsheetColumns(costCollection)
    updateMethod()
예제 #4
0
    def initView(self, view):
        self.view = view or app.getViewManager().createView(self.viewName, 'VTK View')
        self.view.installImageInteractor()
        self.interactorStyle = self.view.renderWindow().GetInteractor().GetInteractorStyle()
        self.interactorStyle.AddObserver('SelectionChangedEvent', self.onRubberBandPick)

        self.imageActor = vtk.vtkImageActor()
        self.imageActor.SetInput(self.getImage())
        self.imageActor.SetVisibility(False)
        self.view.renderer().AddActor(self.imageActor)

        self.timerCallback = TimerCallback()
        self.timerCallback.targetFps = 60
        self.timerCallback.callback = self.updateView
        self.timerCallback.start()
예제 #5
0
    def initView(self, view):
        self.view = view or app.getViewManager().createView(
            self.viewName, 'VTK View')
        self.view.installImageInteractor()
        self.interactorStyle = self.view.renderWindow().GetInteractor(
        ).GetInteractorStyle()
        self.interactorStyle.AddObserver('SelectionChangedEvent',
                                         self.onRubberBandPick)

        self.imageActor = vtk.vtkImageActor()
        self.imageActor.SetInput(self.getImage())
        self.imageActor.SetVisibility(False)
        self.view.renderer().AddActor(self.imageActor)

        self.timerCallback = TimerCallback()
        self.timerCallback.targetFps = 60
        self.timerCallback.callback = self.updateView
        self.timerCallback.start()
예제 #6
0
    def initView(self, view):

        self.view = view or app.getViewManager().createView('Camera View', 'VTK View')

        self.renderers = [self.view.renderer()]
        renWin = self.view.renderWindow()
        renWin.SetNumberOfLayers(3)
        for i in [1, 2]:
            ren = vtk.vtkRenderer()
            ren.SetLayer(2)
            ren.SetActiveCamera(self.view.camera())
            renWin.AddRenderer(ren)
            self.renderers.append(ren)

        def applyCustomBounds():
            self.view.addCustomBounds([-100, 100, -100, 100, -100, 100])
        self.view.connect('computeBoundsRequest(ddQVTKWidgetView*)', applyCustomBounds)

        app.setCameraTerrainModeEnabled(self.view, True)
        self.resetCamera()
예제 #7
0
    def initView(self, view):

        self.view = view or app.getViewManager().createView(
            'Camera View', 'VTK View')

        self.renderers = [self.view.renderer()]
        renWin = self.view.renderWindow()
        renWin.SetNumberOfLayers(3)
        for i in [1, 2]:
            ren = vtk.vtkRenderer()
            ren.SetLayer(2)
            ren.SetActiveCamera(self.view.camera())
            renWin.AddRenderer(ren)
            self.renderers.append(ren)

        def applyCustomBounds():
            self.view.addCustomBounds([-100, 100, -100, 100, -100, 100])

        self.view.connect('computeBoundsRequest(ddQVTKWidgetView*)',
                          applyCustomBounds)

        app.setCameraTerrainModeEnabled(self.view, True)
        self.resetCamera()
예제 #8
0
def rayDebug(position, ray):
    d = DebugData()
    d.addLine(position, position+ray*5.0)
    drcView = app.getViewManager().findView('DRC View')
    obj = vis.updatePolyData(d.getPolyData(), 'camera ray', view=drcView, color=[0,1,0])
    obj.actor.GetProperty().SetLineWidth(2)