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


Python Polygon.setDataStyle方法代码示例

本文整理汇总了Python中Polygon.setDataStyle方法的典型用法代码示例。如果您正苦于以下问题:Python Polygon.setDataStyle方法的具体用法?Python Polygon.setDataStyle怎么用?Python Polygon.setDataStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Polygon的用法示例。


在下文中一共展示了Polygon.setDataStyle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: getOverLapArea

# 需要导入模块: import Polygon [as 别名]
# 或者: from Polygon import setDataStyle [as 别名]
def getOverLapArea(A,B,startA,endA,startB,endB,TB):
    Bt=getTransformedFragment(B,TB)
    Polygon.setDataStyle(Polygon.STYLE_NUMPY)
    b_poly = Polygon.Polygon(Bt.points[0])
    a_poly = Polygon.Polygon(A.points[0])

    intersection_polygon=b_poly&a_poly

    area =  intersection_polygon.area()

    return area
开发者ID:HemachandraKolisetty,项目名称:OpenSoft14,代码行数:13,代码来源:area.py

示例2: testInit

# 需要导入模块: import Polygon [as 别名]
# 或者: from Polygon import setDataStyle [as 别名]
 def testInit(self):
     Polygon.setDataStyle(Polygon.STYLE_TUPLE)
     # tuple
     p = Polygon.Polygon(self.cont)
     self.assertEqual(p[0], tuple(self.cont))
     # list
     p = Polygon.Polygon(self.cont)
     self.assertEqual(p[0], tuple(self.cont))
     if Polygon.withNumPy:
         import numpy
         a = numpy.array(self.cont)
         p = Polygon.Polygon(a)
         self.assertEqual(self.cont, list(p[0]))
开发者ID:guitorri,项目名称:Polygon2,代码行数:15,代码来源:Test.py

示例3: testInit

# 需要导入模块: import Polygon [as 别名]
# 或者: from Polygon import setDataStyle [as 别名]
 def testInit(self):
     Polygon.setDataStyle(Polygon.STYLE_TUPLE)
     # tuple
     p = Polygon.Polygon(self.cont)
     self.assertEqual(p[0], self.cont)
     # list
     p = Polygon.Polygon(list(self.cont))
     self.assertEqual(p[0], self.cont)
     if Polygon.withNumeric:
         # array
         import Numeric
         p = Polygon.Polygon(Numeric.array(self.cont))
         self.assertEqual(p[0], self.cont)
开发者ID:Germanc,项目名称:supreme,代码行数:15,代码来源:PolygonTest.py

示例4: testDataStyle

# 需要导入模块: import Polygon [as 别名]
# 或者: from Polygon import setDataStyle [as 别名]
 def testDataStyle(self):
     p = Polygon.Polygon(self.cont)
     # tuple
     Polygon.setDataStyle(Polygon.STYLE_TUPLE)
     self.assertEqual(p[0], tuple(self.cont))
     # list
     Polygon.setDataStyle(Polygon.STYLE_LIST)
     self.assertEqual(p[0], self.cont)
     if Polygon.withNumPy:
         import numpy
         Polygon.setDataStyle(Polygon.STYLE_NUMPY)
         self.assertEqual(type(p[0]), numpy.ndarray)
开发者ID:guitorri,项目名称:Polygon2,代码行数:14,代码来源:Test.py

示例5: testDataStyle

# 需要导入模块: import Polygon [as 别名]
# 或者: from Polygon import setDataStyle [as 别名]
 def testDataStyle(self):
     p = Polygon.Polygon(self.cont)
     # tuple
     Polygon.setDataStyle(Polygon.STYLE_TUPLE)
     self.assertEqual(p[0], self.cont)
     # list
     Polygon.setDataStyle(Polygon.STYLE_LIST)
     self.assertEqual(p[0], list(self.cont))
     if Polygon.withNumeric:
         # array
         import Numeric
         Polygon.setDataStyle(Polygon.STYLE_ARRAY)
         self.assertEqual(p[0], Numeric.array(self.cont))
开发者ID:Germanc,项目名称:supreme,代码行数:15,代码来源:PolygonTest.py

