Ejemplo n.º 1
0
boolean annoFilterRowFails(struct annoFilter *filterList, char **row, int rowSize,
			   boolean *retRightJoin)
/* Apply filters to row, using autoSql column definitions to interpret
 * each word of row.  Return TRUE if any filter fails (or passes, if isExclude).
 * Set retRightJoin to TRUE if a rightJoin filter has failed. */
{
if (filterList != NULL && slCount(filterList) != rowSize)
    errAbort("annoFilterRowFails: filterList length %d doesn't match rowSize %d",
	     slCount(filterList), rowSize);
if (retRightJoin != NULL)
    *retRightJoin = FALSE;
struct annoFilter *filter;
// First pass: left-join filters (failure means omit this row from output);
for (filter = filterList;  filter != NULL;  filter = filter->next)
    {
    if (filter->op == afNoFilter || filter->values == NULL || filter->rightJoin)
	continue;
    if (singleFilter(filter, row, rowSize))
	return TRUE;
    }
// Second pass: right-join filters (failure means omit not only this row, but the primary row too)
for (filter = filterList;  filter != NULL;  filter = filter->next)
    {
    if (filter->op == afNoFilter || filter->values == NULL || !filter->rightJoin)
	continue;
    if (singleFilter(filter, row, rowSize))
	{
	if (retRightJoin != NULL)
	    *retRightJoin = TRUE;
	return TRUE;
	}
    }
return FALSE;
}
Ejemplo n.º 2
0
//-----------------------------------------------------------------------------
// Found a Target
//-----------------------------------------------------------------------------
void CObjectSentrygun::FoundTarget( CBaseEntity *pTarget, const Vector &vecSoundCenter )
{
	m_hEnemy = pTarget;

	if ( ( m_iAmmoShells > 0 ) || ( m_iAmmoRockets > 0 && m_iUpgradeLevel == 3 ) )
	{
		// Play one sound to everyone but the target.
		CPASFilter filter( vecSoundCenter );

		if ( pTarget->IsPlayer() )
		{
			CTFPlayer *pPlayer = ToTFPlayer( pTarget );

			// Play a specific sound just to the target and remove it from the genral recipient list.
			CSingleUserRecipientFilter singleFilter( pPlayer );
			EmitSound( singleFilter, entindex(), "Building_Sentrygun.AlertTarget" );
			filter.RemoveRecipient( pPlayer );
		}

		EmitSound( filter, entindex(), "Building_Sentrygun.Alert" );
	}

	// Update timers, we are attacking now!
	m_iState.Set( SENTRY_STATE_ATTACKING );
	m_flNextAttack = gpGlobals->curtime + SENTRY_THINK_DELAY;
	if ( m_flNextRocketAttack < gpGlobals->curtime )
	{
		m_flNextRocketAttack = gpGlobals->curtime + 0.5;
	}
}
Ejemplo n.º 3
0
/* Build basis ------------------------------------------------------------- */
void Steerable::buildBasis(const MultidimArray<double> &Vtomograph, double sigma)
{
    std::vector< MultidimArray<double> > hx1, hy1, hz1;
    generate1DFilters(sigma, Vtomograph, hx1, hy1, hz1);
    for (int n=0; n<6; n++)
    {
        MultidimArray<double> aux;
        singleFilter(Vtomograph,hx1[n],hy1[n],hz1[n],aux);
        basis.push_back(aux);
    }    
}