[vtkusers] Help with vtkDataSetSurfaceFilter
Adriano Gagliardi
agagliardi at ara.co.uk
Thu May 27 09:16:33 EDT 2010
Spot on, David.
I have been switching data set types all day and forgot my input
dataset is actually structured, not unstructured. The pointer returned
from the cast was therefore NULL, hence the error using
vtkDataSetSurfaceFilter.
Putting a check in now to make sure it doesn't happen again.
Thanks for the help again!
Adriano
===================================
Adriano Gagliardi MEng PhD
Business Sector Leader
Computational Aerodynamics
Aircraft Research Association Ltd.
Manton Lane
Bedford
Tel: 01234 32 4644
E-mail: agagliardi at ara.co.uk
Url: www.ara.co.uk
-----Original Message-----
From: daviddoria at gmail.com [mailto:daviddoria at gmail.com] On Behalf Of David
Doria
Sent: 27 May 2010 14:03
To: agagliardi at ara.co.uk
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] Help with vtkDataSetSurfaceFilter
On Thu, May 27, 2010 at 5:38 AM, Adriano Gagliardi <agagliardi at ara.co.uk>
wrote:
>
> Dear All,
>
> I'm trying to convert an unstructured surface mesh to poly data format
> with vtkDataSetSurfaceFilter, but I'm getting the following error:
>
> vtkStreamingDemandDrivenPipeline (0x1940cec0): Input port 0 of
> algorithm
> vtkDataSetSurfaceFilter(0x19460f70) has 0 connections but is not
> optional
>
> The code is as below:
>
> for ( int j = 0; j != input->GetNumberOfBlocks(); ++j ) {
> vtkUnstructuredGrid* surf =
> vtkUnstructuredGrid::SafeDownCast(input->GetBlock(j));
> vtkDataSetSurfaceFilter* polySurf =
> vtkDataSetSurfaceFilter::New();
> polySurf->SetInput(surf);
> polySurf->Update();
> input->SetBlock(j, polySurf->GetOutput());
> polySurf->Delete();
> }
>
> Cheers,
>
> Adriano
>
> p.s. I notice there is a problem with the VTK Examples website,
> otherwise I'd have had a look there first.
>
> ===================================
>
> Adriano Gagliardi MEng PhD
The kitware site seems to be back up.
You're usage seems to be identical to this:
http://www.vtk.org/Wiki/VTK/Examples/PolyData/DataSetSurfaceFilter
I'm not sure if 'surf' being NULL would product that error? Can you try
compiling a very short program in which you read a vtu and try to run it
through vtkDataSetSurfaceFilter? And in your current code, try
if(!surf)
std::cout << "surf is NULL" << std::endl;
Thanks,
David
**********************************************************************
This email contains information that is private and confidential and is intended only for the addressee.
If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.
Note: All email sent to or from this address may be accessed by someone other than the recipient, for
system management and security reasons.
Aircraft Research Association Ltd. Registered in England, Registration No 503668 Registered Office:
Manton Lane, Bedford MK41 7PF England VAT No GB 196351245
**********************************************************************
More information about the vtkusers
mailing list