本文整理汇总了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);
}
示例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;
}
示例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);
}
示例4: GetLocation
bool King::LookNorth()
{
Location temp = GetLocation();
temp.MoveY(-1);
return GetLocation().IsWall(temp.GetCoordinates(), GetMaze());
};
示例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;
}
示例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 );
}
}
示例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);
}
示例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;
}
}
}
示例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";
}
}
}
示例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 });
}
示例11: GetLocation
Variant WebBrowserObject::pget_Location(void)
{
char *str = GetLocation();
Variant v = anytovariant(str ? str : "");
lmbox_free(str);
return v;
}
示例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;
}
示例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);
}
示例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()));
}
示例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());
}