mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-18 14:00:33 +05:00
0021921: [CEA 690] GetVolume applied on many elements has performance issue
Optimize _valueFromFunctor()
This commit is contained in:
parent
9a844dd922
commit
6d1ea10cad
@ -957,6 +957,7 @@ class Mesh:
|
|||||||
geom = 0
|
geom = 0
|
||||||
mesh = 0
|
mesh = 0
|
||||||
editor = 0
|
editor = 0
|
||||||
|
functors = [None] * SMESH.FT_Undefined._v
|
||||||
|
|
||||||
## Constructor
|
## Constructor
|
||||||
#
|
#
|
||||||
@ -4056,9 +4057,16 @@ class Mesh:
|
|||||||
def CreateHoleSkin(self, radius, theShape, groupName, theNodesCoords):
|
def CreateHoleSkin(self, radius, theShape, groupName, theNodesCoords):
|
||||||
return self.editor.CreateHoleSkin( radius, theShape, groupName, theNodesCoords )
|
return self.editor.CreateHoleSkin( radius, theShape, groupName, theNodesCoords )
|
||||||
|
|
||||||
|
def _getFunctor(self, funcType ):
|
||||||
|
fn = self.functors[ funcType._v ]
|
||||||
|
if not fn:
|
||||||
|
fn = self.smeshpyD.GetFunctor(funcType)
|
||||||
|
fn.SetMesh(self.mesh)
|
||||||
|
self.functors[ funcType._v ] = fn
|
||||||
|
return fn
|
||||||
|
|
||||||
def _valueFromFunctor(self, funcType, elemId):
|
def _valueFromFunctor(self, funcType, elemId):
|
||||||
fn = self.smeshpyD.GetFunctor(funcType)
|
fn = self._getFunctor( funcType )
|
||||||
fn.SetMesh(self.mesh)
|
|
||||||
if fn.GetElementType() == self.GetElementType(elemId, True):
|
if fn.GetElementType() == self.GetElementType(elemId, True):
|
||||||
val = fn.GetValue(elemId)
|
val = fn.GetValue(elemId)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user