# -*- coding: utf-8 -*-
-# Copyright (C) 2010-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2010-2015 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
mm = study.FindObjectID(objId).GetObject()
mesh = None
try:
- mesh = mm.GetMEDMesh()
+ mm.Load()
+ mesh = mm
except:
- #print "No mesh selected"
self.clearLineEdit()
mesh = None
pass
if mesh:
+ name = smeshBuilder.GetName( mm )
self.ui.mesh.setStyleSheet("")
- self.ui.mesh.setText(mesh.getName())
- #print "Mesh selected: ", mesh.getName()
+ self.ui.mesh.setText( name )
self.mm = mm
e = self.mm.NbEdges()
f = self.mm.NbFaces()
v = self.mm.NbVolumes()
- #print "NbEdges: ",e
- #print "NbFaces: ",f
- #print "NbVolumes: ",v
controls = []
if e:
controls += controls_1d
pass
def compute_minmax(self):
- if self.mm:
- control = self.ui.control.currentText()
- #print "Compute control: ",control
+ control = self.ui.control.currentText()
+ if self.mm and control:
fun = smesh.GetFunctor(controls_dict[str(control)])
- fun.SetMesh(self.mm.GetMesh())
- hist = fun.GetHistogram(1)
+ fun.SetMesh(self.mm)
+ hist = fun.GetHistogram(1,False)
maxVal = hist[0].max
minVal = hist[0].min
- #print "Max value for %s: %f"%(control, maxVal)
- #print "Min value for %s: %f"%(control, minVal)
self.ui.maxvalue.setText("%f"%(maxVal))
self.ui.minvalue.setText("%f"%(minVal))
else:
- print "Pas de maillage"
pass
pass
pass