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"><<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></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<vtkScalarBarWidget> AddPBFEABar(vtkLookupTable&<br>
lut,const char* label, int x, double y)<br>
{<br>
vtkSmartPointer<vtkScalarBarActor> 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&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 <<a href="mailto:gish.777@gmail.com">gish.777@gmail.com</a>> wrote:<br>
> vtkSmartPointer<vtkScalarBarWidget> AddPBFEABar(vtkLookupTable& lut,const<br>
> char* label, int x, double y)<br>
> {<br>
> vtkSmartPointer<vtkScalarBarActor> barActor;<br>
> barActor.TakeReference(vtkScalarBarActor::New());<br>
> barActor->SetLookupTable(&lut);<br>
> barActor->SetTitle(label);<br>
><br>
> barActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();<br>
> if(false)<br>
> {<br>
> barActor->SetOrientationToVertical();<br>
> barActor->GetPositionCoordinate()->SetValue(0.02,0.3);<br>
> barActor->GetPosition2Coordinate()->SetValue(0.08,0.7);<br>
> }<br>
> else<br>
> {<br>
> barActor->SetOrientationToHorizontal();<br>
> barActor->GetPositionCoordinate()->SetValue(0.2,0.1);<br>
> barActor->GetPosition2Coordinate()->SetValue(0.6,0.08);<br>
> }<br>
> barActor->GetTitleTextProperty()->SetColor(0,0,0);<br>
> barActor->GetTitleTextProperty()->ShadowOff();<br>
> barActor->GetTitleTextProperty()->ItalicOff();<br>
> barActor->GetTitleTextProperty()->SetFontFamilyToArial();<br>
> barActor->GetLabelTextProperty()->SetFontFamilyToArial();<br>
> barActor->GetLabelTextProperty()->ItalicOff();<br>
> barActor->GetLabelTextProperty()->ShadowOff();<br>
> barActor->GetLabelTextProperty()->BoldOff();<br>
> //barActor->GetLabelTextProperty()->SetFontSize(8);<br>
> barActor->GetLabelTextProperty()->SetColor(0,0,0);<br>
> barActor->SetLabelFormat("%-#10.3f");<br>
> return barActor;<br>
> }<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div></div><font color="#666666">Gish</font><br>
</div>