Only the last orientation is now taken into account for structural elements (closes PAL #2326)

This commit is contained in:
barate 2012-11-05 15:33:41 +00:00
parent 8ad2d4e66e
commit 7d57159ff5

View File

@ -27,7 +27,7 @@ import math
from salome.kernel.logger import Logger from salome.kernel.logger import Logger
from salome.kernel import termcolor from salome.kernel import termcolor
logger = Logger("__PAL_GEOM__.structelem.orientation", color = termcolor.RED) logger = Logger("salome.geom.structelem.orientation", color = termcolor.RED)
class Orientation1D: class Orientation1D:
@ -57,25 +57,24 @@ class Orientation1D:
coordinate system. coordinate system.
The parameters can be specified several times. In this case, only the The parameters can be specified several times. In this case, only the
first "VECT_Y" is taken into account, and the values of "ANGL_VRIL" last "VECT_Y" or "ANGL_VRIL" is taken into account.
are added to obtain the total rotation angle.
""" """
if self._vectorYCoords is not None or self._angle != 0.0:
logger.warning('Orientation parameters are specified several '
'times for the same mesh group, only the last '
'parameter will be used')
mydict = params.copy() mydict = params.copy()
if mydict.has_key("VECT_Y"): if mydict.has_key("VECT_Y"):
newVecCoords = mydict.pop("VECT_Y") newVecCoords = mydict.pop("VECT_Y")
if self._vectorYCoords is None: logger.debug("Setting orientation vector Y to %s" %
logger.debug("Setting orientation vector Y to %s" %
str(newVecCoords)) str(newVecCoords))
self._vectorYCoords = newVecCoords self._vectorYCoords = newVecCoords
else: self._angle = 0.0
logger.warning('Orientation parameter "VECT_Y" is specified '
'several times for the same mesh group, vector'
' %s will be used' % str(self._vectorYCoords))
if mydict.has_key("ANGL_VRIL"): if mydict.has_key("ANGL_VRIL"):
newAngle = mydict.pop("ANGL_VRIL") newAngle = mydict.pop("ANGL_VRIL")
self._angle += newAngle logger.debug("Setting orientation angle to %f" % newAngle)
logger.debug("Adding angle %f to orientation, new angle is %f." % self._angle = newAngle
(newAngle, self._angle)) self._vectorYCoords = None
if len(mydict) > 0: if len(mydict) > 0:
logger.warning("Invalid orientation parameter(s) (ignored): %s" % logger.warning("Invalid orientation parameter(s) (ignored): %s" %
str(mydict)) str(mydict))