I was debugging my code where there were some issues with vtkLabeledDataMapper.<br><br>I have two sets of labels ,one a vtkIntArray and another a vtkStringArray.<br><br>The code I used for vtkStringArray is given below:<br>
vtkSmartPointer<vtkLabeledDataMapper> lmap = vtkSmartPointer<vtkLabeledDataMapper>::New();<br> lmap->SetInputConnection(vispts->GetOutputPort());<br> lmap->SetLabelModeToLabelFieldData();<br> lmap->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, "labelname");<br>
lmap->Update();<br><br>labelname is the name of the vtkStringArray array I used. This works fine . <br><br>This same code crashes when I use vtkIntArray by changing the following<br>lmap->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS, "proplabelname");<br>
<br>The crash is in the MouseMove Event and I see that the problem is in the GetMTime() function call . The reason is there is a vtkTextProperty entry which points to null.<br><br>if i use lmap->SetFieldDataName("proplabelname") it works fine.<br>
<br>Since both of vtkIntArray and vtkStringArray are attributes I do not think SetInputArrayToProcess() should discriminate against them . <br>I am unclear if it a bug, <br><br>Regards<br>Darshan<br><br>