本文整理汇总了Python中SketchFramework.Annotation.Annotation.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Annotation.__init__方法的具体用法?Python Annotation.__init__怎么用?Python Annotation.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SketchFramework.Annotation.Annotation
的用法示例。
在下文中一共展示了Annotation.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, rightwalls = [], leftwalls = []):
Annotation.__init__(self)
self.rightwalls = rightwalls # A list of strokes making up the right walls of the track
self.leftwalls = leftwalls #A list of strokes making up the left walls
self.centerline = None #Stroke for the centerline
self.rebuildCenterline()
示例2: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, state_graph_anno = None, edge_labels = set([])):
Annotation.__init__(self)
tm_logger.debug("Creating new turing machine")
#Which state we are currently in
self.active_state = None
#Where on the tape we are currently residing
self.tape_idx = -1
#What is currently on the tape
self.tape_string = []
#What edge brought us here
self.leading_edge = {'edge': None, 'label' : None} #edge ArrowAnno, label TextAnno
self.tape_text_anno = None
self.tape_box = None
#A dictionary mapping edges to their labels.
self.edge2labels_map = {}
self.labels2edge_map = {}
for l in edge_labels:
self.assocLabel2Edge(l, None)
#A DiGraphAnnotation that keeps track of all of the edges and nodes and their connections
self.state_graph_anno = None
self.setDiGraphAnno(state_graph_anno)
示例3: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, tip, tail, headstroke = None, tailstroke = None, direction = 'tail2head', linearity=0):
Annotation.__init__(self)
self.tip = tip # Point
self.tail = tail # Point
self.linearity = linearity
self.headstroke = headstroke
self.tailstroke = tailstroke
self.direction = direction # 'tail2head' vs. 'head2tail' for the direction the tail stroke was drawn in
示例4: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, scale):
"Create a Text annotation. text is the string, and scale is an appropriate size"
Annotation.__init__(self)
self.scale = scale # an approximate "size" for the text
self.number = None
self.parent = None
self.left = None
self.right = None
self.op = None
示例5: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, scores):
"Create a Rubin annotation."
Annotation.__init__(self)
#self.type = type # Deprecated
#self.accuracy = accuracy Deprecated
#self.scale = scale # Deprecated
self.scores = scores
self.name = ""
if len(self.scores) > 0:
self.name = scores[0]['symbol']
示例6: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, text, alternates, stroke_letter_map, scale):
"""Create a Text annotation. text is the string, stroke_letter_map bins
strokes according to the letter they're associated with,
e.g. "Hi" : [ [<strokes for 'H'>], [<strokes for 'i'>] ].
scale is an appropriate size
alternates is a tuple (indexed by letter) of a list of that letter's alternates"""
Annotation.__init__(self)
self.text = text # a string for the text
assert len(stroke_letter_map) == len(text)
self.letter2strokesMap = stroke_letter_map
assert scale > 0.0
self.scale = scale # an approximate "size" for the text
self.alternates = alternates #([],) * len(text) # a tuple (indexed per letter) of lists of alternate letters
示例7: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, node_set=None, edge_set=None):
Annotation.__init__(self)
# DiGraph annotations maintain 3 things:
# 1) a list of the nodes (which points to the circle_annos)
# 2) a list of the edges (which points to the arrow_annos)
# 3) a connectivity map (which is of the form { node_anno: [ (edge_anno, node_anno), (edge_anno, node_anno) ]}
# set of circle annotations for nodes
if node_set is None:
self.node_set = set([])
else:
self.node_set = node_set
# set of arrow annotations for edges
if edge_set is None:
self.edge_set = set([])
else:
self.edge_set = edge_set
# set the map of connections
self.connectMap = {}
示例8: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, scale):
"Create a Text annotation. text is the string, and scale is an appropriate size"
Annotation.__init__(self)
self.scale = scale # an approximate "size" for the text
示例9: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, scale, type, number = 0):
"Create a Text annotation. text is the string, and scale is an appropriate size"
Annotation.__init__(self)
self.scale = scale # an approximate "size" for the text
self.type = type
self.number = number
示例10: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, horizArrow, vertArrow):
Annotation.__init__(self)
self.horizontalArrow = horizArrow
self.verticalArrow = vertArrow
self.equations = []
示例11: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, linearity, angle, start_point, end_point ):
Annotation.__init__(self)
self.linearity = linearity
self.angle = angle
self.start_point = start_point
self.end_point = end_point
示例12: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, text, scale):
"Create a Bin annotation. text is the string, and scale is an appropriate size"
Annotation.__init__(self)
self.text = text # a string for the text
self.scale = scale # an approximate "size" for the text
self.alternates = [text]
示例13: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, tag):
Annotation.__init__(self)
self.name = tag
示例14: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, circ, cen, avgDist):
Annotation.__init__(self)
self.circularity = circ # float
self.center = cen # Point
self.radius = avgDist # float
示例15: __init__
# 需要导入模块: from SketchFramework.Annotation import Annotation [as 别名]
# 或者: from SketchFramework.Annotation.Annotation import __init__ [as 别名]
def __init__(self, tag, template):
Annotation.__init__(self)
self.template = template
self.name = tag