Reactivate parallel for sphrical projection, add some auxiliary attribute in ctpv.
This commit is contained in:
parent
897427436e
commit
18c81baac9
2 changed files with 13 additions and 4 deletions
|
@ -4,7 +4,7 @@ from contextlib import contextmanager
|
|||
class ProgrammableParticleLoad(object):
|
||||
|
||||
@staticmethod
|
||||
def main_script(source, particles, aname="default"):
|
||||
def main_script(source, particles, aname="default", aux=None):
|
||||
import vtk
|
||||
from vtk.util import numpy_support as ns
|
||||
|
||||
|
@ -20,6 +20,15 @@ class ProgrammableParticleLoad(object):
|
|||
out.Allocate(1,1)
|
||||
out.SetPoints(vv)
|
||||
|
||||
if aux is not None:
|
||||
for n,a in aux:
|
||||
a_vtk = ns.numpy_to_vtk(
|
||||
np.ascontiguousarray(a.astype(np.float64)
|
||||
),
|
||||
deep=1)
|
||||
a_vtk.SetName(n)
|
||||
out.GetPointData().AddArray(a_vtk)
|
||||
|
||||
out.InsertNextCell(vtk.VTK_VERTEX, particles.shape[0], range(particles.shape[0]))
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue