No subject
Mon Dec 15 09:51:36 EST 2008
do what I want, but the example provided online doesn't cover this corner.
Any help is greatly appreciated.
Sincerely,
--
Ola Skavhaug
--000e0cd25b4cb9501a046188521d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi,<br><br>I am trying to debug some mesh partitioning algorithm, and
need to label the points of the new a unstructured vtk (sub-)grid
according to the global numbering of the old mesh. I have tried the
vtkLabeledDataMapper in combination with vtkIdFilter after setting the
global numbering as field data of the unstructured mesh given as input
to the vtkIdFilter, but I guess this is not the way to go (at least, I
can't get it to work).<br>
<br>This is my, probably retarded, attempt:<br><br> def a=
dd_point_labels(self, labels=3DNone):<br> &nbs=
p; ldm =3D vtk.vtkLabeledDataMapper()<br> &nbs=
p; ldm.SetLabelFormat("%g")<br>
ids =3D vtk.vtkIdFilter()<br>&nb=
sp; if labels !=3D None:<br>  =
; arr =3D vtk.vtkIdTy=
peArray()<br> &n=
bsp; arr.SetVoidArray(labels, len(labels), 1)<br> &n=
bsp; arr.SetName("point labels&quo=
t;)<br> s=
elf.vtkgrid.GetFieldData().AddArray(arr)<br>
ids.SetI=
nput(self.vtkgrid)<br>  =
; ids.SetFieldData(1)<br> &n=
bsp; ldm.SetFieldDataArray(0)<br> =
ldm.SetLabelModeToLabelFie=
ldData()<br> else:<br>  =
; ids.SetInput(self.v=
tkgrid)<br>
ids.Poin=
tIdsOn()<br> &nb=
sp; ids.FieldDataOn()<br><br> ldm=
.SetInputConnection(ids.GetOutputPort())<br> &=
nbsp; ldm.GetLabelTextProperty().SetColor(0, 0, 0)<br> &nb=
sp; ldm.GetLabelTextProperty().BoldOn()<br>
pointLabels =3D vtk.vtkActor2D()=
<br clear=3D"all"><br>From
my understanding of the nightly documentation, it should be possible to
do what I want, but the example provided online doesn't cover this
corner. Any help is greatly appreciated.<br>
<br>Sincerely,<br clear=3D"all"><br>-- <br>Ola Skavhaug<br>
--000e0cd25b4cb9501a046188521d--
More information about the vtkusers
mailing list