File wellmet/qt_gui/qt_pairwise.py changed (mode: 100644) (index 9575b89..a98c360) |
... |
... |
class ContactWidget(pg.LayoutWidget): |
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 |
890 |
params.append({'name': 'method', 'type': 'list', 'value': 'ConvexSolver', |
params.append({'name': 'method', 'type': 'list', 'value': 'ConvexSolver', |
891 |
|
'values': ['DirectContact', 'ConvexSolver', 'Qhull'], |
|
|
891 |
|
'values': ['DirectContact', 'ConvexSolver', '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): |
919 |
919 |
|
|
920 |
920 |
|
|
921 |
921 |
p = self.param.child('tries_to_fix') |
p = self.param.child('tries_to_fix') |
922 |
|
p.sigValueChanged.connect(self.convex_paremeters_changed) |
|
|
922 |
|
p.sigValueChanged.connect(self.ttf_changed) |
923 |
923 |
|
|
924 |
924 |
p = self.param.child('tol') |
p = self.param.child('tol') |
925 |
|
p.sigValueChanged.connect(self.convex_paremeters_changed) |
|
|
925 |
|
p.sigValueChanged.connect(self.tol_changed) |
926 |
926 |
|
|
|
927 |
|
|
|
928 |
|
def ttf_changed(self, parameter): |
|
929 |
|
self.kwargs['tries_to_fix'] = parameter.value() |
927 |
930 |
|
|
928 |
|
def convex_paremeters_changed(self, *args, **kwargs): |
|
929 |
|
self.kwargs['tries_to_fix'] = self.param.getValues()['tries_to_fix'][0] |
|
930 |
|
self.kwargs['tol'] = self.param.getValues()['tol'][0] |
|
|
931 |
|
def tol_changed(self, parameter): |
|
932 |
|
self.kwargs['tol'] = parameter.value() |
931 |
933 |
|
|
932 |
934 |
|
|
933 |
935 |
def check_method_changed(self, parameter): |
def check_method_changed(self, parameter): |
|
... |
... |
class ContactWidget(pg.LayoutWidget): |
943 |
945 |
|
|
944 |
946 |
def method_changed(self, parameter): |
def method_changed(self, parameter): |
945 |
947 |
self.setup_CS() |
self.setup_CS() |
946 |
|
if parameter.value() == 'ConvexSolver': |
|
|
948 |
|
method = parameter.value() |
|
949 |
|
if method == 'ConvexSolver': |
947 |
950 |
self.param.child('solver').show() |
self.param.child('solver').show() |
948 |
951 |
self.param.child('tries_to_fix').show() |
self.param.child('tries_to_fix').show() |
949 |
952 |
self.param.child('tol').show() |
self.param.child('tol').show() |
|
953 |
|
elif method == 'LocalizedHull': |
|
954 |
|
self.param.child('solver').hide() |
|
955 |
|
self.param.child('tries_to_fix').hide() |
|
956 |
|
self.param.child('tol').show() |
950 |
957 |
else: |
else: |
951 |
958 |
self.param.child('solver').hide() |
self.param.child('solver').hide() |
952 |
959 |
self.param.child('tries_to_fix').hide() |
self.param.child('tries_to_fix').hide() |
|
... |
... |
class ContactWidget(pg.LayoutWidget): |
965 |
972 |
if status: |
if status: |
966 |
973 |
self.CS = qframe |
self.CS = qframe |
967 |
974 |
self.kwargs.clear() |
self.kwargs.clear() |
|
975 |
|
else: |
|
976 |
|
self.param.child('method').setToDefault() |
968 |
977 |
elif method == 'DirectContact': |
elif method == 'DirectContact': |
969 |
978 |
self.CS = wireframe.DirectContact(sample_space) |
self.CS = wireframe.DirectContact(sample_space) |
970 |
979 |
self.kwargs.clear() |
self.kwargs.clear() |
|
... |
... |
class ContactWidget(pg.LayoutWidget): |
974 |
983 |
#self.kwargs.clear() #č aby se to neztratilo až bude 100500 metodů |
#self.kwargs.clear() #č aby se to neztratilo až bude 100500 metodů |
975 |
984 |
self.kwargs['tries_to_fix'] = self.param.getValues()['tries_to_fix'][0] |
self.kwargs['tries_to_fix'] = self.param.getValues()['tries_to_fix'][0] |
976 |
985 |
self.kwargs['tol'] = self.param.getValues()['tol'][0] |
self.kwargs['tol'] = self.param.getValues()['tol'][0] |
|
986 |
|
elif method == 'LocalizedHull': |
|
987 |
|
self.CS = wireframe.LocalizedHull(sample_space) |
|
988 |
|
self.kwargs.clear() |
|
989 |
|
self.kwargs['tol'] = self.param.getValues()['tol'][0] |
977 |
990 |
else: |
else: |
978 |
991 |
raise ValueError("ContactWidget: unknown method") |
raise ValueError("ContactWidget: unknown method") |
979 |
992 |
|
|