File wellmet/qt_gui/qt_pairwise.py changed (mode: 100644) (index 3ddf5c3..c89ed1e) |
... |
... |
class ContactWidget(pg.LayoutWidget): |
887 |
887 |
params.append({'name': 'force_update', 'title': 'reevaluate', |
params.append({'name': 'force_update', 'title': 'reevaluate', |
888 |
888 |
'type': 'bool', 'value': False, |
'type': 'bool', 'value': False, |
889 |
889 |
'tip': "always reevaluate even discovered contacts"}) |
'tip': "always reevaluate even discovered contacts"}) |
890 |
|
params.append({'name': 'method', 'type': 'list', 'value': 'ConvexSolver', |
|
891 |
|
'values': ['DirectContact', 'Gabriel', 'ConvexSolver', 'LocalizedHull', 'Qhull'], |
|
|
890 |
|
params.append({'name': 'method', 'type': 'list', 'value': 'ConvexLinear', |
|
891 |
|
'values': ['DirectContact', 'Gabriel', 'ConvexSolver', 'ConvexLinear', 'LinearSolver', 'LocalizedHull', 'Qhull'], |
892 |
892 |
'title': "method"}) |
'title': "method"}) |
893 |
893 |
|
|
894 |
894 |
params.append({'name': 'solver', 'title': "solver", 'type': 'list', 'value': 'convex_sprite', |
params.append({'name': 'solver', 'title': "solver", 'type': 'list', 'value': 'convex_sprite', |
|
... |
... |
class ContactWidget(pg.LayoutWidget): |
902 |
902 |
|
|
903 |
903 |
params.append({'name': 'tol', 'type': 'float', |
params.append({'name': 'tol', 'type': 'float', |
904 |
904 |
'title': "tolerance", |
'title': "tolerance", |
905 |
|
'limits': (0, float('inf')), 'value': 1e-7, 'default': 1e-7}) |
|
|
905 |
|
'limits': (0, float('inf')), 'value': 1e-5, 'default': 1e-7}) |
906 |
906 |
|
|
907 |
907 |
self.param = pg.parametertree.Parameter.create(name='params', type='group', children=params) |
self.param = pg.parametertree.Parameter.create(name='params', type='group', children=params) |
908 |
908 |
|
|
|
... |
... |
class ContactWidget(pg.LayoutWidget): |
946 |
946 |
def method_changed(self, parameter): |
def method_changed(self, parameter): |
947 |
947 |
self.setup_CS() |
self.setup_CS() |
948 |
948 |
method = parameter.value() |
method = parameter.value() |
949 |
|
if method == 'ConvexSolver': |
|
|
949 |
|
if method in ('ConvexSolver', 'ConvexLinear'): |
950 |
950 |
self.param.child('solver').show() |
self.param.child('solver').show() |
951 |
951 |
self.param.child('tries_to_fix').show() |
self.param.child('tries_to_fix').show() |
952 |
952 |
self.param.child('tol').show() |
self.param.child('tol').show() |
953 |
|
elif method == 'LocalizedHull': |
|
|
953 |
|
elif method in ('LocalizedHull', 'LinearSolver'): |
954 |
954 |
self.param.child('solver').hide() |
self.param.child('solver').hide() |
955 |
955 |
self.param.child('tries_to_fix').hide() |
self.param.child('tries_to_fix').hide() |
956 |
956 |
self.param.child('tol').show() |
self.param.child('tol').show() |
|
... |
... |
class ContactWidget(pg.LayoutWidget): |
959 |
959 |
self.param.child('tries_to_fix').hide() |
self.param.child('tries_to_fix').hide() |
960 |
960 |
self.param.child('tol').hide() |
self.param.child('tol').hide() |
961 |
961 |
|
|
|
962 |
|
# if method == 'LinearSolver': |
|
963 |
|
# self.param.child('force_update').setReadonly() |
|
964 |
|
# self.param.child('force_update').setValue(False) |
|
965 |
|
# else: |
|
966 |
|
# self.param.child('force_update').setReadonly(False) |
|
967 |
|
|
962 |
968 |
|
|
963 |
969 |
def setup_CS(self): |
def setup_CS(self): |
964 |
970 |
sample_box = self.w.get_sample_box() |
sample_box = self.w.get_sample_box() |
|
... |
... |
class ContactWidget(pg.LayoutWidget): |
986 |
992 |
#self.kwargs.clear() #č aby se to neztratilo až bude 100500 metodů |
#self.kwargs.clear() #č aby se to neztratilo až bude 100500 metodů |
987 |
993 |
self.kwargs['tries_to_fix'] = self.param.getValues()['tries_to_fix'][0] |
self.kwargs['tries_to_fix'] = self.param.getValues()['tries_to_fix'][0] |
988 |
994 |
self.kwargs['tol'] = self.param.getValues()['tol'][0] |
self.kwargs['tol'] = self.param.getValues()['tol'][0] |
|
995 |
|
elif method == 'ConvexLinear': |
|
996 |
|
solver = getattr(wireframe, self.param.child('solver').value()) |
|
997 |
|
self.CS = wireframe.ConvexLinear(sample_space, convex_solver=solver) |
|
998 |
|
#self.kwargs.clear() #č aby se to neztratilo až bude 100500 metodů |
|
999 |
|
self.kwargs['tries_to_fix'] = self.param.getValues()['tries_to_fix'][0] |
|
1000 |
|
self.kwargs['tol'] = self.param.getValues()['tol'][0] |
|
1001 |
|
elif method == 'LinearSolver': |
|
1002 |
|
self.CS = wireframe.LinearSolver(sample_space) |
|
1003 |
|
self.kwargs.clear() |
|
1004 |
|
self.kwargs['tol'] = self.param.getValues()['tol'][0] |
989 |
1005 |
elif method == 'LocalizedHull': |
elif method == 'LocalizedHull': |
990 |
1006 |
self.CS = wireframe.LocalizedHull(sample_space) |
self.CS = wireframe.LocalizedHull(sample_space) |
991 |
1007 |
self.kwargs.clear() |
self.kwargs.clear() |