<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4611.1300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi all,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I am still having problems with the vtkXYPlotActor class. I
hope somebody can help</FONT></DIV>
<DIV><FONT size=2>me with this.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I create the vtkXYPlotActor, then the user has the ability to
add data to the actor</FONT></DIV>
<DIV><FONT size=2>interactively. This works very well apart from the
coloring/labels etc of the lines.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Below is a snippet of my code.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Now when I create the first line of my graph the color, name
etc are all correct.</FONT></DIV>
<DIV><FONT size=2>However, when I add a second set, the colour etc of the second
line are the defaults.</FONT></DIV>
<DIV><FONT size=2>As I pointed out in my previous post this is because the
vtkLegendBoxActor<FONT size=2>->NumberOfEntries</FONT></FONT></DIV>
<DIV><FONT size=2>does not seem to be updated.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>This is really important to me now. Does anybody have an idea
what is wrong.</FONT></DIV>
<DIV><FONT size=2>Is the order of adding + setting data important
etc???</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Thanks for any help</FONT></DIV>
<DIV><FONT size=2>Simon</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT
size=2>--------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> // Add the data set to the graph
actor.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
_pcGraphActor->AddInput(data_set);<BR>
data_set->Delete();</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> // Set the label for curve.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> int icurve =
_pcGraphActor->GetInputList()->GetNumberOfItems();<BR>
char label[80];</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> if (node_or_element == 0)
sprintf(label,"%s%i","Node ",entity_id);<BR>
else<BR> sprintf(label,"%s%i","Element
",entity_id);</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
_pcGraphActor->SetPlotLabel(icurve-1,label);</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> // Map the curve to a color, for this we
use the color table.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> float* rgb =
_pcColorTable->GetColor(static_cast<float>(icurve-1));<BR>
_pcGraphActor->SetPlotColor(icurve-1,rgb[0],rgb[1],rgb[2]);</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> // Create the markers for the data
points.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> vtkSphereSource* marker =
vtkSphereSource::New();</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>
_pcGraphActor->SetPlotSymbol(icurve-1,marker->GetOutput());<BR>
marker->Delete();</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> // Redraw the graph</FONT></DIV>
<DIV><FONT size=2>
<DIV><FONT
size=2>--------------------------------------------------------------------------------------------------------------------</FONT></DIV></FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>================================<BR>S.D.Bulman.<BR>Senior
Research Officer.<BR>University of Wales Swansea.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2><A
href="mailto:S.D.Bulman@swansea.ac.uk">S.D.Bulman@swansea.ac.uk</A></FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>(W) +44 (0)1792 513179<BR>(H) +44 (0)1792
511144<BR>================================<BR></FONT></DIV></BODY></HTML>