Ignore:
Timestamp:
Jan 9, 2012, 1:27:10 AM (13 years ago)
Author:
ldelgass
Message:

Add volume quality command to adjust relative sampling distance (quality is in
[0,1] range and is used to adjust sample distance relative to volume spacing.
Also first pass at supporting point cloud input to volume renderer.

File:
1 edited

Legend:

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

    r2752 r2757  
    17091709    _needsRedraw = true;
    17101710}
     1711
     1712/**
     1713 * \brief Set the sample rate for the volume shader
     1714 *
     1715 * Smaller values will give better rendering at the cost
     1716 * of slower rendering
     1717 */
     1718void Renderer::setVolumeSampleDistance(const DataSetId& id, double distance)
     1719{
     1720    VolumeHashmap::iterator itr;
     1721
     1722    bool doAll = false;
     1723
     1724    if (id.compare("all") == 0) {
     1725        itr = _volumes.begin();
     1726        doAll = true;
     1727    } else {
     1728        itr = _volumes.find(id);
     1729    }
     1730    if (itr == _volumes.end()) {
     1731        ERROR("Volume not found: %s", id.c_str());
     1732        return;
     1733    }
     1734
     1735    do {
     1736        distance *= itr->second->getAverageSpacing();
     1737        itr->second->setSampleDistance((float)distance);
     1738    } while (doAll && ++itr != _volumes.end());
     1739
     1740    _needsRedraw = true;
     1741}
Note: See TracChangeset for help on using the changeset viewer.