本文整理汇总了C++中TileKey::GetGlobalRect方法的典型用法代码示例。如果您正苦于以下问题:C++ TileKey::GetGlobalRect方法的具体用法?C++ TileKey::GetGlobalRect怎么用?C++ TileKey::GetGlobalRect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TileKey
的用法示例。
在下文中一共展示了TileKey::GetGlobalRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Render
void SelectionShape::Render(ScreenBase const & screen, int zoomLevel, ref_ptr<dp::GpuProgramManager> mng,
dp::UniformValuesStorage const & commonUniforms)
{
ShowHideAnimation::EState state = m_animation.GetState();
if (state == ShowHideAnimation::STATE_VISIBLE ||
state == ShowHideAnimation::STATE_SHOW_DIRECTION)
{
dp::UniformValuesStorage uniforms = commonUniforms;
TileKey const key = GetTileKeyByPoint(m_position, ClipTileZoomByMaxDataZoom(zoomLevel));
math::Matrix<float, 4, 4> mv = key.GetTileBasedModelView(screen);
uniforms.SetMatrix4x4Value("modelView", mv.m_data);
m2::PointD const pos = MapShape::ConvertToLocal(m_position, key.GetGlobalRect().Center(), kShapeCoordScalar);
uniforms.SetFloatValue("u_position", pos.x, pos.y, -m_positionZ);
float accuracy = m_mapping.GetValue(m_animation.GetT());
if (screen.isPerspective())
{
m2::PointD const pt1 = screen.GtoP(m_position);
m2::PointD const pt2(pt1.x + 1, pt1.y);
float const scale = screen.PtoP3d(pt2).x - screen.PtoP3d(pt1).x;
accuracy /= scale;
}
uniforms.SetFloatValue("u_accuracy", accuracy);
uniforms.SetFloatValue("u_opacity", 1.0f);
m_renderNode->Render(mng, uniforms);
}
}
示例2: make_ref
ref_ptr<MarksIDGroups> UserMarkGenerator::GetUserLinesGroups(TileKey const & tileKey)
{
auto itTile = m_index.end();
int const lineZoom = GetNearestLineIndexZoom(tileKey.m_zoomLevel);
CalcTilesCoverage(tileKey.GetGlobalRect(), lineZoom,
[this, &itTile, lineZoom](int tileX, int tileY)
{
itTile = m_index.find(TileKey(tileX, tileY, lineZoom));
});
if (itTile != m_index.end())
return make_ref(itTile->second);
return nullptr;
}
示例3: RenderAccuracy
void MyPosition::RenderAccuracy(ScreenBase const & screen, int zoomLevel,
ref_ptr<dp::GpuProgramManager> mng,
dp::UniformValuesStorage const & commonUniforms)
{
dp::UniformValuesStorage uniforms = commonUniforms;
m2::PointD accuracyPoint(m_position.x + m_accuracy, m_position.y);
float pixelAccuracy = (screen.GtoP(accuracyPoint) - screen.GtoP(m_position)).Length();
TileKey const key = GetTileKeyByPoint(m_position, ClipTileZoomByMaxDataZoom(zoomLevel));
math::Matrix<float, 4, 4> mv = key.GetTileBasedModelView(screen);
uniforms.SetMatrix4x4Value("modelView", mv.m_data);
m2::PointD const pos = MapShape::ConvertToLocal(m_position, key.GetGlobalRect().Center(), kShapeCoordScalar);
uniforms.SetFloatValue("u_position", pos.x, pos.y, 0.0f);
uniforms.SetFloatValue("u_accuracy", pixelAccuracy);
uniforms.SetFloatValue("u_opacity", 1.0f);
RenderPart(mng, uniforms, MY_POSITION_ACCURACY);
}
示例4: RenderMyPosition
void MyPosition::RenderMyPosition(ScreenBase const & screen, int zoomLevel,
ref_ptr<dp::GpuProgramManager> mng,
dp::UniformValuesStorage const & commonUniforms)
{
if (m_showAzimuth)
{
m_arrow3d.SetPosition(m_position);
m_arrow3d.SetAzimuth(m_azimuth);
m_arrow3d.Render(screen, zoomLevel, mng);
}
else
{
dp::UniformValuesStorage uniforms = commonUniforms;
TileKey const key = GetTileKeyByPoint(m_position, ClipTileZoomByMaxDataZoom(zoomLevel));
math::Matrix<float, 4, 4> mv = key.GetTileBasedModelView(screen);
uniforms.SetMatrix4x4Value("modelView", mv.m_data);
m2::PointD const pos = MapShape::ConvertToLocal(m_position, key.GetGlobalRect().Center(), kShapeCoordScalar);
uniforms.SetFloatValue("u_position", pos.x, pos.y, dp::depth::MY_POSITION_MARK);
uniforms.SetFloatValue("u_azimut", -(m_azimuth + screen.GetAngle()));
uniforms.SetFloatValue("u_opacity", 1.0);
RenderPart(mng, uniforms, MY_POSITION_POINT);
}
}