[vtkusers] upgrade vtk from vtk 5.0 to 5.8

David E DeMarle dave.demarle at kitware.com
Fri Jun 22 07:59:16 EDT 2012


vtkSmartPointer<vtkScalarBarWidget> AddPBFEABar(vtkLookupTable&
lut,const char* label, int x, double y)
{
    vtkSmartPointer<vtkScalarBarActor> barActor;
    barActor.TakeReference(vtkScalarBarActor::New());
    ...
    return barActor;
}

The function is declared to return a vtkScalarBarWidget, but returns
barActor, a vtkScalarBarActor instead.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Fri, Jun 22, 2012 at 7:49 AM, Gishara Indeewarie <gish.777 at gmail.com> wrote:
> vtkSmartPointer<vtkScalarBarWidget> AddPBFEABar(vtkLookupTable& lut,const
> char* label, int x, double y)
> {
>     vtkSmartPointer<vtkScalarBarActor> barActor;
>     barActor.TakeReference(vtkScalarBarActor::New());
>     barActor->SetLookupTable(&lut);
>     barActor->SetTitle(label);
>
> barActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewport();
>     if(false)
>     {
>         barActor->SetOrientationToVertical();
>         barActor->GetPositionCoordinate()->SetValue(0.02,0.3);
>         barActor->GetPosition2Coordinate()->SetValue(0.08,0.7);
>     }
>     else
>     {
>         barActor->SetOrientationToHorizontal();
>         barActor->GetPositionCoordinate()->SetValue(0.2,0.1);
>         barActor->GetPosition2Coordinate()->SetValue(0.6,0.08);
>     }
>     barActor->GetTitleTextProperty()->SetColor(0,0,0);
>     barActor->GetTitleTextProperty()->ShadowOff();
>     barActor->GetTitleTextProperty()->ItalicOff();
>     barActor->GetTitleTextProperty()->SetFontFamilyToArial();
> barActor->GetLabelTextProperty()->SetFontFamilyToArial();
> barActor->GetLabelTextProperty()->ItalicOff();
> barActor->GetLabelTextProperty()->ShadowOff();
> barActor->GetLabelTextProperty()->BoldOff();
>     //barActor->GetLabelTextProperty()->SetFontSize(8);
>     barActor->GetLabelTextProperty()->SetColor(0,0,0);
>     barActor->SetLabelFormat("%-#10.3f");
>     return barActor;
> }



More information about the vtkusers mailing list