本文整理匯總了Python中Point.Point.set_reference_point方法的典型用法代碼示例。如果您正苦於以下問題:Python Point.set_reference_point方法的具體用法?Python Point.set_reference_point怎麽用?Python Point.set_reference_point使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Point.Point
的用法示例。
在下文中一共展示了Point.set_reference_point方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: do_parse_vessel_file
# 需要導入模塊: from Point import Point [as 別名]
# 或者: from Point.Point import set_reference_point [as 別名]
def do_parse_vessel_file(self):
# print "ok"
start = time.time()
with open(self.filePath, "r+b") as f:
# memory-mapInput the file, size 0 means whole file
map_input = mmap.mmap(f.fileno(), 0)
# read content via standard file methods
for s in iter(map_input.readline, ""):
s = s.translate(None, "\r\n")
# print s
a_line_of_values = s.split(" ")
# print a_line_of_values
point = Point()
if len(a_line_of_values) == 5:
point.set_reference_point(float(a_line_of_values[0]), float(a_line_of_values[1]),
float(a_line_of_values[2]), float(a_line_of_values[3]),
float(a_line_of_values[4]))
# print point.get_x()
elif len(a_line_of_values) == 3:
point.set_centerline_point(float(a_line_of_values[0]), float(a_line_of_values[1]),
float(a_line_of_values[2]))
# print point.get_x()
self.vesselValues.append(point)
map_input.close()
end = time.time()
print "Time for completion", end - start