本文整理汇总了C++中ref_ptr::AddShapeRenderer方法的典型用法代码示例。如果您正苦于以下问题:C++ ref_ptr::AddShapeRenderer方法的具体用法?C++ ref_ptr::AddShapeRenderer怎么用?C++ ref_ptr::AddShapeRenderer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ref_ptr
的用法示例。
在下文中一共展示了ref_ptr::AddShapeRenderer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CacheRuler
m2::PointF LayerCacher::CacheRuler(Position const & position, ref_ptr<LayerRenderer> renderer,
ref_ptr<dp::TextureManager> textures)
{
m2::PointF rulerSize;
renderer->AddShapeRenderer(WIDGET_RULER,
Ruler(position).Draw(rulerSize, textures));
return rulerSize;
}
示例2: CacheCopyright
m2::PointF LayerCacher::CacheCopyright(Position const & position, ref_ptr<LayerRenderer> renderer,
ref_ptr<dp::TextureManager> textures)
{
m2::PointF size;
renderer->AddShapeRenderer(WIDGET_COPYRIGHT,
CopyrightLabel(position).Draw(size, textures));
return size;
}
示例3: CacheCompass
m2::PointF LayerCacher::CacheCompass(Position const & position, ref_ptr<LayerRenderer> renderer,
ref_ptr<dp::TextureManager> textures)
{
m2::PointF compassSize;
Compass compass = Compass(position);
drape_ptr<ShapeRenderer> shape = compass.Draw(compassSize, textures, bind(&DrapeGui::CallOnCompassTappedHandler,
&DrapeGui::Instance()));
renderer->AddShapeRenderer(WIDGET_COMPASS, move(shape));
return compassSize;
}
示例4: CacheScaleLabel
m2::PointF LayerCacher::CacheScaleLabel(Position const & position, ref_ptr<LayerRenderer> renderer, ref_ptr<dp::TextureManager> textures)
{
MutableLabelDrawer::Params params;
params.m_alphabet = "Scale: 1234567890";
params.m_maxLength = 10;
params.m_anchor = position.m_anchor;
params.m_font = DrapeGui::GetGuiTextFont();
params.m_pivot = position.m_pixelPivot;
params.m_handleCreator = [textures](dp::Anchor, m2::PointF const &)
{
return make_unique_dp<ScaleLabelHandle>(EGuiHandle::GuiHandleScaleLabel, textures);
};
drape_ptr<ShapeRenderer> scaleRenderer = make_unique_dp<ShapeRenderer>();
m2::PointF size = MutableLabelDrawer::Draw(params, textures, bind(&ShapeRenderer::AddShape, scaleRenderer.get(), _1, _2));
renderer->AddShapeRenderer(WIDGET_SCALE_LABEL, move(scaleRenderer));
return size;
}