[vtkusers] problem changing values in vtkPoints

C. Aaron Cois cacst11+ at pitt.edu
Thu Jul 18 14:45:03 EDT 2002


I tried calling that right after the for loop in which the ponts are
accessed and changed.  Here is a code segment:

 for(int j = 0;j < points->GetNumberOfPoints();j++)
 {
          point_locs = points->GetPoint(j);

          point_locs[0] *= LengthFactor;
          point_locs[1] *= LengthFactor;
          point_locs[2] *= LengthFactor;

          points->SetPoint(j,point_locs[0],point_locs[1],point_locs[2]);
 }//end for
points->Modified();


This produces no change, as far as i can tell.

points is a vtkPoints object, and point_locs is a float *.  If i am reading
the documentation correctly, the SetPoint call should not veen be necessary,
because point_locs will become a pointer to the actual data, but i put it in
there just to be sure. I am doing a similar thing in another function,
accessing the actors and resetting the diffuse color using
SetDiffuseColor...what this tells me is that it is ulikely a redrawing error
in my application, since the color change is updating.   Any other thoughts?


Aaron

----- Original Message -----
From: "Kevin Wright" <krw at viz-solutions.com>
To: <vtkusers at public.kitware.com>
Sent: Thursday, July 18, 2002 2:11 PM
Subject: Re: [vtkusers] problem changing values in vtkPoints


>
> >I need to be able to later change the values in the individual points, to
> >shorten and lengthen the lines.  Recreating the actor, grid, mapper, etc,
> >gets very time consuming, so i figured i could just go back through the
> >actor, mapper, grid, and vtkPoints to get each point by using:
> >
> >I am able to retrieve the points find with GetPoint(), but SetPoint does
> >not appear to be changing the values.  Is there any other way to do this
> >without recreating the actor and all of its components?
>
> Are you calling vtkPoints::Modified() after you make your changes?  That
> will trigger the update mechanism to rebuild the pipeline.
>
> Kevin.
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list