示例6: GetOverLappingArea

# 需要导入模块: import Polygon [as 别名]
# 或者: from Polygon import setDataStyle [as 别名]
def GetOverLappingArea(Matchset1,Matchset2):
    A=Matchset1.fragment_1
    B_start=Matchset1.match_2_start
    B_end=Matchset1.match_2_end
    C_start=Matchset2.match_2_start
    C_end=Matchset2.match_2_end
    A_start=Matchset1.match_1_start
    A_end=Matchset1.match_1_end
    B=Matchset1.fragment_2
    C=Matchset2.fragment_2
    a_start=0
    a_end=0
    if Matchset1.fragment_1==Matchset2.fragment_1:
        B=Matchset1.fragment_2
        B_start=Matchset1.match_2_start
        B_end=Matchset1.match_2_end
        C=Matchset2.fragment_2
        C_start=Matchset2.match_2_start
        C_end=Matchset2.match_2_end
        A=Matchset1.fragment_1
        A_start=Matchset1.match_1_start
        A_end=Matchset1.match_1_end
        a_start=Matchset2.match_1_start
        a_end=Matchset2.match_1_end
    if Matchset1.fragment_2==Matchset2.fragment_1:
        B=Matchset1.fragment_1
        B_start=Matchset1.match_1_start
        B_end=Matchset1.match_1_end
        C=Matchset2.fragment_2
        C_start=Matchset2.match_2_start
        C_end=Matchset2.match_2_end
        A=Matchset1.fragment_2
        A_start=Matchset1.match_2_start
        A_end=Matchset1.match_2_end
        a_start=Matchset2.match_1_start
        a_end=Matchset2.match_1_end
    if Matchset1.fragment_1==Matchset2.fragment_2:
        B=Matchset1.fragment_2
        B_start=Matchset1.match_2_start
        B_end=Matchset1.match_2_end
        C=Matchset2.fragment_1
        C_start=Matchset2.match_1_start
        C_end=Matchset2.match_1_end
        A=Matchset1.fragment_1
        A_start=Matchset1.match_1_start
        A_end=Matchset1.match_1_end
        a_start=Matchset2.match_2_start
        a_end=Matchset2.match_2_end
    if Matchset1.fragment_2==Matchset2.fragment_2:
        B=Matchset1.fragment_1
        B_start=Matchset1.match_1_start
        B_end=Matchset1.match_1_end
        C=Matchset2.fragment_1
        C_start=Matchset2.match_1_start
        C_end=Matchset2.match_1_end
        A=Matchset1.fragment_2
        A_start=Matchset1.match_2_start
        A_end=Matchset1.match_2_end
        a_start=Matchset2.match_2_start
        a_end=Matchset2.match_2_end
    # waitForESC()
    cv2.destroyAllWindows()
    TB=getTransformationMatirxFromFragment(A.points[0],B.points[0],A_start,A_end,B_start,B_end,1)
    # waitForESC()
    if(TB == None):
        return 0
    # print "\nTEMP ******************\n"
    # Ttemp=getTransformationMatirxFromFragment(A.points[0],B.points[0],A_start,A_end,B_start,B_end,1)
    # print "Ttemp"
    # print Ttemp
    # waitForESC()
    # print "\nTC ******************\n"
    TC=getTransformationMatirxFromFragment(A.points[0],C.points[0],a_start,a_end,C_start,C_end,1)
    # waitForESC()
    if(TC == None):
        return 0
    print "\n******************\n"
    # if(TB is None):
    #     # **************** srini 
    #     # test here

    # if(TC is None):
    #     # **************** srini 
    #     # test here

    
    

    Bt=getTransformedFragment(B,TB)
    Ct=getTransformedFragment(C,TC)
    Polygon.setDataStyle(Polygon.STYLE_NUMPY)
    b_poly = Polygon.Polygon(Bt.points[0])
    c_poly = Polygon.Polygon(Ct.points[0])

    intersection_polygon=b_poly&c_poly

    area =  intersection_polygon.area()

    return area
开发者ID:HemachandraKolisetty,项目名称:OpenSoft14,代码行数:101,代码来源:area.py


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