当前位置: 首页>>代码示例>>C++>>正文


C++ GetLocation函数代码示例

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


在下文中一共展示了GetLocation函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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,代码来源:guiwindow.cpp

示例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,代码来源:RoboCat.cpp

示例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,代码来源:TextBox.cpp

示例4: GetLocation

bool King::LookNorth()
{
	Location temp = GetLocation();
	temp.MoveY(-1);

	return GetLocation().IsWall(temp.GetCoordinates(), GetMaze());
};
开发者ID:johnballantyne,项目名称:mazegeneration483w,代码行数:7,代码来源:King.cpp

示例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,代码来源:CardButton.cpp

示例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,代码来源:RoboCatServer.cpp

示例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,代码来源:SampledTaskPoint.cpp

示例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,代码来源:Mapper.cpp

示例9: fs

void
PrintHelper::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,代码来源:ContestPrinting.cpp

示例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,代码来源:entity.cpp

示例11: GetLocation

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

示例12: Eat

// eats where it stands
// return value is not used
bool 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,代码来源:rabbit.cpp

示例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,代码来源:CPMAttributePart.cpp

示例14: GetPolygonPoints

static void
GetPolygonPoints(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,代码来源:AirspacePreviewRenderer.cpp

示例15:

void
MapCanvas::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,代码来源:MapCanvas.cpp


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