Пример #1
0
void UIDebugVDP2::updateInfoDisplay(void (*debugStats)(char *, int *), QCheckBox *cb, QPlainTextEdit *pte)
{
   char tempstr[2048];
   int isScreenEnabled=FALSE;

   debugStats(tempstr, &isScreenEnabled);

   if (isScreenEnabled)
   {
      cb->setChecked(true);
      pte->clear();
      pte->appendPlainText(tempstr);
      pte->moveCursor(QTextCursor::Start);
   }
   else
      cb->setChecked(false);

}
Пример #2
0
void AddQueries::apply( osg::Group& node )
{
    if( node.getName() == std::string( "__QueryStats" ) )
        // This is the QueryStats subtree. Don't instrument it with any OQ stuff.
        return;

    if( node.getCullCallback() != NULL )
    {
        traverse( node );
        return;
    }

    // Do not add callbacks to redundant Groups because the parent Group's
    // bounding volume (and query geometry) would also be redundant.
    // This Group is not redundant if it has no parents, or if its parents
    // are all Cameras, or if any one of its non-Camera parents has
    // more than one child. Otherwise, it's redundant.
    bool redundantGroup( false );
    unsigned int parentsWithOneChild( 0 );
    const unsigned int numParents( node.getNumParents() );
    unsigned int idx;
    for( idx=0; idx < numParents; idx++ )
    {
        osg::Group* parent = node.getParent( idx );
        bool parentIsCamera = ( dynamic_cast< osg::Camera* >( parent ) != NULL );
        if( parentIsCamera )
            continue;
        if( parent->getNumChildren() == 1 )
        {
            parentsWithOneChild++;
            // If all parents have one child, then we are redundant.
            if( numParents == parentsWithOneChild )
                redundantGroup = true;
        }
    }
    if( redundantGroup )
    {
        if( ( _qs != NULL ) && ( &node == _qs->getNode() ) )
            osg::notify( osg::ALWAYS ) << "Debug: Unable to add QueryStats to redundant Group \"" << node.getName() << "\"." << std::endl;
        traverse( node );
        return;
    }

    // Create QueryComputation for this node.
    // Add a QueryStats only if a) we have one and
    // b) the node addresses match.
    osgwQuery::QueryStats* debugStats( NULL );
    if( ( _qs != NULL ) && ( &node == _qs->getNode() ) )
    {
        osg::notify( osg::ALWAYS ) << "Debug: Adding QueryStats to node \"" << node.getName() << "\"." << std::endl;
        debugStats = _qs;
    }
    QueryComputation* nd = new QueryComputation( debugStats );

    QueryCullCallback* qcc = new QueryCullCallback();
    qcc->setName( node.getName() );
    qcc->attach( &node, nd );
    node.setCullCallback( qcc );

    _queryCount++;

    traverse( node );
}