本文整理汇总了C++中Zone::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Zone::getName方法的具体用法?C++ Zone::getName怎么用?C++ Zone::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Error
void
ManagementTool::addZone(Zone& zone)
{
if (m_dbMgr.find(zone)) {
throw Error("Zone with Name=" + zone.getName().toUri() +
" is already presented in local NDNS databse");
}
NDNS_LOG_INFO("Add zone with Name: " << zone.getName().toUri());
m_dbMgr.insert(zone);
}
示例2:
void
ManagementTool::removeZone(Zone& zone)
{
if (!m_dbMgr.find(zone)) {
return;
}
NDNS_LOG_INFO("Remove zone with Name: " << zone.getName().toUri());
m_dbMgr.remove(zone);
}
示例3: rrset
void
ManagementTool::addIdCert(Zone& zone, shared_ptr<IdentityCertificate> cert,
const time::seconds& ttl)
{
Rrset rrset(&zone);
size_t size = zone.getName().size();
Name label = cert->getName().getSubName(size + 1, cert->getName().size() - size - 3);
rrset.setLabel(label);
rrset.setType(label::CERT_RR_TYPE);
rrset.setTtl(ttl);
rrset.setVersion(cert->getName().get(-1));
rrset.setData(cert->wireEncode());
if (m_dbMgr.find(rrset)) {
throw Error("ID-CERT with label=" + label.toUri() +
" is already presented in local NDNS databse");
}
NDNS_LOG_INFO("Add rrset with zone-id: " << zone.getId() << " label: " << label << " type: "
<< label::CERT_RR_TYPE);
m_dbMgr.insert(rrset);
}
示例4: BlendFunc
void
GroundCoverLayer::buildStateSets()
{
// assert we have the necessary TIUs:
if (_groundCoverTexBinding.valid() == false) {
OE_DEBUG << LC << "buildStateSets deferred.. bindings not reserved\n";
return;
}
if (!_zonesConfigured) {
OE_DEBUG << LC << "buildStateSets deferred.. zones not yet configured\n";
return;
}
osg::ref_ptr<LandCoverDictionary> landCoverDict;
if (_landCoverDict.lock(landCoverDict) == false) {
OE_DEBUG << LC << "buildStateSets deferred.. land cover dictionary not available\n";
return;
}
osg::ref_ptr<LandCoverLayer> landCoverLayer;
if (_landCoverLayer.lock(landCoverLayer) == false) {
OE_DEBUG << LC << "buildStateSets deferred.. land cover layer not available\n";
return;
}
NoiseTextureFactory noise;
osg::ref_ptr<osg::Texture> noiseTexture = noise.create(256u, 4u);
GroundCoverShaders shaders;
// Layer-wide stateset:
osg::StateSet* stateset = getOrCreateStateSet();
// bind the noise sampler.
stateset->setTextureAttribute(_noiseBinding.unit(), noiseTexture.get());
stateset->addUniform(new osg::Uniform(NOISE_SAMPLER, _noiseBinding.unit()));
if (_maskLayer.valid())
{
stateset->setDefine("OE_GROUNDCOVER_MASK_SAMPLER", _maskLayer->shareTexUniformName().get());
stateset->setDefine("OE_GROUNDCOVER_MASK_MATRIX", _maskLayer->shareTexMatUniformName().get());
}
// disable backface culling to support shadow/depth cameras,
// for which the geometry shader renders cross hatches instead of billboards.
stateset->setMode(GL_CULL_FACE, osg::StateAttribute::PROTECTED);
// enable alpha-to-coverage multisampling for vegetation.
stateset->setMode(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB, 1);
// uniform that communicates the availability of multisampling.
if (osg::DisplaySettings::instance()->getMultiSamples())
{
stateset->setDefine("OE_GROUNDCOVER_HAS_MULTISAMPLES");
}
stateset->setAttributeAndModes(
new osg::BlendFunc(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO),
osg::StateAttribute::OVERRIDE);
for (Zones::iterator z = _zones.begin(); z != _zones.end(); ++z)
{
Zone* zone = z->get();
GroundCover* groundCover = zone->getGroundCover();
if (groundCover)
{
if (!groundCover->getBiomes().empty() || groundCover->getTotalNumBillboards() > 0)
{
osg::StateSet* zoneStateSet = groundCover->getOrCreateStateSet();
// Install the land cover shaders on the state set
VirtualProgram* vp = VirtualProgram::getOrCreate(zoneStateSet);
vp->setName("Ground cover (" + groundCover->getName() + ")");
shaders.loadAll(vp, getReadOptions());
// Generate the coverage acceptor shader
osg::Shader* covTest = groundCover->createPredicateShader(_landCoverDict.get(), _landCoverLayer.get());
covTest->setName(covTest->getName() + "_GEOMETRY");
covTest->setType(osg::Shader::GEOMETRY);
vp->setShader(covTest);
osg::Shader* covTest2 = groundCover->createPredicateShader(_landCoverDict.get(), _landCoverLayer.get());
covTest->setName(covTest->getName() + "_TESSCONTROL");
covTest2->setType(osg::Shader::TESSCONTROL);
vp->setShader(covTest2);
osg::ref_ptr<osg::Shader> layerShader = groundCover->createShader();
layerShader->setType(osg::Shader::GEOMETRY);
vp->setShader(layerShader.get());
OE_INFO << LC << "Established zone \"" << zone->getName() << "\" at LOD " << getLOD() << "\n";
osg::Texture* tex = groundCover->createTexture();
zoneStateSet->setTextureAttribute(_groundCoverTexBinding.unit(), tex);
zoneStateSet->addUniform(new osg::Uniform(GCTEX_SAMPLER, _groundCoverTexBinding.unit()));
OE_DEBUG << LC << "buildStateSets completed!\n";
//.........这里部分代码省略.........