Commit 92775bcc authored by JosefBrandt's avatar JosefBrandt

parent 83cdeb70
This diff is collapsed.
......@@ -337,9 +337,9 @@ class Particle(object):
def getShortParticleSize(self):
if not np.isnan(self.shortSize_ellipse):
return round(self.shortSize_ellipse)
return self.shortSize_ellipse
elif not np.isnan(self.shortSize_box):
return round(self.shortSize_box)
return self.shortSize_box
else:
print(f'Error, particle size requested, but not yet set.\nParticle Index is {self.index}')
raise ValueError
......
......@@ -397,7 +397,8 @@ class SampleView(QtWidgets.QGraphicsView):
I would prefer having it in the viewitems themselves, but somehow the sampleview has to check
for already selected indices and also check when nothing is hit...
'''
def addContourToSelection(cnt):
def acceptSelection(cnt):
self.analysiswidget.setWidgetsToNewParticleIndex(cnt.particleIndex)
cnt.isSelected = True
cnt.update()
self.selectedParticleIndices.append(cnt.particleIndex)
......@@ -413,12 +414,10 @@ class SampleView(QtWidgets.QGraphicsView):
for index, cnt in enumerate(self.contourItems):
if cnt.polygon.containsPoint(p, QtCore.Qt.OddEvenFill): #clicked on particle
if not event.modifiers()==QtCore.Qt.ShiftModifier:
addContourToSelection(cnt)
self.analysiswidget.selectParticleOfIndex(cnt.particleIndex)
acceptSelection(cnt)
else:
if cnt.particleIndex not in self.selectedParticleIndices:
addContourToSelection(cnt)
self.analysiswidget.selectParticleOfIndex(cnt.particleIndex)
acceptSelection(cnt)
elif cnt.particleIndex in self.selectedParticleIndices:
removeContourFromSelection(cnt)
......@@ -617,15 +616,15 @@ class SampleView(QtWidgets.QGraphicsView):
self.ramanscanitems[index].setHighLight(True)
def highLightContour(self, index):
print('highlighting contour', index)
for contour in self.contourItems:
contour.isSelected = False
self.contourItems[index].isSelected = True
def centerOnRamanIndex(self, index, centerOn=True, highlightContour=True):
def centerOnRamanIndex(self, index, centerOn=True, highlightIndex=True):
if centerOn:
self.centerOn(self.ramanscanitems[index])
if highlightContour:
if highlightIndex:
self.highLightRamanIndex(index)
def clearItems(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment