本文整理汇总了C++中Locator::getTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ Locator::getTransform方法的具体用法?C++ Locator::getTransform怎么用?C++ Locator::getTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Locator
的用法示例。
在下文中一共展示了Locator::getTransform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void RayTracedTechnique::init()
{
OSG_INFO<<"RayTracedTechnique::init()"<<std::endl;
if (!_volumeTile)
{
OSG_NOTICE<<"RayTracedTechnique::init(), error no volume tile assigned."<<std::endl;
return;
}
if (_volumeTile->getLayer()==0)
{
OSG_NOTICE<<"RayTracedTechnique::init(), error no layer assigend to volume tile."<<std::endl;
return;
}
if (_volumeTile->getLayer()->getImage()==0)
{
OSG_NOTICE<<"RayTracedTechnique::init(), error no image assigned to layer."<<std::endl;
return;
}
ShadingModel shadingModel = Isosurface;
float alphaFuncValue = 0.1;
_transform = new osg::MatrixTransform;
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
_transform->addChild(geode.get());
osg::Image* image_3d = 0;
osg::TransferFunction1D* tf = 0;
Locator* masterLocator = _volumeTile->getLocator();
Locator* layerLocator = _volumeTile->getLayer()->getLocator();
image_3d = _volumeTile->getLayer()->getImage();
CollectPropertiesVisitor cpv;
if (_volumeTile->getLayer()->getProperty())
{
_volumeTile->getLayer()->getProperty()->accept(cpv);
}
if (cpv._isoProperty.valid())
{
shadingModel = Isosurface;
alphaFuncValue = cpv._isoProperty->getValue();
}
else if (cpv._mipProperty.valid())
{
shadingModel = MaximumIntensityProjection;
}
else if (cpv._lightingProperty.valid())
{
shadingModel = Light;
}
else
{
shadingModel = Standard;
}
if (cpv._tfProperty.valid())
{
tf = dynamic_cast<osg::TransferFunction1D*>(cpv._tfProperty->getTransferFunction());
}
if (cpv._afProperty.valid())
{
alphaFuncValue = cpv._afProperty->getValue();
}
if (!masterLocator && layerLocator) masterLocator = layerLocator;
if (!layerLocator && masterLocator) layerLocator = masterLocator;
osg::Matrix geometryMatrix;
if (masterLocator)
{
geometryMatrix = masterLocator->getTransform();
_transform->setMatrix(geometryMatrix);
masterLocator->addCallback(new TransformLocatorCallback(_transform.get()));
}
osg::Matrix imageMatrix;
if (layerLocator)
{
imageMatrix = layerLocator->getTransform();
}
OSG_INFO<<"RayTracedTechnique::init() : geometryMatrix = "<<geometryMatrix<<std::endl;
OSG_INFO<<"RayTracedTechnique::init() : imageMatrix = "<<imageMatrix<<std::endl;
osg::Texture::InternalFormatMode internalFormatMode = osg::Texture::USE_IMAGE_DATA_FORMAT;
{
osg::Texture::FilterMode minFilter = osg::Texture::LINEAR;
//.........这里部分代码省略.........