Skip to content

Commit

Permalink
Added hull="hul-filename" property support to <volume> tag that can u…
Browse files Browse the repository at this point in the history
…sed thus:

        <layer>
            <volume renderer="MultiPass" hull="cow.osgt.0,-2,-4.trans.50,50,50.scale">CardiacCT</volume>
        </layer>
  • Loading branch information
robertosfield committed Jan 16, 2014
1 parent 894fbe9 commit 91f9715
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/osgPresentation/deprecated/SlideShowConstructor
Expand Up @@ -328,6 +328,7 @@ public:
osg::ColorSpaceOperation colorSpaceOperation;
osg::Vec4 colorModulate;
Technique technique;
std::string hull;
};


Expand Down
6 changes: 6 additions & 0 deletions src/osgPlugins/p3d/ReaderWriterP3D.cpp
Expand Up @@ -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)) {}
Expand Down
9 changes: 9 additions & 0 deletions src/osgPresentation/deprecated/SlideShowConstructor.cpp
Expand Up @@ -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();

Expand Down

0 comments on commit 91f9715

Please sign in to comment.