Exemplo n.º 1
0
 def showPredictions(self,g):
     ''' show predictions '''
     result=g.mu
     #d=self.getView().getDrawing()
     # predictions
     self.lanmarkFigures=[]
     self.predictionFigures=pyHCompositeFigure()
     d=self.predictionFigures
     i=0
     x=result.value[2*i][0]
     y=result.value[2*i+1][0]
     fs=pyHLandMarkPredictionFigure(x-0.5,y-0.5,5,5,i)
     fs.setColor(255,0,0)
     d.addFigure(fs)
     # motion prediction
     for i in range(1,N):
         x=result.value[2*i][0]
         y=result.value[2*i+1][0]
         fe=pyHNodePosePredictionFigure(x-0.5,y-0.5,5,5,i)
         fe.setColor(255,0,0)
         d.addFigure(fe)
         cf=pyHConnectionFigure()
         cf.setColor(255,0,0,100)
         cf.connectFigures(fs, fe)
         d.addFigure(cf)
         fs=fe
     # landmark prediction
     for i in range(num_landmarks):
         x=result.value[2*(N+i)][0]
         y=result.value[2*(N+i)+1][0]
         f=pyHLandMarkPredictionFigure(x-0.5,y-0.5,2,2,i)
         f.setColor(0,0,255)
         d.addFigure(f)
     self.getView().getDrawing().addFigure(d)
Exemplo n.º 2
0
    def _create_variables_handles(self):
        width_margin = 20
        height_margin_between_figures = 5
        w = 80
        h_cte = 30
        figures = []
        for var_name in self._variables.keys():
            representation_figure = pyHRectangleRoundedFigure(
                0, h_cte + height_margin_between_figures, w, h_cte)
            text_figure = MathTextFigure(0,
                                         0,
                                         var_name,
                                         12,
                                         non_math_text=True)
            text_figure.move(representation_figure.w / 2 - text_figure.w / 2,
                             -20)
            composite_figure = pyHCompositeFigure()
            composite_figure.addFigure(representation_figure)
            composite_figure.addFigure(text_figure)
            self._set_style_handles_of_variables(composite_figure)
            figures.append(composite_figure)

        occupied_space = len(self._variables) * w + \
                      width_margin * (len(self._variables) - 1)

        x = self.getX() + ((self.getWidth() - occupied_space) / 2)
        y = self.getY() - 100
        handles = []
        for fig in figures:
            fig.move(x, y)
            new_handdle = VariableHandle(self, fig)
            handles.append(new_handdle)
            x += w + width_margin
        return handles
 def selectionGroup(self):
     v=self.getView()
     selectedFigures=v.getSelectedFigures()
     g=pyHCompositeFigure()
     for f in selectedFigures:
         g.addFigure(f)
     for f in g.getFigures():
         v.getDrawing().removeFigure(f)
         selectedFigures.remove(f)
     if g.getFigures():
         v.selectFigure(g)
         v.getDrawing().addFigure(g)
Exemplo n.º 4
0
 def selectionGroup(self):
     v = self.getView()
     selectedFigures = v.getSelectedFigures()
     g = pyHCompositeFigure()
     for f in selectedFigures:
         g.addFigure(f)
     for f in g.getFigures():
         v.getDrawing().removeFigure(f)
         selectedFigures.remove(f)
     if g.getFigures():
         v.selectFigure(g)
         v.getDrawing().addFigure(g)
Exemplo n.º 5
0
 def clearSelectedFigures(self):
     self.selectedFigures = pyHCompositeFigure()
 def clearSelectedFigures(self):
     self.selectedFigures=pyHCompositeFigure()