本文整理汇总了C++中osg::SimpleSceneManagerRefPtr::getStatistics方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleSceneManagerRefPtr::getStatistics方法的具体用法?C++ SimpleSceneManagerRefPtr::getStatistics怎么用?C++ SimpleSceneManagerRefPtr::getStatistics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::SimpleSceneManagerRefPtr
的用法示例。
在下文中一共展示了SimpleSceneManagerRefPtr::getStatistics方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyboard
// react to keys
void keyboard(unsigned char k, int x, int y)
{
switch(k)
{
case 'e':
{
// clean up global variables
mgr = NULL;
OSG::osgExit();
exit(0);
}
break;
case 's':
{
mgr->setStatistics(!mgr->getStatistics());
}
break;
}
}
示例2: keyboard
//
// react to keys
//
void keyboard(unsigned char k, int x, int y)
{
switch(k)
{
case 27:
{
// clean up global variables
cyltrans = NULL;
tortrans = NULL;
mgr = NULL;
ubo_light_state = NULL;
ubo_geom_state_1 = NULL;
ubo_geom_state_2 = NULL;
OSG::osgExit();
exit(0);
}
break;
case 'm':
{
GeomState geom1; geom1.material_index = dist(generator);
GeomState geom2; geom2.material_index = dist(generator);
update_geometry_material_state(ubo_geom_state_1, geom1);
update_geometry_material_state(ubo_geom_state_2, geom2);
glutPostRedisplay();
}
break;
case 's':
{
mgr->setStatistics(!mgr->getStatistics());
}
break;
}
}
示例3: keyboard
// react to keys
void keyboard(unsigned char k, int , int )
{
switch(k)
{
case 27:
{
cleanup();
OSG::osgExit();
std::exit(0);
}
break;
case 'f':
{
mgr->setNavigationMode(OSG::Navigator::FLY);
std::cout << "Fly mode" << std::endl;
}
break;
case 't':
{
mgr->setNavigationMode(OSG::Navigator::TRACKBALL);
std::cout << "Trackball mode" << std::endl;
}
break;
case 'q':
{
mgr->setStatistics(!mgr->getStatistics());
std::cout << "Statistics "
<< (mgr->getStatistics() ? "enabled" : "disabled")
<< std::endl;
}
break;
case 'h':
{
mgr->setHeadlight(!mgr->getHeadlightState());
std::cout << "Headlight "
<< (mgr->getHeadlightState() ? "enabled" : "disabled")
<< std::endl;
}
break;
case 'b':
{
if(polyChunk == NULL)
{
polyChunk = OSG::PolygonChunk::create();
root->addChunk(polyChunk);
}
if(polyChunk->getCullFace() == GL_NONE)
{
polyChunk->setCullFace(GL_BACK);
std::cout << "Backface culling enabled" << std::endl;
}
else
{
polyChunk->setCullFace(GL_NONE);
std::cout << "Backface culling disabled" << std::endl;
}
}
break;
case 'w':
{
if(polyChunk == NULL)
{
polyChunk = OSG::PolygonChunk::create();
root->addChunk(polyChunk);
}
if(polyChunk->getFrontMode() == GL_FILL)
{
polyChunk->setFrontMode(GL_LINE);
polyChunk->setBackMode (GL_LINE);
std::cout << "Wireframe enabled" << std::endl;
}
else
{
polyChunk->setFrontMode(GL_FILL);
polyChunk->setBackMode (GL_FILL);
std::cout << "Wireframe disabled" << std::endl;
}
}
break;
case 'n':
{
if(normalsActive == true)
{
normalsActive = false;
NodeStore::const_iterator ngIt = normalsGeoN.begin();
NodeStore::const_iterator ngEnd = normalsGeoN.end ();
for(; ngIt != ngEnd; ++ngIt)
{
(*ngIt)->setTravMask(0);
}
std::cout << "Normals disabled" << std::endl;
}
else
//.........这里部分代码省略.........
示例4: keyboard
// react to keys
void keyboard(unsigned char k, int x, int y)
{
switch(k)
{
case 27:
{
// clean up global variables
mgr = NULL;
OSG::osgExit();
exit(1);
}
break;
case 'a': // activate all lights
{
for(OSG::UInt16 i = 0; i < nlights; ++i)
{
lights[i]->setOn(true);
}
}
break;
case 's': // deactivate all but the spot lights
{
for(OSG::UInt16 i = 0; i < nlights; ++i)
{
if(lights[i]->getTypeId() != OSG::SpotLight::getClassTypeId())
{
lights[i]->setOn(false);
}
else
{
lights[i]->setOn(true);
}
}
OSG::commitChanges();
}
break;
case 'd': // deactivate all but the directional lights
{
for(OSG::UInt16 i = 0; i < nlights; ++i)
{
if(lights[i]->getTypeId() !=
OSG::DirectionalLight::getClassTypeId())
{
lights[i]->setOn(false);
}
else
{
lights[i]->setOn(true);
}
}
OSG::commitChanges();
}
break;
case 'p': // deactivate all but the point lights
{
for(OSG::UInt16 i = 0; i < nlights; ++i)
{
if(lights[i]->getTypeId() != OSG::PointLight::getClassTypeId())
{
lights[i]->setOn(false);
}
else
{
lights[i]->setOn(true);
}
}
OSG::commitChanges();
}
break;
case 'S':
{
mgr->setStatistics(!mgr->getStatistics());
}
break;
}
}