當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。