[vtkusers] Re: vtkusers digest, Vol 1 #1957 - 9 msgs

furlanis at ele.uri.edu furlanis at ele.uri.edu
Thu Jul 17 10:14:52 EDT 2003


--__--__--

Message: 8
Date: Thu, 17 Jul 2003 11:04:32 +0100
From: grtabor <G.R.Tabor at exeter.ac.uk>
To: vtkusers at vtk.org
Subject: [vtkusers] Problems with ScalarBar

Dear All,

I'm trying to add a vtkScalarBar to a contour plot, but it keeps core dumping
every time I run the programme. The code looks like this :

        colourBarActor = vtkScalarBarActor::New();

        colourBarActor->SetLookupTable(colours);

        colourBarActor->SetTitle("Title");
        
colourBarActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedViewpo
rt();

        colourBarActor->GetPositionCoordinate()->SetValue(0.1,0.01);
        colourBarActor->SetOrientationToHorizontal();
        colourBarActor->SetWidth(0.8);
        colourBarActor->SetHeight(0.15);

        renderer->AddActor2D(colourBarActor);

        renderer->Render();

What am I doing wrong?

Gavin



-------------------------------------------------
*************************************************


i use the scalar bar, and i just use 

renderer->AddActor(scalarBar);

i dont think it needs the '2D', its probably understood. even tho it is a 2D
actor, i think AddActor2D is if you have vtkActor2D. 

-Steve F
-URI



More information about the vtkusers mailing list