[vtkusers] vtkContourFilter not working on vtkStructuredGrid

KS Jothybasu jothybasu at gmail.com
Fri Mar 12 04:45:43 EST 2010


Yes, you are correct.

I should be GenerateValues(NumOfContours,Range)

Jothy

On Thu, Mar 11, 2010 at 7:24 PM, Darshan Pai <darshanpai at gmail.com> wrote:

> just wondering. The first parameter to the GenerateValues(). Isn't it the
> number of contours that you want?
>
> You have set it to zero . so no contours will be drawn ..
>
> Regards
> Darshan
>
> On Thu, Mar 11, 2010 at 10:51 AM, da <frinxor at gmail.com> wrote:
>
>> Try a vtkAssignAttribute filter before the contour filter.
>>
>> vtkAssignAttribute assignFilter = vtkAssignAttribute::New();
>> assignFilter->SetInput(sGrid);
>> assignFilter->Assign( {your scalar array name},
>> vtkDataSetAttributes::Scalars, vtkAssignAttribute::CELL_DATA);
>>
>> ...
>> scalarIsoSurface->SetInputConnection(assginFilter->GetOutputPort() );
>>
>>
>> On Fri, Mar 5, 2010 at 6:41 AM, Sebastian Gatzka <
>> sebastian.gatzka at stud.tu-darmstadt.de> wrote:
>>
>>>  Hello.
>>>
>>> I really can't tell why my code is not gernerating the iso-surface.
>>> I have a structured grid (sGrid) filled with scalars.
>>>
>>> I call the contour filter
>>>
>>>             vtkContourFilter *scalarIsoSurface = vtkContourFilter::New();
>>>             scalarIsoSurface->SetInput(sGrid);
>>>             scalarIsoSurface->GenerateValues(0,0.1);
>>>
>>> Compute the normal
>>>
>>>             vtkPolyDataNormals *sGridPolyDataNormal =
>>> vtkPolyDataNormals::New();
>>>             sGridPolyDataNormal->SetInput(scalarIsoSurface->GetOutput());
>>>
>>> Put them into a poly data mapper
>>>
>>>             vtkPolyDataMapper *scalarIsoSurfaceMapper =
>>> vtkPolyDataMapper::New();
>>>
>>> scalarIsoSurfaceMapper->SetInput(sGridPolyDataNormal->GetOutput());
>>>
>>> and into an actor
>>>
>>>             vtkActor *scalarIsoSurfaceActor = vtkActor::New();
>>>             scalarIsoSurfaceActor->SetMapper(scalarIsoSurfaceMapper);
>>>
>>> which is passed on to the scene
>>>
>>>             ren1->AddActor(scalarIsoSurfaceActor);
>>>
>>> and NOTHING happens.
>>>
>>> Any ideas what I have missed, or whats wrong?
>>>
>>> Sebastian
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Please keep messages on-topic and check the VTK FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100312/41698e28/attachment.htm>


More information about the vtkusers mailing list