[vtkusers] Fwd: Re:AW: vtkContourFilter notworkingonvtkStructuredGrid

Rakesh Patil rakeshthp at in.com
Fri Mar 12 05:59:45 EST 2010


 Try once again... Check code properly.. It should work.. else your data may be having some problem.. ThanksRegardsRakesh Patil Original message From:Sebastian Gatzka< sebastian.gatzka at stud.tudarmstadt.de >Date: 12 Mar 10 15:57:21Subject:Re: [vtkusers] Fwd: Re:AW: vtkContourFilter notworkingonvtkStructuredGridTo: vtkusers Yes. Of Course I tried that. Nothing changes.Am 12.03.2010 11:19, schrieb Rakesh Patil:Hi,Have you tried implementing what i told you.???scalarIsoSurface>GenerateValues( 10, sGrid>GetScalarRange() );this will solve your problem... As i told u before, there is no other prob i could figure out other than this.. GenerateValues takes three parameters, i.e.1. Number of contour lines, 2. min. value(of range) 3. max value(of range)It also takes two parameters.. in this case 2nd parameter is double array consisting two elements..ThanksRegards Rakesh Patil Original message  From:Sebastian Gatzka< sebastian.gatzka at stud.tudarmstadt.de > Date: 12 Mar 10 15:40:22 Subject
 : Re: [vtkusers] Fwd: Re:AW: vtkContourFilter not workingonvtkStructuredGrid To: vtkusers Hi again.Attached you will find the code that should produce the iso surface, but displays nothing. I even tried to apply the vtkAssignAttribute frinxor at gmail.com suggested ... Nothing changes.Hope you will find the mistake. Have a nice day. SebastianAm 10.03.2010 15:50, schrieb Rakesh Patil: 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 output isosurfaces and/or isolines. So that is not a problem..Can u just get you final code what u have coded..??ThanksRegards Rakesh Patil  Original message  From:Sebastian Gatzka< sebastian.gatzka at stud.tudarmstadt.de > Date: 10 Mar 10 17:43:19 Subject: [vtkusers] Fwd: Re:AW: vtkContourFilter not working onvtkStructuredGrid To: 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 vtkContourFiltervtkContourFilter *scalarIsoSurface vtkContourFilter::New(); scalarIsoSurface>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 a
 rray 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 whats 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/20100312/1ca0e6bc/attachment.htm>


More information about the vtkusers mailing list