Thanks David. This error never occured in vtk 5.0, could you explain why?<div>Thanks a lot again.<br><br><div class="gmail_quote">On Fri, Jun 22, 2012 at 5:29 PM, David E DeMarle <span dir="ltr">&lt;<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">vtkSmartPointer&lt;vtkScalarBarWidget&gt; AddPBFEABar(vtkLookupTable&amp;<br>
lut,const char* label, int x, double y)<br>
{<br>
    vtkSmartPointer&lt;vtkScalarBarActor&gt; barActor;<br>
    barActor.TakeReference(vtkScalarBarActor::New());<br>
</div>    ...<br>
    return barActor;<br>
}<br>
<br>
The function is declared to return a vtkScalarBarWidget, but returns<br>
barActor, a vtkScalarBarActor instead.<br>
<div class="im HOEnZb"><br>
David E DeMarle<br>
Kitware, Inc.<br>
R&amp;D Engineer<br>
21 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-881-4909<br>
<br>
<br>
</div><div class="HOEnZb"><div class="h5">On Fri, Jun 22, 2012 at 7:49 AM, Gishara Indeewarie &lt;<a href="mailto:gish.777@gmail.com">gish.777@gmail.com</a>&gt; wrote:<br>
&gt; vtkSmartPointer&lt;vtkScalarBarWidget&gt; AddPBFEABar(vtkLookupTable&amp; lut,const<br>
&gt; char* label, int x, double y)<br>
&gt; {<br>
&gt;     vtkSmartPointer&lt;vtkScalarBarActor&gt; barActor;<br>
&gt;     barActor.TakeReference(vtkScalarBarActor::New());<br>
&gt;     barActor-&gt;SetLookupTable(&amp;lut);<br>
&gt;     barActor-&gt;SetTitle(label);<br>
&gt;<br>
&gt; barActor-&gt;GetPositionCoordinate()-&gt;SetCoordinateSystemToNormalizedViewport();<br>
&gt;     if(false)<br>
&gt;     {<br>
&gt;         barActor-&gt;SetOrientationToVertical();<br>
&gt;         barActor-&gt;GetPositionCoordinate()-&gt;SetValue(0.02,0.3);<br>
&gt;         barActor-&gt;GetPosition2Coordinate()-&gt;SetValue(0.08,0.7);<br>
&gt;     }<br>
&gt;     else<br>
&gt;     {<br>
&gt;         barActor-&gt;SetOrientationToHorizontal();<br>
&gt;         barActor-&gt;GetPositionCoordinate()-&gt;SetValue(0.2,0.1);<br>
&gt;         barActor-&gt;GetPosition2Coordinate()-&gt;SetValue(0.6,0.08);<br>
&gt;     }<br>
&gt;     barActor-&gt;GetTitleTextProperty()-&gt;SetColor(0,0,0);<br>
&gt;     barActor-&gt;GetTitleTextProperty()-&gt;ShadowOff();<br>
&gt;     barActor-&gt;GetTitleTextProperty()-&gt;ItalicOff();<br>
&gt;     barActor-&gt;GetTitleTextProperty()-&gt;SetFontFamilyToArial();<br>
&gt; barActor-&gt;GetLabelTextProperty()-&gt;SetFontFamilyToArial();<br>
&gt; barActor-&gt;GetLabelTextProperty()-&gt;ItalicOff();<br>
&gt; barActor-&gt;GetLabelTextProperty()-&gt;ShadowOff();<br>
&gt; barActor-&gt;GetLabelTextProperty()-&gt;BoldOff();<br>
&gt;     //barActor-&gt;GetLabelTextProperty()-&gt;SetFontSize(8);<br>
&gt;     barActor-&gt;GetLabelTextProperty()-&gt;SetColor(0,0,0);<br>
&gt;     barActor-&gt;SetLabelFormat(&quot;%-#10.3f&quot;);<br>
&gt;     return barActor;<br>
&gt; }<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div></div><font color="#666666">Gish</font><br>
</div>