[vtkusers] How to set the scalars of points which come from vtkSource class?

Amy Henderson amy.henderson at kitware.com
Tue May 18 10:47:59 EDT 2004


You need to call Update() on the cube source before you modify its 
output.  Add the line
cube->Update();
after you create the cube source object.

- Amy

At 10:41 AM 5/18/2004, OrNot wrote:
>hi,all:
>    I have a problem when I programmed with the vtkSource class.
>    I wanted to produce a simple cube from vtkCubeSource and
>then insert the scalars to its 8 points. It seems easy like
>this:
>
>
>    vtkCubeSource  *cube=vtkCubeSource::New();
>
>    for (int i=0; i<8; i++) scalarstemp->InsertTuple1(i,i);
>    cube->GetOutput()->GetPointData()->SetScalars(scalarstemp);
>    scalarstemp->Delete();
>
>
>
>
>
>  But the codes always work not well.The method setscalars failed to set
>the scalars.
>
>  Need your help.
>  Thank you in advance.
>
>                          OrNotáŠÈ¬¶©®+ÚµåS)جrë,Š‰åŠËO•æ¬zGž¦g¬±¨²‰í¢˜œ 
> œ’Ø^¶m§ÿé¹¹brH­ÁªÞr‰¿r›Šï¶GÚ¨Z%­Œ-†+%Šy-¢Ë›±ÊâmïîžË›±Êâmèm¶ŸÿÃ/¶J+ƒùšŠYšŸùb²Ø§~ï¶K¬z» 
>






More information about the vtkusers mailing list