def ChangeViewColor(self, entity, view): if isinstance(entity, gfx.Entity) and isinstance(view, mol.EntityView): if self.parent_.GetCarbonsOnly(): bco = gfx.ByChainColorOp( mol.QueryViewWrapper(mol.Query("ele=C"), view)) else: bco = gfx.ByChainColorOp(mol.QueryViewWrapper(view)) entity.Apply(bco)
def ChangeViewColor(self, entity, view): if isinstance(entity, gfx.Entity) and isinstance(view, mol.EntityView): gfx_color = self.color_select_widget_.GetGfxColor() if self.parent_.GetCarbonsOnly(): ufco = gfx.UniformColorOp( mol.QueryViewWrapper(mol.Query("ele=C"), view), gfx_color) else: ufco = gfx.UniformColorOp(mol.QueryViewWrapper(view), gfx_color) entity.Apply(ufco)
def ChangeViewColor(self, entity, view): if isinstance(entity, gfx.Entity) and isinstance(view, mol.EntityView): if self.parent_.GetCarbonsOnly(): glco = gfx.GradientLevelColorOp( mol.QueryViewWrapper(mol.Query("ele=C"), view), self.props[self.prop_combo_box_.currentIndex()], self.gradient_edit_.GetGfxGradient(), mol.Prop.Level.UNSPECIFIED) else: glco = gfx.GradientLevelColorOp( mol.QueryViewWrapper(view), self.props[self.prop_combo_box_.currentIndex()], self.gradient_edit_.GetGfxGradient(), mol.Prop.Level.UNSPECIFIED) entity.Apply(glco)
def GetOp(self): qv=mol.QueryViewWrapper(self.query_editor_.GetQuery(),self.query_editor_.GetQueryFlags()) ufco = UniformColorOp(qv,gfx.RGBA(1,1,1,1)) detail = self.detail_selection_cb_.itemData(self.detail_selection_cb_.currentIndex()).toPyObject() ufco.SetMask(detail) qcolor = self.color_select_widget_.GetColor() color=gfx.RGBAb(qcolor.red(),qcolor.green(),qcolor.blue(),qcolor.alpha()) ufco.SetColor(color) return ufco
def GetOp(self): gradient = self.gradient_edit_.GetGfxGradient() detail = self.detail_selection_cb_.itemData(self.detail_selection_cb_.currentIndex()).toPyObject() qv=mol.QueryViewWrapper(self.query_editor_.GetQuery(),self.query_editor_.GetQueryFlags()) prop = str() level = Prop.Level() if(self.property_edit_.isEnabled()): prop = str(self.property_edit_.text()) level = Prop.Level(self.combo_box_.itemData(self.combo_box_.currentIndex()).toPyObject()) else: prop = str(self.prop_combo_box_.itemData(self.prop_combo_box_.currentIndex()).toPyObject()) if(self.auto_calc_.isChecked()): return GradientLevelColorOp(qv, detail, prop, gradient, level) else: minv = self.minv_.value() maxv = self.maxv_.value() return GradientLevelColorOp(qv, detail, prop, gradient, minv, maxv, level)
def GetOp(self): detail = self.detail_selection_cb_.itemData(self.detail_selection_cb_.currentIndex()).toPyObject() qv=mol.QueryViewWrapper(self.query_editor_.GetQuery(),self.query_editor_.GetQueryFlags()) bcco = ByChainColorOp(qv, detail) return bcco