<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19154"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>Hello,</DIV>
<DIV> </DIV>
<DIV>I have been using the vtkChartXY in previous release versions for a while now without any problems. However, I recently upgraded to VTK 5.8 and I having some difficulties. I am wondering if it has anything to do with the vtkChartXY::SetTitle being changed from a "const char* title" to a "const vtkStdString &title" -- but I am just guessing.</DIV>
<DIV> </DIV>
<DIV>At any rate, I create the vtkChartXY using a vtkSmartPointer and the axis get their titles initialized to "X Axis" and "Y Axis" without any difficulties. However, when I go to change the Axis titles or the chart title to something useful, I get an unhandled exception: access violation. I tried to change the input from a quoted string to an actual vtkStdString but it crashes as well. I saw a post online (<A href="http://vtk.org/pipermail/vtkusers/2011-May/116473.html">http://vtk.org/pipermail/vtkusers/2011-May/116473.html</A>) that this is due to mismatched build types, but I build VTK with RelWithDebInfo and my project is build with RelWithDebInfo.</DIV>
<DIV> </DIV>
<DIV>I am working with VTK 5.8 Release Tag, on Windows XP 32Bit and using MSVC2010 and Qt 4.7.2.</DIV>
<DIV> </DIV>
<DIV>Here is my code:</DIV>
<DIV> </DIV>
<DIV> <STRONG>In Header:</STRONG></DIV>
<DIV> <FONT face="Courier New">vtkSmartPointer<vtkChartXY> m_Chart;</FONT></DIV>
<DIV> </DIV>
<DIV> <STRONG> In Source:</STRONG></DIV>
<DIV><FONT face="Courier New"> m_Chart = vtkSmartPointer<vtkChartXY>::New();</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> m_Chart->SetShowLegend(true);</FONT></DIV>
<DIV><FONT face="Courier New"></FONT><FONT face="Courier New"><BR> //const vtkStdString xAxisLabel = "Index";<BR> //m_Chart->GetAxis(vtkAxis::BOTTOM)->SetTitle(xAxisLabel);<BR> m_Chart->GetAxis(vtkAxis::BOTTOM)->SetTitle("Index");<BR> //const vtkStdString yAxisLabel = "Position (mm)";<BR> //m_Chart->GetAxis(vtkAxis::LEFT)->SetTitle(yAxisLabel);<BR> m_Chart->GetAxis(vtkAxis::LEFT)->SetTitle("Position (mm)");</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV><FONT face="Courier New"> if( this->getName().isEmpty() ) // Note: getName() returns a QString<BR> {<BR> const vtkStdString title = "Position Data";<BR> m_Chart->SetTitle(title);<BR> }<BR> else<BR> {<BR> const vtkStdString title = "Position Data - " + this->getName().toStdString();<BR> m_Chart->SetTitle(title);<BR> }</FONT></DIV>
<DIV><FONT face="Courier New"></FONT> </DIV>
<DIV>Any help is appreciated!</DIV>
<DIV> </DIV>
<DIV>Thanks.</DIV>
<DIV>Andrew</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>
<P>---------------------------------------------------------------<BR>1981-2011: Celebrating 30 Years of Innovation<BR>Follow us on Twitter: <A href="http://twitter.com/#!/NDIMedResearch">@NDIMedResearch</A></P>Andrew D. Wiles, PhD, PEng<BR>Research Scientist, Medical Division<BR>NDI<BR>103 Randall Drive<BR>Waterloo, ON, Canada, N2V 1C5<BR>Telephone: +1 (519) 884-5142 ext. 314<BR>Toll Free: +1 (877) 634-6340<BR>Global: ++ (800) 634-634-00<BR>Facsimile: +1 (519) 884-5184<BR>Website: <A href="http://www.ndigital.com/">www.ndigital.com</A></DIV>
<DIV><BR><IMG src="cid:EEHYWZVQZCFH.IMAGE_14.BMP"></DIV>
<DIV>--------------------</DIV></BODY></HTML>