当前位置: 首页>>代码示例>>Python>>正文


Python Annotation.__init__方法代码示例

本文整理汇总了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()
开发者ID:loserpenguin15,项目名称:UCSBsketch,代码行数:9,代码来源:RaceTrackObserver.py

示例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)
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:28,代码来源:TuringMachineObserver.py

示例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
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:10,代码来源:ArrowObserver.py

示例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
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:11,代码来源:ExpressionObserver.py

示例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']
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:12,代码来源:RubineObserver.py

示例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
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:15,代码来源:TextObserver.py

示例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 = {}
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:23,代码来源:DiGraphObserver.py

示例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
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:6,代码来源:MultObserver.py

示例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
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:8,代码来源:EquationObserver.py

示例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 = []
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:7,代码来源:ChartObserver.py

示例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
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:8,代码来源:LineObserver.py

示例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]
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:8,代码来源:BinObserver.py

示例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
开发者ID:jbrowne,项目名称:UCSBsketch,代码行数:5,代码来源:MultiStrokeFeatureObserver.py

示例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
开发者ID:loserpenguin15,项目名称:UCSBsketch,代码行数:7,代码来源:CircleObserver.py

示例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
开发者ID:ASayre,项目名称:UCSBsketch,代码行数:6,代码来源:TemplateObserver.py


注:本文中的SketchFramework.Annotation.Annotation.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。