本文整理汇总了Python中freestyle.utils.ContextFunctions.get_time_stamp方法的典型用法代码示例。如果您正苦于以下问题:Python ContextFunctions.get_time_stamp方法的具体用法?Python ContextFunctions.get_time_stamp怎么用?Python ContextFunctions.get_time_stamp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类freestyle.utils.ContextFunctions
的用法示例。
在下文中一共展示了ContextFunctions.get_time_stamp方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: traverse
# 需要导入模块: from freestyle.utils import ContextFunctions [as 别名]
# 或者: from freestyle.utils.ContextFunctions import get_time_stamp [as 别名]
def traverse(self, iter):
winner = None
winnerOrientation = False
#print(self.current_edge.id.first, self.current_edge.id.second)
it = AdjacencyIterator(iter)
tvertex = self.next_vertex
if type(tvertex) is TVertex:
mateVE = tvertex.get_mate(self.current_edge)
while not it.is_end:
ve = it.object
if ve.id == mateVE.id:
winner = ve
winnerOrientation = not it.is_incoming
break
it.increment()
else:
## case of NonTVertex
natures = [Nature.SILHOUETTE,Nature.BORDER,Nature.CREASE,Nature.MATERIAL_BOUNDARY,Nature.EDGE_MARK,
Nature.SUGGESTIVE_CONTOUR,Nature.VALLEY,Nature.RIDGE]
for nat in natures:
if (self.current_edge.nature & nat) != 0:
count=0
while not it.is_end:
ve = it.object
if (ve.nature & nat) != 0:
count = count+1
winner = ve
winnerOrientation = not it.is_incoming
it.increment()
if count != 1:
winner = None
break
if winner is not None:
# check whether this edge was part of the selection
if winner.time_stamp != CF.get_time_stamp():
#print("---", winner.id.first, winner.id.second)
# nw let's compute the length of this connex non selected part:
connexl = 0
_cit = pyChainSilhouetteGenericIterator(False, False)
_cit.begin = winner
_cit.current_edge = winner
_cit.orientation = winnerOrientation
_cit.init()
while _cit.is_end == 0 and _cit.object.time_stamp != CF.get_time_stamp():
ve = _cit.object
#print("-------- --------", ve.id.first, ve.id.second)
connexl = connexl + ve.length_2d
_cit.increment()
if connexl > self._length:
winner = None
return winner
示例2: traverse
# 需要导入模块: from freestyle.utils import ContextFunctions [as 别名]
# 或者: from freestyle.utils.ContextFunctions import get_time_stamp [as 别名]
def traverse(self, iter):
winner = None
winnerOrientation = False
it = AdjacencyIterator(iter)
## case of TVertex
vertex = self.next_vertex
if type(vertex) is TVertex:
mate = vertex.get_mate(self.current_edge)
winner = find_matching_vertex(mate.id, it)
winnerOrientation = not it.is_incoming if not it.is_end else False
## case of NonTVertex
else:
for nat in NATURES:
if (self.current_edge.nature & nat):
for ve in it:
if (ve.nature & nat):
if winner is not None:
return None
winner = ve
winnerOrientation = not it.is_incoming
break
if winner is not None and winner.time_stamp != CF.get_time_stamp():
if self._length == 0.0:
self._length = get_chain_length(winner, winnerOrientation)
connexl = 0.0
_cit = pyChainSilhouetteGenericIterator(False, False)
_cit.begin = winner
_cit.current_edge = winner
_cit.orientation = winnerOrientation
_cit.init()
while (not _cit.is_end) and _cit.object.time_stamp != CF.get_time_stamp():
connexl += _cit.object.length_2d
_cit.increment()
if _cit.is_begin:
break
if (connexl > self._percent * self._length) or (connexl > self._absLength):
return None
return winner
示例3: traverse
# 需要导入模块: from freestyle.utils import ContextFunctions [as 别名]
# 或者: from freestyle.utils.ContextFunctions import get_time_stamp [as 别名]
def traverse(self, iter):
winner = None
self._nEdges += 1
it = AdjacencyIterator(iter)
time_stamp = CF.get_time_stamp()
for ve in it:
if self.ExternalContour(ve) and ve.time_stamp == time_stamp:
winner = ve
if winner is None:
it = AdjacencyIterator(iter)
for ve in it:
if self.checkViewEdge(ve, not it.is_incoming):
winner = ve
return winner
示例4: __init__
# 需要导入模块: from freestyle.utils import ContextFunctions [as 别名]
# 或者: from freestyle.utils.ContextFunctions import get_time_stamp [as 别名]
def __init__(self, length):
ChainingIterator.__init__(self, False, True, None, True)
self._length = float(length)
self.timestamp = CF.get_time_stamp()
示例5: init
# 需要导入模块: from freestyle.utils import ContextFunctions [as 别名]
# 或者: from freestyle.utils.ContextFunctions import get_time_stamp [as 别名]
def init(self):
self._timeStamp = CF.get_time_stamp() + self._nRounds