"""
**Description:** script to display node Ids in Cassandra

**File name:**    showIds.py

**Creation:**     2005/08/28

**References:** Please see the Cassandra web site http://www.artem.com for
more information.

:author:       Julien Forest

:version:      1.0

**Versions and anomalies correction :**

+---------+--------------------------------------+----------------------------+
| Version | Author (name, e-mail)                | Corrections/Modifications  |
+---------+--------------------------------------+----------------------------+
|   1.0   | Julien Forest                        | Creation                   |
|         | j.forest@artenum.com                 |                            |
+---------+--------------------------------------+----------------------------+

(c) PARIS, 2000-2004, Paris, France, `http://www.artenum.com`_

"""
__docformat__ = "restructuredtext en"

import vtk

print "Show Ids script" 

# choose here the dataSet that you want process
data = cassandra.getPipeLineManager().getDataSetList().getVtkObject(0)

ldm = vtk.vtkLabeledDataMapper()
ldm.SetInput(data.getVtkObject())
ldm.SetLabelModeToLabelIds()
ldm.SetLabelFormat("%g")

#ldm.SetLabelModeToLabelFieldData()
ldm.SetLabelModeToLabelIds()
pointLabels = vtk.vtkActor2D()
pointLabels.SetMapper(ldm)

# recover Cassandra's renderer
ren = cassandra.getRendererPanel().GetRenderer()
ren.AddActor(pointLabels)
cassandra.getPipeLineManager().validateView()
print "Done"
