@@ -308,7 +308,12 @@ def getIDinfo(self, event):
308308 # check that the position is in the axes view
309309 if 0 <= yPos < self .model .currentView .v_res \
310310 and 0 <= xPos and xPos < self .model .currentView .h_res :
311- id = self .model .ids [yPos , xPos ]
311+ cell_id = int (self .model .cell_ids [yPos , xPos ])
312+ mat_id = int (self .model .mat_ids [yPos , xPos ])
313+ if cell_id < _OVERLAP :
314+ id = cell_id
315+ else :
316+ id = cell_id if self .model .currentView .colorby == 'cell' else mat_id
312317 instance = self .model .instances [yPos , xPos ]
313318 temp = "{:g}" .format (self .model .property_data [yPos , xPos , 0 ])
314319 density = "{:g}" .format (self .model .property_data [yPos , xPos , 1 ])
@@ -336,6 +341,26 @@ def getIDinfo(self, event):
336341
337342 return id , instance , properties , domain , domain_kind
338343
344+ def _cellLabel (self , cell_id ):
345+ try :
346+ name = self .model .activeView .cells [cell_id ].name
347+ except KeyError :
348+ name = None
349+ return f"{ cell_id } ({ name } )" if name else str (cell_id )
350+
351+ def _overlapInfo (self , id ):
352+ if id == _OVERLAP :
353+ return "OVERLAP"
354+
355+ overlap_idx = int (_OVERLAP - int (id ) - 1 )
356+ if not 0 <= overlap_idx < len (self .model .overlap_info ):
357+ return "OVERLAP (unknown region)"
358+
359+ universe , cell1 , cell2 = self .model .overlap_info [overlap_idx ]
360+ label1 = self ._cellLabel (cell1 )
361+ label2 = self ._cellLabel (cell2 )
362+ return f"OVERLAP: Universe { universe } , Cells { label1 } and { label2 } "
363+
339364 def mouseDoubleClickEvent (self , event ):
340365 xCenter , yCenter = self .getPlotCoords (event .pos ())
341366 self .main_window .editPlotOrigin (xCenter , yCenter , apply = True )
@@ -354,7 +379,6 @@ def mouseMoveEvent(self, event):
354379 tallyInfo = ""
355380
356381 if self .parent .underMouse ():
357-
358382 if domain_kind .lower () in _MODEL_PROPERTIES :
359383 line_val = float (properties [domain_kind .lower ()])
360384 line_val = max (line_val , 0.0 )
@@ -370,8 +394,8 @@ def mouseMoveEvent(self, event):
370394 instanceInfo = ""
371395 if id == _VOID_REGION :
372396 domainInfo = ("VOID" )
373- elif id = = _OVERLAP :
374- domainInfo = ( "OVERLAP" )
397+ elif id < = _OVERLAP :
398+ domainInfo = self . _overlapInfo ( id )
375399 elif id != _NOT_FOUND and domain [id ].name :
376400 domainInfo = ("{} {}{}: \" {}\" \t Density: {} g/cc\t "
377401 "Temperature: {} K" .format (
@@ -483,8 +507,9 @@ def contextMenuEvent(self, event):
483507 self .menu .addAction (self .main_window .redoAction )
484508 self .menu .addSeparator ()
485509
486- if int (id ) not in (_NOT_FOUND , _OVERLAP ) and \
487- cv .colorby not in _MODEL_PROPERTIES :
510+ if (int (id ) not in (_NOT_FOUND , _VOID_REGION ) and
511+ int (id ) > _OVERLAP and
512+ cv .colorby not in _MODEL_PROPERTIES ):
488513
489514 # Domain ID
490515 if domain [id ].name :
@@ -551,7 +576,7 @@ def contextMenuEvent(self, event):
551576 connector = partial (self .main_window .editBackgroundColor ,
552577 apply = True )
553578 bgColorAction .triggered .connect (connector )
554- elif int (id ) = = _OVERLAP :
579+ elif int (id ) < = _OVERLAP :
555580 olapColorAction = self .menu .addAction (
556581 'Edit Overlap Color...' )
557582 olapColorAction .setToolTip ('Edit overlap color' )
0 commit comments