Subject | Hash | Author | Date (UTC) |
---|---|---|---|
qt_gui.qt_gui: show contacts in distance matrix. Based on ContactSolver for now | 21bd6101888d9f06d7d6a7c6ba2732ff30fdd68d | I am | 2022-10-13 04:16:41 |
voronoi: ContactSolver is ready. Ale je to na nic. Pomalá, potvora | 28e2442b0101eac2407ed4a69c6f757ffd579cf1 | I am | 2022-10-13 04:14:59 |
voronoi: add some preliminary lines of ContactSolver. WIP | 6a203b278c9fa6de7da75c402c80f78d40164fdf | I am | 2022-10-12 23:38:59 |
voronoi: přídat pár těžkých smyček. WIP | 7b0ffb602ae00ab2f12dc98d34c35ec20afa3cc4 | I am | 2022-10-12 00:13:36 |
add to repo voronoi module. WIP | f43768c22d88fac7c7095be02d8c9b5620153976 | I am | 2022-10-11 03:29:49 |
convex_hull.Grick: malý puntičkářský fix v get_r() | cfa07257b9ebadc21f2bd295d35978072fac19e9 | I am | 2022-10-10 07:14:26 |
qt_gui.qt_plot: add Grick to Ghull widget | d90b9a87c3ef0989951a45b2a22346381ce16f02 | I am | 2022-10-10 03:17:24 |
convex_hull: implement Grick convex hull aproximation | d09ca2e6aca41cfc67f3303eb97b97dd9c6f1fba | I am | 2022-10-10 03:15:52 |
qt_gui.qt_gui: distance matrix viewer is ready | a532e5259c081a1aff193d3b61e0104c42b08f20 | I am | 2022-10-08 20:52:14 |
qt_gui.qt_gui: prepare distance matrix window | 4eaea3305643c60c35f0b22421a7e57dbe7a7817 | I am | 2022-10-08 02:59:01 |
qt_gui.qt_graph_widgets: set up x limits for all graph widgets | 413d114f6a4e4b45c6cd44959cc42588bb7c8008 | I am | 2022-10-07 22:54:46 |
qt_gui.qt_plot: set up equal aspect by default | 11bfe09b3e96881ef6f7c8202a6723b6e8adc03a | I am | 2022-10-07 21:41:18 |
qt_gui.qt_gui: hide "connect/disconnect" button. It wasn't really supported | d9f195fe0611d6cf9a8154f0175c6c9506d56247 | I am | 2022-10-07 21:33:07 |
qt_gui.qt_plot: fix zero r cirkle (off by one error) | 681397de6d075b693897d5f64004c0eb481fd36f | I am | 2022-10-07 20:34:44 |
qt_gui: replace globally QtGui by QtWidgets | 969a659ae31728e75f587f25f54bab1ae5d6bfff | I am | 2022-10-07 12:45:34 |
qt_gui: add radia in Gaussian space (GRaph) widget | e3f5be57dcdc6bdd06cda0594ffd795ef5bc8ccc | I am | 2022-10-07 01:15:38 |
testcases.testcases_2d: fix natafm_plane pf | 75006ccd448c9717c13659e8ceb68800fbda39a7 | I am | 2022-06-26 12:03:39 |
misc: add entropy formula | 72736d485b4f0fa912a47a49f72954e1ec06c03f | I am | 2022-06-26 12:02:52 |
testcases.gaussian_2D: one more product... | e835ab15321169c2da085a6bb74e1ed749e67f14 | I am | 2022-05-11 15:38:24 |
whitebox: add explicitly solved Gaussian 2D product distribution | 23d243baed0b7b71ba887444665420d673dc3fe9 | I am | 2022-05-11 15:37:19 |
File | Lines added | Lines deleted |
---|---|---|
wellmet/qt_gui/qt_gui.py | 17 | 4 |
File wellmet/qt_gui/qt_gui.py changed (mode: 100644) (index e694f04..9042ad5) | |||
... | ... | from pyqtgraph import console | |
10 | 10 | import numpy as np | import numpy as np |
11 | 11 | from scipy import spatial # for distance matrix | from scipy import spatial # for distance matrix |
12 | 12 | from . import qt_graph_widgets | from . import qt_graph_widgets |
13 | from ..voronoi import ContactSolver | ||
13 | 14 | from .. import reader | from .. import reader |
14 | 15 | ||
15 | 16 | ||
... | ... | class QtGuiWindow(QtWidgets.QMainWindow): | |
545 | 546 | #č takhle funguje, jinak nefunguje | #č takhle funguje, jinak nefunguje |
546 | 547 | #mask[failure_points][:,failure_points] = 0 | #mask[failure_points][:,failure_points] = 0 |
547 | 548 | ||
549 | CS = ContactSolver(sample_space) | ||
550 | contacts = np.zeros((nsim, nsim), dtype=np.bool8) | ||
551 | for i in range(nsim): | ||
552 | for j in range(i): | ||
553 | contacts[i, j] = CS.is_couple((i, j)) | ||
548 | 554 | ||
549 | 555 | #pg.image(data, levelMode='rgba', title="Distance matrix, p=%s" % p) | #pg.image(data, levelMode='rgba', title="Distance matrix, p=%s" % p) |
550 | w = DMView(dmatrix, mask) | ||
556 | w = DMView(dmatrix, mask, contacts) | ||
551 | 557 | w.setWindowTitle("Distance matrix, p=%s" % p) | w.setWindowTitle("Distance matrix, p=%s" % p) |
552 | 558 | ||
553 | 559 | ||
... | ... | E Miscellaneous | |
570 | 576 | images = [] | images = [] |
571 | 577 | ||
572 | 578 | class DMView(pg.ImageView): | class DMView(pg.ImageView): |
573 | def __init__(self, dmatrix, mask, *args, **kwargs): | ||
579 | def __init__(self, dmatrix, mask, contacts, *args, **kwargs): | ||
574 | 580 | self.dmatrix = dmatrix | self.dmatrix = dmatrix |
581 | self.contacts = contacts | ||
575 | 582 | self.nsim = nsim = len(dmatrix) | self.nsim = nsim = len(dmatrix) |
576 | 583 | data = np.empty((nsim, nsim, 3)) | data = np.empty((nsim, nsim, 3)) |
577 | 584 | data[:,:,0] = dmatrix * mask | data[:,:,0] = dmatrix * mask |
578 | 585 | data[:,:,1] = dmatrix * (1 - mask) | data[:,:,1] = dmatrix * (1 - mask) |
579 | data[:,:,2] = 0 | ||
586 | data[:,:,2] = contacts | ||
580 | 587 | ||
581 | 588 | self.pi = pg.PlotItem() | self.pi = pg.PlotItem() |
582 | 589 | super().__init__(*args, view=self.pi, **kwargs) | super().__init__(*args, view=self.pi, **kwargs) |
... | ... | class DMView(pg.ImageView): | |
599 | 606 | nsim = self.nsim | nsim = self.nsim |
600 | 607 | if x >= 0 and x < nsim and y >= 0 and y < nsim: | if x >= 0 and x < nsim and y >= 0 and y < nsim: |
601 | 608 | val = self.dmatrix[x,y] | val = self.dmatrix[x,y] |
602 | self.pi.setTitle("distance between %d and %d is %g" % (x, y, val)) | ||
609 | msg = "distance between %d and %d is %g\n" % (x, y, val) | ||
610 | if self.contacts[max(x,y), min(x,y)]: | ||
611 | msg += "There is contact between them" | ||
612 | else: | ||
613 | msg += "There is no contact between them" | ||
614 | |||
615 | self.pi.setTitle(msg) | ||
603 | 616 | ||
604 | 617 | ||
605 | 618 |