Exemple #1
0
 def collectionFromItem( self, strokes, annotation ):
     text_anno = None # text_anno will be the return value
     if annotation.isType( CircleObserver.CircleAnnotation ):
         circle = annotation
         text_anno = TextAnnotation("0",circle.radius*2)
     if annotation.isType( LineObserver.LineAnnotation ):
         line = annotation
         # if the line is up/down then it is a one
         if GeomUtils.angleParallel( line.angle, 90 ) > 0.6:
             line_length = GeomUtils.pointDist( line.start_point, line.end_point )
             text_anno = TextAnnotation("1",line_length)
     return text_anno