您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetLocation函数代码示例

51自学网 2021-06-01 21:10:15
  C++
这篇教程C++ GetLocation函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GetLocation函数的典型用法代码示例。如果您正苦于以下问题:C++ GetLocation函数的具体用法?C++ GetLocation怎么用?C++ GetLocation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GetLocation函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SetLocation

void GUIWindow::SetMinimized(bool minimized){	m_bMinimized = minimized;	if(m_bMinimized)	{		// Hide all our children components when we are minimized		ComponentList::const_iterator iterator;		for(iterator = m_vpComponentList.begin(); iterator != m_vpComponentList.end(); ++iterator)		{			(*iterator)->SetVisible(false);			(*iterator)->SetEnabled(false);		}	}	else	{		// Else show all our children components		ComponentList::const_iterator iterator;		for(iterator = m_vpComponentList.begin(); iterator != m_vpComponentList.end(); ++iterator)		{			(*iterator)->SetVisible(true);			(*iterator)->SetEnabled(true);		}	}	m_titleBar->SetVisible(true);	m_titleBar->SetEnabled(true);	SetLocation(GetLocation().m_x, GetLocation().m_y);}
开发者ID:Polyrhythm,项目名称:Vox,代码行数:32,


示例2: GetLocation

bool RoboCat::MoveToLocation( float inDeltaTime, const Vector3& inLocation ){	bool finishedMove = false;	Vector3 toMoveVec = inLocation - GetLocation();	float distToTarget = toMoveVec.Length();	toMoveVec.Normalize2D();	if( distToTarget > 0.1f )	{		if ( distToTarget > ( kMoveSpeed * inDeltaTime ) )		{			SetLocation( GetLocation() + toMoveVec * inDeltaTime * kMoveSpeed );		}		else		{			//we're basically almost there, so set it to move location			SetLocation( inLocation );			finishedMove = true;		}	}	else	{		//since we're close, stop moving towards the target		finishedMove = true;	}	return finishedMove;}
开发者ID:caldera,项目名称:MultiplayerBook,代码行数:28,


示例3: GetLocation

void TextBox::RenderImpl(){    // create a buffer around the text    auto location = GetLocation();    location.x += TextOffsetX;    // vertically center the text in the bounding rect    location.y += (location.h - m_texture.GetHeight()) / 2;        if (m_texture.GetHeight() <= location.h)        location.h = m_texture.GetHeight();    else        assert(!"Font size is too tall for text box.");    // if the text width is greater than the width of the text box the    // text width will need to be clipped with respect to the position    location.w -= (TextOffsetX * 2);    SDL_Rect clip;    clip.x = m_clipOffset;    clip.y = 0;    clip.h = location.h;    clip.w = GetLocation().w - (TextOffsetX * 2);    // if the portion of the texture being displayed doesn't completely fill    // the location's width decrease the width so the texture isn't stretched    auto deltaWidth = (clip.w - (m_texture.GetWidth() - m_clipOffset));    if (deltaWidth > 0)        location.w -= deltaWidth;    GetWindow()->DrawRectangle(GetLocation(), GetBackgroundColor(), UINT8_MAX);    GetWindow()->DrawTexture(location, m_texture, &clip);}
开发者ID:noparity,项目名称:libsdlgui,代码行数:35,


示例4: GetLocation

bool King::LookNorth(){	Location temp = GetLocation();	temp.MoveY(-1);	return GetLocation().IsWall(temp.GetCoordinates(), GetMaze());};
开发者ID:johnballantyne,项目名称:mazegeneration483w,代码行数:7,


示例5: GetLocation

void CardButton::RecalculateHeldDestination(){    held_destination.x=GetLocation().x+GetLocation().w/4;    held_destination.y= GetLocation().y;    held_destination.w=GetLocation().w/2;    held_destination.h=GetLocation().h/14;}
开发者ID:NASD-Bulgaria,项目名称:egt-training,代码行数:7,


示例6: GetLocation

void RoboCatServer::Update(){	RoboCat::Update();		Vector3 oldLocation = GetLocation();	Vector3 oldVelocity = GetVelocity();	float oldRotation = GetRotation();	ClientProxyPtr client = NetworkManagerServer::sInstance->GetClientProxy( GetPlayerId() );	if( client )	{		MoveList& moveList = client->GetUnprocessedMoveList();		for( const Move& unprocessedMove : moveList )		{			const InputState& currentState = unprocessedMove.GetInputState();			float deltaTime = unprocessedMove.GetDeltaTime();			ProcessInput( deltaTime, currentState );			SimulateMovement( deltaTime );		}		moveList.Clear();	}	HandleShooting();	if( !RoboMath::Is2DVectorEqual( oldLocation, GetLocation() ) ||		!RoboMath::Is2DVectorEqual( oldVelocity, GetVelocity() ) ||		oldRotation != GetRotation() )	{		NetworkManagerServer::sInstance->SetStateDirty( GetNetworkId(), ECRS_Pose );	}}
开发者ID:caldera,项目名称:MultiplayerBook,代码行数:32,


示例7: boundary_scored

SampledTaskPoint::SampledTaskPoint(TaskPointType _type, const Waypoint & wp,                                   const bool b_scored)  :TaskWaypoint(_type, wp),   boundary_scored(b_scored),   search_max(GetLocation()),   search_min(GetLocation()),   search_reference(GetLocation()){  nominal_points.push_back(search_reference);}
开发者ID:StefanL74,项目名称:XCSoar,代码行数:10,


示例8: rand

void WorldGen::Mapper::Generate(){	int u = rand() % Width_;	int v = rand() % Height_;	Data[ u ][ v ] = GUILTY;	int z = 1;	while ( UnsetLocationExists() )	{		Pair p = GetUnsetPair();		Data[ p.X_ ][ p.Y_ ] = LOCKED;		int match = UnusedColumn( p.Y_ );		if ( match == -1 )		{			 int column = GetRandomSetColumn( p.Y_ );			 Data[ p.X_ ][ p.Y_ ] = Data[ column ][ p.Y_ ];		}		else		{			int sameRoom = rand() % 2;			int newVal = UNUSED;			if ( sameRoom == 1 )			{				int newY1 = UNUSED;				int newY2 = UNUSED;				if ( p.Y_ > 0 )				{					newY1 = GetLocation( p.X_ , p.Y_ - 1 );				}				if ( p.Y_ < Height_ - 1 )				{					newY2 = GetLocation( p.X_, p.Y_ + 1 );				}				if ( ( newY1 > UNUSED ) && ( newY2 > UNUSED ) )				{					newVal = (rand() % 2 == 0) ? newY1 : newY2;				}				else if ( newY1 > UNUSED )					newVal = newY1;				else if ( newY2 > UNUSED )					newVal = newY2;			}			if ( ( sameRoom == 0 ) || ( newVal == UNUSED ) )			{				newVal = z;				++z;			}			Data[ p.X_ ][ p.Y_ ] = newVal;			Data[ match ][ p.Y_ ] = newVal;		}	}}
开发者ID:Dezzles,项目名称:hecticjam6,代码行数:52,


示例9: fs

voidPrintHelper::contestmanager_print(const ContestManager &man,                                  const Trace &trace_full,                                  const Trace &trace_triangle,                                  const Trace &trace_sprint){  Directory::Create(_T("output/results"));  {    std::ofstream fs("output/results/res-olc-trace.txt");    TracePointVector v;    trace_full.GetPoints(v);    for (auto it = v.begin(); it != v.end(); ++it)      fs << it->GetLocation().longitude << " " << it->GetLocation().latitude         << " " << it->GetAltitude() << " " << it->GetTime()         << "/n";  }  {    std::ofstream fs("output/results/res-olc-trace_triangle.txt");    TracePointVector v;    trace_triangle.GetPoints(v);    for (auto it = v.begin(); it != v.end(); ++it)      fs << it->GetLocation().longitude << " " << it->GetLocation().latitude         << " " << it->GetAltitude() << " " << it->GetTime()         << "/n";  }  {    std::ofstream fs("output/results/res-olc-trace_sprint.txt");    TracePointVector v;    trace_sprint.GetPoints(v);    for (auto it = v.begin(); it != v.end(); ++it)      fs << it->GetLocation().longitude << " " << it->GetLocation().latitude         << " " << it->GetAltitude() << " " << it->GetTime()         << "/n";  }  std::ofstream fs("output/results/res-olc-solution.txt");  if (man.stats.solution[0].empty()) {    fs << "# no solution/n";    return;  }  if (positive(man.stats.result[0].time)) {    for (auto it = man.stats.solution[0].begin();         it != man.stats.solution[0].end(); ++it) {      fs << it->GetLocation().longitude << " " << it->GetLocation().latitude         << " " << it->GetTime()         << "/n";    }  }}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:60,


示例10: GetLocation

void Entity::BuildAdjCross(){    adjFields.clear();    adjFields.push_back({ GetLocation().x - 1, GetLocation().y });    adjFields.push_back({ GetLocation().x + 1, GetLocation().y });    adjFields.push_back({ GetLocation().x, GetLocation().y - 1 });    adjFields.push_back({ GetLocation().x, GetLocation().y + 1 });}
开发者ID:MaciejSzpakowski,项目名称:animals,代码行数:8,


示例11: GetLocation

Variant WebBrowserObject::pget_Location(void){    char *str = GetLocation();    Variant v = anytovariant(str ? str : "");    lmbox_free(str);    return v;}
开发者ID:vseryakov,项目名称:lmbox,代码行数:7,


示例12: Eat

// eats where it stands// return value is not usedbool Rabbit::Eat(){    Grass* grassUnderMyFeet = World::GetWorld()->GetGrass(GetLocation());    // check for wheat    if (grassUnderMyFeet->HasWheat())        metabolism.AddFood(grassUnderMyFeet->EatWheat());    // make sure not to eat more than there is and no more than 5    int food = grassUnderMyFeet->GetFoodLevel();    if (food > 5)        food = 5;    // extra 1 for every 20 levels    food += grassUnderMyFeet->GetFoodLevel() / 20;    // dont eat more than you can    if (metabolism.UntilFull() < food)        food = metabolism.UntilFull();    metabolism.AddFood(food);    grassUnderMyFeet->SubFood(food);	return true;}
开发者ID:MaciejSzpakowski,项目名称:animals,代码行数:27,


示例13: GetLocation

void CPMInternalTextPart::Draw(CDC* pDC, Gdiplus::Graphics* gdip){	if (m_bTextEnabled) {		CRect loc = GetLocation();		DecoratorSDK::GdipFont* pFont = DecoratorSDK::getFacilities().GetFont(m_iFontKey);		CSize size = GetTextSize(gdip, pFont);		if (m_strText.GetLength())		{			DecoratorSDK::getFacilities().DrawString(gdip,									   m_strText,									   CRect(loc.left + m_textRelXPosition, loc.top + m_textRelYPosition - size.cy,											 loc.right + m_textRelXPosition, loc.top + m_textRelYPosition),									   pFont,									   (m_bActive) ? m_crText : DecoratorSDK::COLOR_GREY,									   TA_BOTTOM | TA_LEFT,									   INT_MAX,									   "",									   "",									   false);		}		else		{			DecoratorSDK::getFacilities().DrawRect(gdip, CRect(loc.left + m_textRelXPosition + 3 , loc.top + m_textRelYPosition - size.cy,											 loc.left + m_textRelXPosition + size.cx - 3 - 1, loc.top + m_textRelYPosition - 1), DecoratorSDK::COLOR_GREY, 1);		}	}	if (m_spFCO)		resizeLogic.Draw(pDC, gdip);}
开发者ID:pombredanne,项目名称:metamorphosys-desktop,代码行数:29,


示例14: GetPolygonPoints

static voidGetPolygonPoints(std::vector<RasterPoint> &pts,                 const AirspacePolygon &airspace,                 const RasterPoint pt, unsigned radius){  GeoBounds bounds = airspace.GetGeoBounds();  GeoPoint center = bounds.GetCenter();  fixed geo_heigth = bounds.GetGeoHeight();  fixed geo_width = bounds.GetGeoWidth();  fixed geo_size = std::max(geo_heigth, geo_width);  WindowProjection projection;  projection.SetScreenSize({radius * 2, radius * 2});  projection.SetScreenOrigin(pt.x, pt.y);  projection.SetGeoLocation(center);  projection.SetScale(fixed(radius * 2) / geo_size);  projection.SetScreenAngle(Angle::Zero());  projection.UpdateScreenBounds();  const SearchPointVector &border = airspace.GetPoints();  pts.reserve(border.size());  for (auto it = border.begin(), it_end = border.end(); it != it_end; ++it)    pts.push_back(projection.GeoToScreen(it->GetLocation()));}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:27,


示例15:

voidMapCanvas::Project(const Projection &projection,                   const SearchPointVector &points, BulkPixelPoint *screen){  for (auto it = points.begin(); it != points.end(); ++it)    *screen++ = projection.GeoToScreen(it->GetLocation());}
开发者ID:Advi42,项目名称:XCSoar,代码行数:7,


示例16: iter

TextPointer *TextPointer::GetPositionAtOffset (int offset, LogicalDirection dir) const{	PositionAtOffsetIterator iter ((TextElement*)GetParent(), GetLocation(), GetLogicalDirection());	return iter.GetTextPointer (offset, dir);}
开发者ID:499940913,项目名称:moon,代码行数:7,


示例17: GetLocation

// Camera update functionvoid CameraObject::Update(float dT){	bool bUpdateViewProj = false;	if(bTransformDirty)	{		Matrix4x4::ConstructLookAtMatrix(&cachedViewMatrix, GetLocation(), GetOrientationQuat());		bTransformDirty = false;		bUpdateViewProj = true;	}	if(bProjectionDirty)	{		switch(projectionType)		{		case CameraObject::CLT_Perspective:	Matrix4x4::ConstructPerspectiveMatrix(&cachedProjectionMatrix, pParams.FOV, pParams.Aspect, pParams.Near, pParams.Far); break;		case CameraObject::CLT_Orthographic:	Matrix4x4::ConstructOrthographicMatrix(&cachedProjectionMatrix, oParams.Width, oParams.Height, oParams.Near, oParams.Far); break;		default: assert(false && "Unknown projection type");		}		bProjectionDirty = false;		bUpdateViewProj = true;	}	if(bUpdateViewProj)	{		cachedViewProjectionMatrix = cachedViewMatrix * cachedProjectionMatrix;	}}
开发者ID:SakibSaikia,项目名称:RedeyeEngine,代码行数:30,


示例18: Kill

void Kill(Unit *unit) {    Player *owner = GetPlayerFromColor(GetUnitColor(*unit));    DelUnit(owner, unit);    SetUnit(GetGrid(GetLocation(*unit)), 0);    DestroyUnit(unit);    SetUpkeep(owner, GetUpkeep(*owner) - 1);}
开发者ID:Septica,项目名称:if2110-battle_for_olympia,代码行数:7,


示例19: GetLocation

//---------------------------------------------------------------------------const boost::shared_ptr<Sprite> SimImmuneResponse::GrabSprite(  const EnumLocation location,  const int x,  const int y){  return GetLocation(location)->GrabSprite(x,y);}
开发者ID:RLED,项目名称:ProjectRichelBilderbeek,代码行数:8,


示例20: GetChar

    char16_t StringBuffer::NextChar() {        auto current = GetChar();        if (back_ptr >= 0) {            back_ptr--;        } else {            if (buffer_list.size() == 0) {                return 0x00;            }            auto buf = *buffer_list.begin();            if (char_ptr + 1 >= buf->size()) { // end of buffer                buffer_list.pop_front();                char_ptr = 0;            } else {                char_ptr++;            }            back_buffer.push_back(                std::make_pair(current, GetLocation())            );            check_back_buffer();        }        loc.pos++;        // check utf 16        if (current == ch_endofline) {            loc.line++;            loc.column = 0;        } else {            loc.column++;        }        return current;    }
开发者ID:ChannelOne,项目名称:halang,代码行数:33,


示例21: GetLocation

void PlayerServer::Update(){    Player::Update();    Vector3 oldLocation = GetLocation();    Vector3 oldVelocity = GetVelocity();    if ( mControlType == PCT_HUMAN )    {        ClientProxyPtr client =            NetworkManagerServer::sInstance->GetClientProxy( GetPlayerId() );        if ( !client )        {            LOG( "NO HUMANC CONTROLING THIS, IT HAS BECOME SENTIENT RUN" );            return;        }        MoveList& moveList = client->GetUnprocessedMoveList();        for ( const Move& unprocessedMove : moveList )        {            const InputState& currentState = unprocessedMove.GetInputState();            float deltaTime = unprocessedMove.GetDeltaTime();            ProcessInput( deltaTime, currentState );            SimulateMovement( TIME_STEP );        }        moveList.Clear();        // TODO: Check if there velocity has actually changed before sending        // update        NetworkManagerServer::sInstance->SetStateDirty( GetNetworkId(),                                                        PRS_POSI );    }}
开发者ID:etinlb,项目名称:networkplayground,代码行数:35,


示例22: assert

void TextBox::MoveCaret(int offset){    auto caretLoc = m_caret.GetLocation();    caretLoc.x += offset;    assert(caretLoc.x >= 0);    // ensure the caret stays within bounds    // the delta is the number of pixels past the boundary    // of the text box.  if it's less than offset it means    // there is part of a char being clipped, so instead of    // adjusting m_clipOffset by the full offset adjust it    // by the number of pixels being clipped.    auto location = GetLocation();    if (caretLoc.x > (location.x + location.w) - (TextOffsetX + (CaretWidth - 1)))    {        // caret tried to move past the right bound, adjust the offset based on the delta        offset = caretLoc.x - ((location.x + location.w) - (TextOffsetX + (CaretWidth - 1)));        caretLoc.x = (location.x + location.w) - (TextOffsetX + (CaretWidth - 1));        m_clipOffset += offset;    }    else if (caretLoc.x < location.x + TextOffsetX)    {        // caret tried to move past the left bound, adjust the offset based on the delta        offset = caretLoc.x - (location.x + TextOffsetX);        caretLoc.x = location.x + TextOffsetX;        if (m_clipOffset > 0)            m_clipOffset += offset;    }    assert(m_clipOffset >= 0);    m_caret.SetLocation(caretLoc);}
开发者ID:noparity,项目名称:libsdlgui,代码行数:35,


示例23: GetPlayerLocation

// Get the player location//qboolean GetPlayerLocation (edict_t * self, char *buf){	if (GetLocation((int)self->s.origin[0], (int)self->s.origin[1], (int)self->s.origin[2], 0, buf))		return true;	return false;}
开发者ID:DusteDdk,项目名称:aq2-tng-bk,代码行数:9,


示例24: PrintEnemies

void PrintEnemies(Enemies enemies) {    Unit enemy;    char stringEnemyClass[11];    char stringRetaliates[13];    POINT enemyLocation;    for (int i = 0; i < enemies.count; ++i) {        enemy = *enemies.enemy[i].unit;        UnitClassName(GetUnitClass(enemy), stringEnemyClass);        if (enemies.enemy[i].canRetaliate) {            strcpy(stringRetaliates, "(Retaliates)");        } else {            strcpy(stringRetaliates, "");        }        enemyLocation = GetLocation(enemy);        printf("%d. %s (%d,%d) | Health %d/%d %s/n",             1+i,             stringEnemyClass,             enemyLocation.X,             enemyLocation.Y,            GetHealth(enemy),             GetMaximumHealth(enemy),            stringRetaliates        );    }}
开发者ID:Septica,项目名称:if2110-battle_for_olympia,代码行数:29,


示例25: GetLocation

uint32_t TommyCoin::Write( OutgoingPacketBuffer& inPacket, uint32_t inDirtyState ) const {	uint32_t writtenState = 0;	uint32_t remainingBytes = inPacket.GetRemainingBytes();	if( remainingBytes >= 3 * sizeof( float ) + sizeof( XMVECTOR ) )	{		bool poseDirty = inDirtyState & ETCRS_Pose;		bool colorDirty = inDirtyState & ETCRS_Color;		inPacket.Write(poseDirty);		if (poseDirty) {			XMVECTORF32 location; location.v = GetLocation();			inPacket.Write(location.f[0]);			inPacket.Write(location.f[1]);			inPacket.Write(GetRotation());		}		inPacket.Write(colorDirty);		if (colorDirty) {			inPacket.Write(GetColor());		}		writtenState |= inDirtyState;	}	return writtenState;}
开发者ID:jmdigiov,项目名称:ITP-470-Labs,代码行数:31,


示例26: GetLocation

void AttributePart::Draw(CDC* pDC, Gdiplus::Graphics* gdip){	if (m_bTextEnabled) {		CRect loc = GetLocation();		DecoratorSDK::GdipFont* pFont = getFacilities().GetFont(m_iFontKey);		CSize size = getFacilities().MeasureText(gdip, pFont, m_strText);		getFacilities().DrawString(gdip,								   m_strText + ATTRIBUTE_SEP,								   CRect(loc.left + DECORATOR_MARGINX, loc.top + m_textRelYPosition - size.cy,										 loc.right - DECORATOR_MARGINX, loc.top + m_textRelYPosition),								   pFont,								   (m_bActive) ? m_crText : COLOR_GREY,								   TA_BOTTOM | TA_LEFT,								   m_iMaxTextLength,								   "",								   "",								   false);		getFacilities().DrawString(gdip,								   m_strType,								   CRect(loc.left + DECORATOR_MARGINX, loc.top + m_textRelYPosition - size.cy,										 loc.right - DECORATOR_MARGINX, loc.top + m_textRelYPosition),								   pFont,								   (m_bActive) ? m_crText : COLOR_GREY,								   TA_BOTTOM | TA_RIGHT,								   m_iMaxTextLength,								   "",								   "",								   false);	}	if (m_spFCO)		resizeLogic.Draw(pDC, gdip);}
开发者ID:dyao-vu,项目名称:meta-core,代码行数:32,


示例27: BuildAdjSquare

void Animal::BuildAdjSquare(int edge){    adjFields.clear();    for (int i = -edge; i <= edge; i++)        for (int j = -edge; j <= edge; j++)            adjFields.push_back(GetLocation() + sf::Vector2i(j, i));}
开发者ID:MaciejSzpakowski,项目名称:animals,代码行数:7,


示例28: GetSightedLocation

// Get the sighted location//voidGetSightedLocation (edict_t * self, char *buf){  vec3_t start, forward, right, end, up, offset;  int xo, yo, zo;  trace_t tr;  AngleVectors (self->client->v_angle, forward, right, up);  VectorSet (offset, 24, 8, self->viewheight);  P_ProjectSource (self->client, self->s.origin, offset, forward, right,		   start);  VectorMA (start, 8192, forward, end);  PRETRACE ();  tr =    gi.trace (start, NULL, NULL, end, self,	      CONTENTS_SOLID | CONTENTS_MONSTER | CONTENTS_DEADMONSTER);  POSTTRACE ();  xo = tr.endpos[0];  yo = tr.endpos[1];  zo = tr.endpos[2];  GetLocation (xo, yo, zo, 10, buf);}
开发者ID:tomas-edwardsson,项目名称:aq2tng,代码行数:28,



注:本文中的GetLocation函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GetLock函数代码示例
C++ GetLocaleInfo函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。