bool wxGBSizerItem::Intersects(const wxGBPosition& pos, const wxGBSpan& span) { int row, col, endrow, endcol; int otherrow, othercol, otherendrow, otherendcol; GetPos(row, col); GetEndPos(endrow, endcol); otherrow = pos.GetRow(); othercol = pos.GetCol(); otherendrow = otherrow + span.GetRowspan() - 1; otherendcol = othercol + span.GetColspan() - 1; // is the other item's start or end in the range of this one? if (( InRange(otherrow, row, endrow) && InRange(othercol, col, endcol) ) || ( InRange(otherendrow, row, endrow) && InRange(otherendcol, col, endcol) )) return true; // is this item's start or end in the range of the other one? if (( InRange(row, otherrow, otherendrow) && InRange(col, othercol, otherendcol) ) || ( InRange(endrow, otherrow, otherendrow) && InRange(endcol, othercol, otherendcol) )) return true; return false; }
void CLightning::DamageThink( void ) { pev->nextthink = gpGlobals->time + 0.1; TraceResult tr; UTIL_TraceLine( GetStartPos(), GetEndPos(), dont_ignore_monsters, NULL, &tr ); BeamDamage( &tr ); }
int JobGetBranchList::ParseStdOutput(char *output, int numBytes) { int i = 0; int numBytesParsed = 0; for (;;) { numBytesParsed = i; if (i >= numBytes) break; // Is it the active branch? if (output[i] == '*') m_iActiveBranch = (int)m_branches.size(); if ((i += 2) >= numBytes) break; // Branch name. int iBranchName = i; i = GetEndPos(output, numBytes, i); if (i >= numBytes) break; output[i++] = '\0'; m_branches.push_back(wxString::FromUTF8(&output[iBranchName])); } return numBytesParsed; }
void WORKSHEET_DATAITEM::MoveTo( DPOINT aPosition ) { DPOINT vector = aPosition - GetStartPos(); DPOINT endpos = vector + GetEndPos(); MoveStartPointTo( aPosition ); MoveEndPointTo( endpos ); }
void CBeam::SetObjectCollisionBox( void ) { const Vector &startPos = GetStartPos(), &endPos = GetEndPos(); pev->absmin.x = min( startPos.x, endPos.x ); pev->absmin.y = min( startPos.y, endPos.y ); pev->absmin.z = min( startPos.z, endPos.z ); pev->absmax.x = max( startPos.x, endPos.x ); pev->absmax.y = max( startPos.y, endPos.y ); pev->absmax.z = max( startPos.z, endPos.z ); }
const char *Move::DetermineNotation(int detailLevel) { // if I already have a notation set, just return that? if (hasCustomNotation) return notation.c_str(); switch (detailLevel) { case 1: notation = piece->pieceType->GetNotation(); if (IsCapture()) notation += "x"; notation += GetEndPos()->GetName(); break; case 2: notation = piece->pieceType->notation; notation += startPos->GetName(); if (IsCapture()) notation += "x"; notation += GetEndPos()->GetName(); break; default: notation = piece->pieceType->GetNotation(); notation += "("; notation += std::to_string(piece->GetID()); notation += ")"; notation += startPos->GetName(); if (IsCapture()) notation += "x"; notation += GetEndPos()->GetName(); break; } notation += appendNotation; return notation.c_str(); }
void CBeam::RelinkBeam( void ) { const Vector &startPos = GetStartPos(), &endPos = GetEndPos(); pev->mins.x = min( startPos.x, endPos.x ); pev->mins.y = min( startPos.y, endPos.y ); pev->mins.z = min( startPos.z, endPos.z ); pev->maxs.x = max( startPos.x, endPos.x ); pev->maxs.y = max( startPos.y, endPos.y ); pev->maxs.z = max( startPos.z, endPos.z ); pev->mins = pev->mins - pev->origin; pev->maxs = pev->maxs - pev->origin; UTIL_SetSize( pev, pev->mins, pev->maxs ); UTIL_SetOrigin( pev, pev->origin ); }
bool WORKSHEET_DATAITEM::IsInsidePage( int ii ) const { DPOINT pos = GetStartPos( ii ); for( int kk = 0; kk < 1; kk++ ) { if( m_RB_Corner.x < pos.x || m_LT_Corner.x > pos.x ) return false; if( m_RB_Corner.y < pos.y || m_LT_Corner.y > pos.y ) return false; pos = GetEndPos( ii ); } return true; }
void CLightning::ToggleUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ) { if ( !ShouldToggle( useType, m_active ) ) return; if ( m_active ) { m_active = 0; pev->effects |= EF_NODRAW; pev->nextthink = 0; } else { m_active = 1; pev->effects &= ~EF_NODRAW; DoSparks( GetStartPos(), GetEndPos() ); if ( pev->dmg > 0 ) { pev->nextthink = gpGlobals->time; pev->dmgtime = gpGlobals->time; } } }
const wxPoint WORKSHEET_DATAITEM::GetEndPosUi( int ii ) const { DPOINT pos = GetEndPos( ii ); pos = pos * m_WSunits2Iu; return wxPoint( int(pos.x), int(pos.y) ); }