Exemple #1
0
    def onStrokeAdded( self, stroke ):
        "Watches for Strokes with Circularity > threshold to Annotate"
        # need at least 6 points to be a line
        if stroke.length()<6:
            return

        linearity = GeomUtils.strokeLinearity( stroke )
        angle = GeomUtils.strokeOrientation( stroke )
        
        if( linearity > self.threshold ):
            lanno = LineAnnotation( linearity, angle, stroke.Points[0], stroke.Points[-1] )
            self.getBoard().AnnotateStrokes( [stroke], lanno )