Changeset 2264 for trunk


Ignore:
Timestamp:
May 27, 2011 2:16:22 PM (13 years ago)
Author:
ldelgass
Message:

Crash fix for filtering 3D point set to PolyData?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vtkvis/RpPolyData.cpp

    r2261 r2264  
    1010#include <vtkDataSet.h>
    1111#include <vtkPolyData.h>
    12 #include <vtkDataSetMapper.h>
    1312#include <vtkUnstructuredGrid.h>
    1413#include <vtkPolyDataMapper.h>
     
    132131                vtkSmartPointer<vtkDelaunay3D> mesher = vtkSmartPointer<vtkDelaunay3D>::New();
    133132                mesher->SetInput(pd);
    134                 // Delaunay3D returns an UnstructuredGrid, so feed it through a generic mapper
     133                // Delaunay3D returns an UnstructuredGrid, so feed it through a surface filter
    135134                // to get the grid boundary as a PolyData
    136                 vtkSmartPointer<vtkDataSetMapper> dsMapper = vtkSmartPointer<vtkDataSetMapper>::New();
    137                 dsMapper->SetInput(mesher->GetOutput());
    138                 dsMapper->StaticOn();
    139                 _pdMapper = dsMapper->GetPolyDataMapper();
    140                 _pdMapper->SetResolveCoincidentTopologyToPolygonOffset();
    141                 _pdMapper->ScalarVisibilityOff();
     135                vtkSmartPointer<vtkDataSetSurfaceFilter> gf = vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
     136                gf->SetInput(mesher->GetOutput());
     137                gf->Update();
     138                pd = gf->GetOutput();
     139                assert(pd);
     140                _pdMapper->SetInput(pd);
    142141            }
    143142        } else {
Note: See TracChangeset for help on using the changeset viewer.