Added hull="hul-filename" property support to <volume> tag that can used thus:

<layer>
            <volume renderer="MultiPass" hull="cow.osgt.0,-2,-4.trans.50,50,50.scale">CardiacCT</volume>
        </layer>
This commit is contained in:
Robert Osfield 2014-01-16 17:17:37 +00:00
parent 1264ec736a
commit e8cd06c6e9
3 changed files with 16 additions and 0 deletions

View File

@ -328,6 +328,7 @@ public:
osg::ColorSpaceOperation colorSpaceOperation;
osg::Vec4 colorModulate;
Technique technique;
std::string hull;
};

View File

@ -1307,6 +1307,12 @@ void ReaderWriterP3DXML::parseVolume(osgPresentation::SlideShowConstructor& cons
else if (renderer=="MultiPass") volumeData.technique = osgPresentation::SlideShowConstructor::VolumeData::MultiPass;
}
std::string hull;
if (getProperty(cur, "hull", hull))
{
volumeData.hull = hull;
}
if (getProperty(cur, "alpha", volumeData.alphaValue)) {}
if (getProperty(cur, "cutoff", volumeData.cutoffValue)) {}
if (getProperty(cur, "region", volumeData.region)) {}

View File

@ -2816,6 +2816,15 @@ void SlideShowConstructor::addVolume(const std::string& filename, const Position
}
}
if (!volumeData.hull.empty())
{
osg::ref_ptr<osg::Node> hull = osgDB::readNodeFile(volumeData.hull, _options.get());
if (hull.valid())
{
tile->addChild(hull);
}
}
osg::ref_ptr<osg::Node> model = volume.get();