本文整理汇总了C++中Any::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ Any::isEmpty方法的具体用法?C++ Any::isEmpty怎么用?C++ Any::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Any
的用法示例。
在下文中一共展示了Any::isEmpty方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void BatchPage::init(PagedGeometry *_geom, const Any &data)
{
geom = _geom;
int datacast = data.isEmpty() ? 0 : Ogre::any_cast<int>(data);
#ifdef _DEBUG
if ( datacast < 0)
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,"Data of BatchPage must be a positive integer. It representing the LOD level this detail level stores.","BatchPage::BatchPage");
#endif
mLODLevel = datacast;
sceneMgr = geom->getSceneManager();
batch = new BatchedGeometry(sceneMgr, geom->getSceneNode());
fadeEnabled = false;
if(!geom->getShadersEnabled())
{
// shaders disabled by config
shadersSupported = false;
} else
{
// determine if shaders available
const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
if (caps->hasCapability(RSC_VERTEX_PROGRAM))
shadersSupported = true;
else
shadersSupported = false;
}
++refCount;
}
示例2: init
//-----------------------------------------------------------------------------
///
void BatchPage::init(PagedGeometry *geom_, const Any &data)
{
assert(geom_ && "Can any code set null pointer?");
int datacast = !data.isEmpty() ? Ogre::any_cast<int>(data) : 0;
#ifdef _DEBUG
if (datacast < 0)
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,"Data of BatchPage must be a positive integer. It representing the LOD level this detail level stores.","BatchPage::BatchPage");
#endif
m_pPagedGeom = geom_;
m_pSceneMgr = m_pPagedGeom->getSceneManager();
m_pBatchGeom = new BatchedGeometry(m_pSceneMgr, m_pPagedGeom->getSceneNode());
m_nLODLevel = datacast;
m_bFadeEnabled = false;
if (!m_pPagedGeom->getShadersEnabled())
m_bShadersSupported = false; // shaders disabled by config
else
{
// determine if shaders available
const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
// For example, GeForce4MX has vertex shadres 1.1 and no pixel shaders
m_bShadersSupported = caps->hasCapability(RSC_VERTEX_PROGRAM) ? true : false;
}
++s_nRefCount;
}
示例3: getMtl
//------------------------------------------------------------------------
MtlPtr MaterialUtil::getMtl(const MaterialPtr& _material, MatGenParams& _rMatGenParams)
{
if(!_material->getNumTechniques())
return MtlPtr();
Technique* technique = _material->getTechnique(0);
UserObjectBindings& uob = technique->getUserObjectBindings();
Any mtlAny = uob.getUserAny( USER_MTL );
Any matGenParamsAny = uob.getUserAny( USER_MAT_GEN_PARAMS );
if(mtlAny.isEmpty() || matGenParamsAny.isEmpty())
return MtlPtr();
MtlPtr mtl = *any_cast<MtlPtr>(&mtlAny);
_rMatGenParams = *any_cast<MatGenParams>(&matGenParamsAny);
return mtl;
}
示例4: getMatGenParams
//------------------------------------------------------------------------
MatGenParams MaterialUtil::getMatGenParams(const MaterialPtr& _material)
{
if(!_material->getNumTechniques())
return MatGenParams();
Technique* technique = _material->getTechnique(0);
UserObjectBindings& uob = technique->getUserObjectBindings();
Any matGenParamsAny = uob.getUserAny( USER_MAT_GEN_PARAMS );
if(matGenParamsAny.isEmpty())
return MatGenParams();
return *any_cast<MatGenParams>(&matGenParamsAny);
}
示例5: init
//-----------------------------------------------------------------------------
///
void WindBatchPage::init(PagedGeometry *geom, const Any &data)
{
int datacast = !data.isEmpty() ? Ogre::any_cast<int>(data) : 0;
#ifdef _DEBUG
if (datacast < 0)
{
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,
"Data of WindBatchPage must be a positive integer. It representing the LOD level this detail level stores.",
"WindBatchPage::WindBatchPage");
}
#endif
m_pBatchGeom = new WindBatchedGeometry(geom->getSceneManager(), geom->getSceneNode(), geom);
m_nLODLevel = datacast;
m_pPagedGeom = geom;
m_bFadeEnabled = false;
const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
m_bShadersSupported = caps->hasCapability(RSC_VERTEX_PROGRAM) ? true : false; // <-- DELETE THIS
++s_nRefCount;
}
示例6: init
void WindBatchPage::init(PagedGeometry *geom, const Any &data)
{
int datacast = data.isEmpty() ? 0 : Ogre::any_cast<int>(data);
#ifdef _DEBUG
if ( datacast < 0)
OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS,"Data of WindBatchPage must be a positive integer. It representing the LOD level this detail level stores.","WindBatchPage::WindBatchPage");
#endif
mLODLevel = datacast;
mGeom = geom;
sceneMgr = geom->getSceneManager();
batch = new WindBatchedGeometry(sceneMgr, geom->getSceneNode());
dynamic_cast<WindBatchedGeometry*>(batch)->setGeom(geom);
fadeEnabled = false;
const RenderSystemCapabilities *caps = Root::getSingleton().getRenderSystem()->getCapabilities();
if (caps->hasCapability(RSC_VERTEX_PROGRAM))
shadersSupported = true;
else
shadersSupported = false;
++refCount;
}