[vtkusers] Fwd: Re:AW: vtkContourFilter not working onvtkStructuredGrid
Rakesh Patil
rakeshthp at in.com
Wed Mar 10 09:50:44 EST 2010
Well, i dont think anything is wrongAccording to this,http://www.vtk.org/doc/nightly/html/classvtkContourFilter.htmlvtkContourFilter is a filter that takes as input any dataset and generates on outputisosurfaces and/or isolines. So that is not a problem..Can u just get you final code what u have coded..??ThanksRegardsRakesh Patil Original message From:Sebastian Gatzka< sebastian.gatzka at stud.tudarmstadt.de >Date: 10 Mar 10 17:43:19Subject:[vtkusers] Fwd: Re:AW: vtkContourFilter not working onvtkStructuredGridTo: vtkusers at vtk.orgNo, this doesn't work out. I put Update()'s at every (possible) object but nothing happens.Even chaning SetValue() and GenerateValues() doesn't change that. So maybe there is something wrong with the data?!I have a structured grid (called sGrid) and the scalar values are defined at the cell centers:sGrid>GetCellData()>SetScalars(T);But I just pass the sGrid to the vtkContourFilter vtkContourFilter *scalarIsoSurface vtkContourFilter::New(); scalarIsoSur
face>SetInput(sGrid);May this be the problem? OriginalNachricht Betreff:Re:AW: [vtkusers] vtkContourFilter not working on vtkStructuredGrid Datum:Sat, 06 Mar 2010 09:34:59 +0530 Von:Rakesh PatilAntwort an:Rakesh PatilAn:Sebastian Gatzka Hi Sebastian,I see there is a small mistake over there in your code..As far as my knowledge is concerned, scalarIsoSurface>GenerateValues(0,0.1);This statement should produce error. Coz, according to the documentation given herehttp://www.vtk.org/doc/release/5.4/html/a00323.htmlGenerateValues takes two parameters if and only if second parameter is a double array comprising of two elements min and max range.Even if this code executes without any error, then also no output will be produced, because the first argument you are passing is 0. First parameter tells the number of contours to be generated, Second parameter tells within what range these contours should be plotted.What i guess is, either you change it that statement t oscalarIsoSurface
>SetValue(0, 0.1);orscalarIsoSurface>GenerateValues( n, sGrid>GetScalarRange() );where n is number of lines you want, say 1, 5, 10, 12... whatever...And then say update.. Am i correct David Sir..??Thanks RegardsRakesh Patil Original message From:"Sebastian Gatzka"< sebastian.gatzka at stud.tudarmstadt.de > Date: 05 Mar 10 22:50:50 Subject: AW: [vtkusers] vtkContourFilter not working on vtkStructuredGrid To: "'Rakesh Patil'"Hm. The >Update() did not work out. What can be wrong? How can the data be not fed correctly?Von: Rakesh Patil [mailto:rakeshthp at in.com]Gesendet: Freitag, 5. M¤rz 2010 16:25 An: David Doria Cc: Sebastian Gatzka; vtkusers at vtk.org Betreff: Re: [vtkusers] vtkContourFilter not working on vtkStructuredGrid Ya, I had also done the same mistake... I had ommitted that update statement.. By putting that update statement is should definitley work.. (only if data is fed correctly) Original message From:David Doria< daviddoria+vtk at gmail.com > Date: 05 Mar 10 19:26:03
Subject: Re: [vtkusers] vtkContourFilter not working on vtkStructuredGrid To: Sebastian Gatzka On Fri, Mar 5, 2010 at 8:41 AM, Sebastian Gatzkawrote:Hello.I really can't tell why my code is not gernerating the isosurface. I have a structured grid (sGrid) filled with scalars.I call the contour filtervtkContourFilter *scalarIsoSurface vtkContourFilter::New(); scalarIsoSurface>SetInput(sGrid); scalarIsoSurface>GenerateValues(0,0.1);Compute the normalvtkPolyDataNormals *sGridPolyDataNormal vtkPolyDataNormals::New(); sGridPolyDataNormal>SetInput(scalarIsoSurface>GetOutput());Put them into a poly data mappervtkPolyDataMapper *scalarIsoSurfaceMapper vtkPolyDataMapper::New(); scalarIsoSurfaceMapper>SetInput(sGridPolyDataNormal>GetOutput());and into an actorvtkActor *scalarIsoSurfaceActor = vtkActor::New(); scalarIsoSurfaceActor>SetMapper(scalarIsoSurfaceMapper);which is passed on to the sceneren1>AddActor(scalarIsoSurfaceActor);and NOTHING happens.Any ideas what I have missed, or w
hats wrong?Sebastian You probably have a call to Render() after the code you sent us, which I believe updates the whole pipeline. Whenever I have something that is totally empty, I go back and put an Update() call on every object that is updatable. scalarIsoSurface>GenerateValues(0,0.1); scalarIsoSurface>Update(); before I dig too deep. If that doesn't change anything, try to create a demo involving some simple data (using a vtk*Source if you can, so we can reproduce it without needing your dataset). Then send us the smallest compilable code that demonstrates the problem. Thanks,David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100310/b85abc10/attachment.htm>
More information about the vtkusers
mailing list