Changeset 2761 for trunk


Ignore:
Timestamp:
Jan 12, 2012, 2:35:17 PM (13 years ago)
Author:
ldelgass
Message:

Fix cutplane colormapping when gaussian splatter is used to convert point cloud
to volume. Note that splatter only works on the active scalar field, so the
colormode subcommand can not be used on vector fields or to change scalar
fields, instead the dataset scalar command must be used to change the active
scalar field.

Location:
trunk/packages/vizservers/vtkvis
Files:
2 edited

Legend:

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

    r2760 r2761  
    231231            }
    232232#else
    233             vtkSmartPointer<vtkGaussianSplatter> splatter = vtkSmartPointer<vtkGaussianSplatter>::New();
    234             splatter->SetInput(pd);
     233            if (_splatter == NULL) {
     234                _splatter = vtkSmartPointer<vtkGaussianSplatter>::New();
     235            }
     236            _splatter->SetInput(pd);
    235237            int dims[3];
    236             splatter->GetSampleDimensions(dims);
     238            _splatter->GetSampleDimensions(dims);
    237239            TRACE("Sample dims: %d %d %d", dims[0], dims[1], dims[2]);
    238240            if (plane == PLANE_ZY) {
     
    243245                dims[2] = 3;
    244246            }
    245             splatter->SetSampleDimensions(dims);
     247            _splatter->SetSampleDimensions(dims);
    246248            for (int i = 0; i < 3; i++) {
    247                 _cutter[i]->SetInputConnection(splatter->GetOutputPort());
     249                _cutter[i]->SetInputConnection(_splatter->GetOutputPort());
    248250                vtkSmartPointer<vtkDataSetSurfaceFilter> gf = vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
    249251                gf->UseStripsOn();
     
    267269            }
    268270#else
    269             vtkSmartPointer<vtkGaussianSplatter> splatter = vtkSmartPointer<vtkGaussianSplatter>::New();
    270             splatter->SetInput(pd);
     271            if (_splatter == NULL) {
     272                _splatter = vtkSmartPointer<vtkGaussianSplatter>::New();
     273            }
     274            _splatter->SetInput(pd);
    271275            int dims[3];
    272276            dims[0] = dims[1] = dims[2] = 64;
    273277            TRACE("Generating volume with dims (%d,%d,%d) from point cloud",
    274278                  dims[0], dims[1], dims[2]);
    275             splatter->SetSampleDimensions(dims);
     279            _splatter->SetSampleDimensions(dims);
    276280            for (int i = 0; i < 3; i++) {
    277                 _cutter[i]->SetInputConnection(splatter->GetOutputPort());
     281                _cutter[i]->SetInputConnection(_splatter->GetOutputPort());
    278282                vtkSmartPointer<vtkDataSetSurfaceFilter> gf = vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
    279283                gf->UseStripsOn();
     
    527531    }
    528532
    529     if (name != NULL && strlen(name) > 0) {
     533    if (_splatter != NULL) {
     534        for (int i = 0; i < 3; i++) {
     535            _mapper[i]->SelectColorArray("SplatterValues");
     536        }
     537    } else if (name != NULL && strlen(name) > 0) {
    530538        for (int i = 0; i < 3; i++) {
    531539            _mapper[i]->SelectColorArray(name);
  • trunk/packages/vizservers/vtkvis/RpCutplane.h

    r2760 r2761  
    1717#include <vtkPlane.h>
    1818#include <vtkOutlineFilter.h>
     19#include <vtkGaussianSplatter.h>
    1920
    2021#include "ColorMap.h"
     
    108109    vtkSmartPointer<vtkPlane> _cutPlane[3];
    109110    vtkSmartPointer<vtkOutlineFilter> _outlineFilter[3];
     111    vtkSmartPointer<vtkGaussianSplatter> _splatter;
    110112};
    111113
Note: See TracChangeset for help on using the changeset viewer.