@@ -29,9 +29,10 @@ def getSpineDistance(self, segmentID: SegmentId,
2929 minProjection = segment .project (point )
3030 return minProjection
3131
32+ # abb added findBrightest=False, do not find brightest by default
3233 def nearestAnchor (self , segmentID : SegmentId ,
3334 point : Point ,
34- findBrightest = False ):
35+ findBrightest : bool = False ):
3536 """Finds the nearest anchor point on a given line segment to a given point.
3637
3738 Args:
@@ -48,12 +49,12 @@ def nearestAnchor(self, segmentID: SegmentId,
4849 minProjection = segment .project (point )
4950
5051 if np .isnan (minProjection ):
51- logger .info (f'minProjection:{ minProjection } ' )
52- logger .info (f'segment:{ segment } ' )
53- logger .info (f'point:{ point } ' )
52+ logger .warning (f'minProjection:{ minProjection } ' )
53+ logger .warning (f'segment:{ segment } ' )
54+ logger .warning (f'point:{ point } ' )
5455
5556 if not findBrightest :
56- # Default to the closest path
57+ # Default to the closest point (not brightest)
5758 anchor = segment .interpolate (minProjection )
5859 anchor = roundPoint (anchor , 1 )
5960 return anchor
@@ -140,8 +141,6 @@ def addSpine(self, segmentId: SpineId, x: int, y: int, z: int) -> Union[SpineId,
140141 anchorZ = int (anchor .z ),
141142 xBackgroundOffset = 0.0 ,
142143 yBackgroundOffset = 0.0 ,
143- # abb
144- # spineDistance = spineDistance
145144 ))
146145
147146 self .snapBackgroundOffset (spineId )
@@ -196,19 +195,13 @@ def moveAnchor(self, spineId: SpineId,
196195 """
197196 segmentId = self .points [spineId , "segmentID" ]
198197
198+ # abb
199199 # when moving, do not find brightest
200200 anchor = self .nearestAnchor (segmentId , Point (x , y , z ))
201201
202- logger .info (f'segmentId:{ segmentId } anchor:{ anchor } ' )
203-
204- # abb, now handled dynamically with laze
205- # _point = self.points[spineId, "point"]
206- # spineDistance = self.getSpineDistance(segmentId, _point)
207-
208202 self .updateSpine (spineId , Spine (
209203 anchorZ = int (anchor .z ),
210204 anchor = Point (anchor .x , anchor .y ),
211- # spineDistance=spineDistance,
212205 ), state != DragState .START and state != DragState .MANUAL )
213206
214207 return True
0 commit comments