[vtkusers] vtkPlaneSource

Simon DROUIN sdrouin at bic.mni.mcgill.ca
Fri Feb 20 20:35:21 EST 2004


Call:

SetOfQuadCells->Update()

before trying to get the number of cells. vtk applies a "lazy update"
policy. This means that classes like vtkPlaneSource don't actually build
the geometry until the pipeline they are part of is updated.

-Simon


On Sat, 21 Feb 2004, lisa hughes wrote:

> Hello,
> I have created a vtkPlaneSource object and want to access the quad cells
> created by the plane source
> But first i need to know the number of cells created
> Isnt this just the XResolution times YResolution?? so in my case I should
> get 900 cells?  But the following code outputs 0 cells!! what is wrong with
> what im' doing?  Thanks,
> Lisa
>
> vtkPlaneSource *ColorBlock = vtkPlaneSource::New();
> ColorBlock->SetOrigin(0,0,0);
> ColorBlock->SetPoint1(5,0.5,0);
> ColorBlock->SetPoint2(0,5,0);
> ColorBlock->SetResolution(30,30);
> ColorBlock->SetNormal(0,1,0);
>
>
> vtkPolyData *SetOfQuadCells = vtkPolyData::New();
> SetOfQuadCells = ColorBlock->GetOutput();
> cout<<SetOfQuadCells->GetNumberOfCells();
>
> _________________________________________________________________
> Click, drag and drop. My MSN is the simple way to design your homepage.
> http://click.atdmt.com/AVE/go/onm00200364ave/direct/01/
>
> _______________________________________________
> 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://www.vtk.org/mailman/listinfo/vtkusers
>




More information about the vtkusers mailing list