def update_dom_selection(self, all_sel=None): from petram.model import convert_sel_txt try: arr = convert_sel_txt(self.sel_index_txt, self._global_ns) self.sel_index = arr except: assert False, "failed to convert " + self.sel_index_txt if all_sel is None: # clinet GUI panel operation ends here return allv, alls, alle = all_sel if len(self.sel_index) != 0 and self.sel_index[0] == 'all': if self.sdim == 3: self.sel_index = allv if self.sdim == 2: self.sel_index = alls if self.sdim == 1: self.sel_index = alle
def import_panel2_value(self, v): if str(v[0]) == "Volume": self.sdim = 3 elif str(v[0]) == "Surface": self.sdim = 2 elif str(v[0]) == "Edge": self.sdim = 1 else: self.sdim = 1 self.sel_index_txt = str(v[1]) from petram.model import convert_sel_txt try: g = self._global_ns arr = convert_sel_txt(self.sel_index_txt, g) self.sel_index = arr except: import traceback traceback.print_exc() assert False, "failed to convert " + self.sel_index_txt
def import_panel2_value(self, v): if self.dim_fixed: self.sel_index_txt = str(v[0]) else: if str(v[0]) == "Volume": self.dim = 3 elif str(v[0]) == "Surface": self.dim = 2 elif str(v[0]) == "Edge": self.dim = 1 else: self.dim = 1 self.sel_index_txt = str(v[1]) from petram.model import convert_sel_txt try: arr = convert_sel_txt(self.sel_index_txt, self._global_ns) self.sel_index = arr except: assert False, "failed to convert " + self.sel_index_txt