Ignore:
Timestamp:
Feb 23, 2013, 2:20:57 PM (12 years ago)
Author:
ldelgass
Message:

Use PolyDataNormals? to compute normals for isosurfaces since ContourFilter?
doesn't produce normals for unstructured or structured grids.

Location:
branches/Rappture 1.2/packages/vizservers/vtkvis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpContour3D.cpp

    r3309 r3327  
    165165    }
    166166
    167     _contourFilter->ComputeNormalsOn();
     167    _contourFilter->ComputeNormalsOff();
    168168    _contourFilter->ComputeGradientsOff();
    169169
     
    189189    initProp();
    190190
     191    if (_normalsGenerator == NULL) {
     192        _normalsGenerator = vtkSmartPointer<vtkPolyDataNormals>::New();
     193    }
     194
     195    _normalsGenerator->SetInputConnection(_contourFilter->GetOutputPort());
     196    _normalsGenerator->SetFeatureAngle(90.);
     197    _normalsGenerator->AutoOrientNormalsOff();
     198    _normalsGenerator->ComputePointNormalsOn();
     199
    191200    if (_dsMapper == NULL) {
    192201        _dsMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
    193202        _dsMapper->SetResolveCoincidentTopologyToPolygonOffset();
    194         _dsMapper->SetInputConnection(_contourFilter->GetOutputPort());
     203        _dsMapper->SetInputConnection(_normalsGenerator->GetOutputPort());
    195204        _dsMapper->ScalarVisibilityOff();
    196205        //_dsMapper->SetColorModeToMapScalars();
  • branches/Rappture 1.2/packages/vizservers/vtkvis/RpContour3D.h

    r3223 r3327  
    1111#include <vtkSmartPointer.h>
    1212#include <vtkContourFilter.h>
     13#include <vtkPolyDataNormals.h>
    1314#include <vtkLookupTable.h>
    1415#include <vtkPolyDataMapper.h>
     
    103104    vtkSmartPointer<vtkLookupTable> _lut;
    104105    vtkSmartPointer<vtkContourFilter> _contourFilter;
     106    vtkSmartPointer<vtkPolyDataNormals> _normalsGenerator;
    105107    vtkSmartPointer<vtkPolyDataMapper> _dsMapper;
    106108};
Note: See TracChangeset for help on using the changeset viewer.