[vtkusers] Problem of ShallowCopy with vtkWindowedSincPolyDataFilter

Yang, Jinzhong jinzhong76 at gmail.com
Mon May 18 13:34:20 EDT 2009


Hi All,

I have a problem when I use ShallowCopy to copy data from the output of
vtkWindowedSincPolyDataFilter. Following is my code:

    vtkPolyData* InterimOutput;
    .
    .
    vtkWindowedSincPolyDataFilter* smoother =
vtkWindowedSincPolyDataFilter::New();
    smoother->SetInput(InterimOutput);
    smoother->GenerateErrorVectorsOn();
    smoother->NormalizeCoordinatesOn();
    smoother->BoundarySmoothingOn();

    smoother->SetNumberOfIterations(this->NumberOfSmoothingIterations);
    smoother->SetFeatureEdgeSmoothing(this->SmoothingFeatureEdge);
    smoother->SetFeatureAngle(this->SmoothingFeatureAngle);
    smoother->SetEdgeAngle(this->SmoothingEdgeAngle);
    smoother->SetPassBand(this->SmoothingPassBand);
    smoother->Update();

    InterimOutput->Reset();
    InterimOutput->ShallowCopy(smoother->GetOutput()); <--The data in
smoother cannot be copied to InterimOutput

While I use vtkPolyDataNormals after the smoothing, then the ShallowCopy is
fine:
    .
    .
    vtkWindowedSincPolyDataFilter* smoother =
vtkWindowedSincPolyDataFilter::New();
    smoother->SetInput(InterimOutput);
    smoother->GenerateErrorVectorsOn();
    smoother->NormalizeCoordinatesOn();
    smoother->BoundarySmoothingOn();

    smoother->SetNumberOfIterations(this->NumberOfSmoothingIterations);
    smoother->SetFeatureEdgeSmoothing(this->SmoothingFeatureEdge);
    smoother->SetFeatureAngle(this->SmoothingFeatureAngle);
    smoother->SetEdgeAngle(this->SmoothingEdgeAngle);
    smoother->SetPassBand(this->SmoothingPassBand);
    smoother->Update();

    vtkPolyDataNormals * normals = vtkPolyDataNormals::New();
    normals->SetInputConnection(smoother->GetOutputPort());
    normals->SetFeatureAngle(this->PolyNormalsFeatureAngle);
    normals->Update();

    InterimOutput->Reset();
    InterimOutput->ShallowCopy(normals->GetOutput()); <-- The data here can
be copied successfully
    
Could anybody help me solve this problem? I need to copy the data directly
from vtkWindowedSincPolyDataFilter. 
Thanks a lot!

Jinzhong

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090518/3c025f07/attachment.htm>


More information about the vtkusers mailing list