Changeset 4603 for vtkvis


Ignore:
Timestamp:
Aug 2, 2014 12:20:58 AM (7 years ago)
Author:
ldelgass
Message:

merge r4060 from trunk

Location:
vtkvis/branches/1.7
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • vtkvis/branches/1.7

  • vtkvis/branches/1.7/LIC.cpp

    r3999 r4603  
    3333    GraphicsObject(),
    3434    _sliceAxis(Z_AXIS),
    35     _colorMap(NULL)
     35    _colorMap(NULL),
     36    _resolution(128)
    3637{
    3738}
     
    230231        int xdim, ydim, zdim;
    231232        double origin[3], spacing[3];
     233        int res = _resolution;
    232234        if (minDir == 0) {
    233235            xdim = 1;
    234             ydim = 128;
    235             zdim = 128;
     236            ydim = res;
     237            zdim = res;
    236238            origin[0] = bounds[0] + xSize/2.;
    237239            origin[1] = bounds[2];
     
    242244            _sliceAxis = X_AXIS;
    243245        } else if (minDir == 1) {
    244             xdim = 128;
     246            xdim = res;
    245247            ydim = 1;
    246             zdim = 128;
     248            zdim = res;
    247249            origin[0] = bounds[0];
    248250            origin[1] = bounds[2] + ySize/2.;
     
    253255            _sliceAxis = Y_AXIS;
    254256        } else {
    255             xdim = 128;
    256             ydim = 128;
     257            xdim = res;
     258            ydim = res;
    257259            zdim = 1;
    258260            origin[0] = bounds[0];
     
    279281        }
    280282        _lic->Update();
    281         vtkSmartPointer<vtkImageCast> cast = vtkSmartPointer<vtkImageCast>::New();
    282         cast->SetInputConnection(_probeFilter->GetOutputPort());
    283         cast->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS,
    284                                      _probeFilter->GetValidPointMaskArrayName());
    285         cast->SetOutputScalarTypeToUnsignedChar();
    286         vtkSmartPointer<vtkImageMask> mask = vtkSmartPointer<vtkImageMask>::New();
    287         mask->SetInputConnection(0, _lic->GetOutputPort());
    288         mask->SetInputConnection(1, cast->GetOutputPort());
    289         _mapper->SetInputConnection(mask->GetOutputPort());
     283        if (1) {
     284            vtkSmartPointer<vtkImageData> imgData = _probeFilter->GetImageDataOutput();
     285            imgData->GetPointData()->SetActiveScalars(_probeFilter->GetValidPointMaskArrayName());
     286            vtkSmartPointer<vtkImageCast> maskCast = vtkSmartPointer<vtkImageCast>::New();
     287            maskCast->SetInputData(imgData);
     288            //maskCast->SetInputConnection(_probeFilter->GetOutputPort());
     289            //maskCast->SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_POINTS,
     290            //                                 _probeFilter->GetValidPointMaskArrayName());
     291            maskCast->SetOutputScalarTypeToUnsignedChar();
     292            vtkSmartPointer<vtkImageCast> licCast = vtkSmartPointer<vtkImageCast>::New();
     293            licCast->SetInputConnection(_lic->GetOutputPort());
     294            licCast->SetOutputScalarTypeToDouble();
     295            vtkSmartPointer<vtkImageMask> mask = vtkSmartPointer<vtkImageMask>::New();
     296            mask->SetInputConnection(0, licCast->GetOutputPort());
     297            mask->SetInputConnection(1, maskCast->GetOutputPort());
     298            _mapper->SetInputConnection(mask->GetOutputPort());
     299        } else {
     300            // Mask not working in VTK 6.1?
     301            _mapper->SetInputConnection(_lic->GetOutputPort());
     302        }
    290303    } else {
    291304        // DataSet is a 3D PolyData with cells
     
    371384        assert(vtkDataSet::SafeDownCast(_probeFilter->GetSource()) != NULL);
    372385        _dataSet->getBounds(bounds);
    373         int dim = 128;
     386        int dim = _resolution;
    374387
    375388        switch (axis) {
  • vtkvis/branches/1.7/LIC.h

    r3621 r4603  
    6767    Axis _sliceAxis;
    6868    ColorMap *_colorMap;
     69    int _resolution;
    6970
    7071    vtkSmartPointer<vtkLookupTable> _lut;
  • vtkvis/branches/1.7/cf/install-sh

  • vtkvis/branches/1.7/cf/mkinstalldirs

Note: See TracChangeset for help on using the changeset viewer.