[vtkusers] vtkScalarBarActor title size

joaoroberto88 joaorobertojr88 at gmail.com
Sat Jun 20 21:46:48 EDT 2015


Hello,

I'm trying to change the title size of a vtkScalarBarActor, but until now I
had no luck. Below is the actor setup:

gridDataPointsBar = vtkSmartPointer<ScalarBar>::New();
gridDataPointsBar->SetTitle(gridData->getName().toStdString().c_str());
gridDataPointsBar->SetNumberOfLabels(4);
gridDataPointsBar->SetWidth(0.2);
gridDataPointsBar->SetHeight(0.5);
gridDataPointsBar->GetTitleTextProperty()->SetFontSize(12); // doesn't have
effect
gridDataPointsBar->SetLookupTable(lut);

Also, I override the vtkScalarBarActor::SizeTitle method to set the size
manually (as described in
http://vtk.1045678.n5.nabble.com/vtkScalarBar-Title-font-issue-tp5051421p5105150.html),
but it's never called. Here goes the class implementation.

class ScalarBar : public vtkScalarBarActor {
public:
    static ScalarBar* New();
    vtkTypeMacro(ScalarBar, vtkScalarBarActor);

private:
    virtual void SizeTitle(double *titleSize, int *size, vtkViewport
*viewport) {
        std::cout << titleSize[0] << size[0] << std::endl; // put a break
point here, but the method isn't called
        vtkScalarBarActor::SizeTitle(titleSize, size, viewport);
    }
    
};

vtkStandardNewMacro(ScalarBar);


Any ideas to solve this problem?

Thanks!



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkScalarBarActor-title-size-tp5732466.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list