[vtkusers] Mismatched PoindIDs from ExtractEdges

piotr.kozaczewski at power.alstom.com piotr.kozaczewski at power.alstom.com
Mon Oct 21 03:23:40 EDT 2002


Dear VTKers.

I want to be able to pick on triangular cells, their edges and nodes
of an unstructured grid in a consistent manner.

I have a problem with getting correct PointIDs from the picker,
when picking on end-points of edges extracted from a triangular grid.

I do the following :
...
# Build and map a grid
--------------------------------------------------------------
vtkDataSetReader   reader
    reader   SetFileName   "../Data/TriMesh07.vtk"

set   uGrid   [reader GetOutput]

vtkDataSetMapper   uGridMapper
   uGridMapper   SetInput   $uGrid

vtkActor    uGridActor
   uGridActor   SetMapper   uGridMapper

# Retrieve   edges from the grid
vtkExtractEdges   extractEdges
    extractEdges   SetInput    $uGrid

vtkPolyDataMapper    mapEdges
    mapEdges   SetInput   [extractEdges GetOutput]

vtkActor   edgeActor
    edgeActor    SetMapper    mapEdges

# DANGEROUS: defining what to pick --------------------------------------
# Case 1 - picking (triangular) cells and their nodes
edgeActor  PickableOff
uGridActor PickableOn
# Case 2 -- picking edges and their end-points
#edgeActor  PickableOn
#uGridActor PickableOff


# PROBLEM :
When Case 1 (i.e. picking of initial triangles and nodes) is active, I got
the correct PointIDs from the picker.
In Case 2 (i.e. picking edges and their endpoints), picking in the same
"geometrical points" delivers different PointIDs than in Case 1 !!!

Where is my error?

How to prevent such a mismatch?

Could anybody help me please?

Thanks in advance,
Piotr Kozaczewski




More information about the vtkusers mailing list