def __init__(self, data, win_parent=None): """ Saves the data members from data and performs type checks """ PyDialog.__init__(self, data, win_parent) self._updated_preference = False self._default_font_size = data['font_size'] #self.dim_max = data['dim_max'] self.model_name = data['model_name'] self.cids = data['cids'] self.gpforce = data['gpforce'] #self._origin = data['origin'] #self._p1 = data['origin'] #self._p2 = data['origin'] #self.out_data = data self.plane_color_float, self.plane_color_int = check_color( data['plane_color']) self.plane_opacity = data['plane_opacity'] self.methods = ['Z-Axis Projection', 'CORD2R'] self.zaxis_methods = ['Global Z', 'Camera Normal', 'Manual'] self._zaxis_method = 0 # Global Z self.setWindowTitle('Shear, Moment, Torque') self.create_widgets() self.create_layout() self.set_connections() self.on_font(self._default_font_size)
def __init__(self, data, win_parent=None): """ Saves the data members from data and performs type checks """ PyDialog.__init__(self, data, win_parent) self._updated_preference = False self.dim_max = data['dim_max'] # font size for menu self._default_font_size = FONT_SIZE self._default_text_size = TEXT_SIZE # an annotation is the marked/probe label self._default_annotation_size = ANNOTATION_SIZE self._default_coord_scale = COORD_SCALE * 100. # * self.dim_max self._default_coord_text_scale = COORD_TEXT_SCALE * 100. # * self.dim_max self._default_clipping_min = data['min_clip'] self._default_clipping_max = data['max_clip'] #self._default_annotation_size = data['annotation_size'] # int #self.default_magnify = data['magnify'] self._use_gradient_background = data['use_gradient_background'] # bool self._show_corner_coord = data['show_corner_coord'] self._annotation_size = data['annotation_size'] # int #self.out_data = data # doesn't include dim_max self._picker_size = data['picker_size'] * 100. self._coord_scale = data['coord_scale'] * 100. self._coord_text_scale = data['coord_text_scale'] * 100. self._magnify = data['magnify'] self._text_size = data['text_size'] self._highlight_opacity = data['highlight_opacity'] self.annotation_color_float, self.annotation_color_int = check_color( data['annotation_color']) self.background_color_float, self.background_color_int = check_color( data['background_color']) self.background_color2_float, self.background_color2_int = check_color( data['background_color2']) self.text_color_float, self.text_color_int = check_color( data['text_color']) self.highlight_color_float, self.highlight_color_int = check_color( data['highlight_color']) self._nastran_is_element_quality = data['nastran_is_element_quality'] self._nastran_is_properties = data['nastran_is_properties'] self._nastran_is_3d_bars = data['nastran_is_3d_bars'] self._nastran_is_3d_bars_update = data['nastran_is_3d_bars_update'] self._nastran_is_bar_axes = data['nastran_is_bar_axes'] self._nastran_create_coords = data['nastran_create_coords'] self._nastran_is_shell_mcids = data['nastran_is_shell_mcids'] self._nastran_stress = data['nastran_stress'] self._nastran_plate_stress = data['nastran_plate_stress'] self._nastran_composite_plate_stress = data['nastran_composite_plate_stress'] self._nastran_strain = data['nastran_strain'] self._nastran_plate_strain = data['nastran_plate_strain'] self._nastran_composite_plate_strain = data['nastran_composite_plate_strain'] self._nastran_rod_stress = data['nastran_rod_stress'] self._nastran_bar_stress = data['nastran_bar_stress'] self._nastran_beam_stress = data['nastran_beam_stress'] self._nastran_rod_strain = data['nastran_rod_strain'] self._nastran_bar_strain = data['nastran_bar_strain'] self._nastran_beam_strain = data['nastran_beam_strain'] self.setWindowTitle('Preferences') self.create_widgets() self.create_layout() self.set_connections() self.on_font(self._default_font_size) self.on_gradient_scale()
def __init__(self, data, menu_type, win_parent=None): """ Saves the data members from data and performs type checks Parameters ---------- menu_type : str 'highlight' 'mark' """ PyDialog.__init__(self, data, win_parent) gui = win_parent self.menu_type = menu_type self._default_annotation_size = ANNOTATION_SIZE if gui is None: # pragma: no cover self.highlight_color_float = [0., 0., 0.] self.highlight_color_int = [0, 0, 0] self._highlight_opacity = 0.9 self._point_size = 10 self._label_size = 10.0 else: settings = gui.settings # type: Settings self.highlight_color_float, self.highlight_color_int = check_color( settings.highlight_color) self._highlight_opacity = settings.highlight_opacity self._point_size = settings.highlight_point_size self._line_thickness = settings.highlight_line_thickness self._point_size = 10 self._annotation_size = settings.annotation_size self._updated_window = False self.actors = [] self._default_font_size = data['font_size'] self.model_name = data['model_name'] assert len(self.model_name) > 0, self.model_name #self._default_annotation_size = data['annotation_size'] # int #self.default_magnify = data['magnify'] if 'nodes_pound' in data: # testing nodes_pound = data['nodes_pound'] elements_pound = data['elements_pound'] nodes = np.arange(1, nodes_pound + 1) elements = np.arange(1, elements_pound + 1) else: # gui nodes = gui.get_node_ids(model_name=self.model_name) elements = gui.get_element_ids(model_name=self.model_name) nodes_pound = nodes.max() elements_pound = elements.max() self.nodes = nodes self.elements = elements self._nodes_pound = nodes_pound self._elements_pound = elements_pound if self.menu_type == 'highlight': self.setWindowTitle('Highlight') elif self.menu_type == 'mark': self.setWindowTitle('Mark') else: raise NotImplementedError(self.menu_type) self.create_widgets() self.create_layout() self.set_connections() self.on_font(self._default_font_size)