本文整理汇总了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
示例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]))
示例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)
示例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)
示例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))
示例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