本文整理汇总了C++中PathObject::updatePathCoords方法的典型用法代码示例。如果您正苦于以下问题:C++ PathObject::updatePathCoords方法的具体用法?C++ PathObject::updatePathCoords怎么用?C++ PathObject::updatePathCoords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathObject
的用法示例。
在下文中一共展示了PathObject::updatePathCoords方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createBaselineRenderables
void TextSymbol::createBaselineRenderables(
const TextObject* text_object,
const VirtualCoordVector& coords,
ObjectRenderables& output) const
{
const MapColor* dominant_color = guessDominantColor();
if (dominant_color && text_object->getNumLines() > 0)
{
// Insert text boundary
LineSymbol line_symbol;
line_symbol.setColor(dominant_color);
line_symbol.setLineWidth(0);
const TextObjectLineInfo* line = text_object->getLineInfo(0);
QRectF text_bbox(line->line_x, line->line_y - line->ascent, line->width, line->ascent + line->descent);
for (int i = 1; i < text_object->getNumLines(); ++i)
{
const TextObjectLineInfo* line = text_object->getLineInfo(i);
rectInclude(text_bbox, QRectF(line->line_x, line->line_y - line->ascent, line->width, line->ascent + line->descent));
}
Q_UNUSED(coords); // coords should be used for calcTextToMapTransform()
QTransform text_to_map = text_object->calcTextToMapTransform();
PathObject path;
path.addCoordinate(MapCoord(text_to_map.map(text_bbox.topLeft())));
path.addCoordinate(MapCoord(text_to_map.map(text_bbox.topRight())));
path.addCoordinate(MapCoord(text_to_map.map(text_bbox.bottomRight())));
path.addCoordinate(MapCoord(text_to_map.map(text_bbox.bottomLeft())));
path.parts().front().setClosed(true, true);
path.updatePathCoords();
LineRenderable* line_renderable = new LineRenderable(&line_symbol, path.parts().front(), false);
output.insertRenderable(line_renderable);
}
}