本文整理汇总了C++中SPCurve::last_point方法的典型用法代码示例。如果您正苦于以下问题:C++ SPCurve::last_point方法的具体用法?C++ SPCurve::last_point怎么用?C++ SPCurve::last_point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPCurve
的用法示例。
在下文中一共展示了SPCurve::last_point方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: spdc_attach_selection
static void spdc_attach_selection(FreehandBase *dc, Inkscape::Selection */*sel*/)
{
// We reset white and forget white/start/end anchors
spdc_reset_white(dc);
dc->sa = NULL;
dc->ea = NULL;
SPItem *item = dc->selection ? dc->selection->singleItem() : NULL;
if ( item && SP_IS_PATH(item) ) {
// Create new white data
// Item
dc->white_item = item;
// Curve list
// We keep it in desktop coordinates to eliminate calculation errors
SPCurve *norm = SP_PATH(item)->get_curve_for_edit();
norm->transform((dc->white_item)->i2dt_affine());
g_return_if_fail( norm != NULL );
dc->white_curves = g_slist_reverse(norm->split());
norm->unref();
// Anchor list
for (GSList *l = dc->white_curves; l != NULL; l = l->next) {
SPCurve *c;
c = static_cast<SPCurve*>(l->data);
g_return_if_fail( c->get_segment_count() > 0 );
if ( !c->is_closed() ) {
SPDrawAnchor *a;
a = sp_draw_anchor_new(dc, c, TRUE, *(c->first_point()));
if (a)
dc->white_anchors = g_slist_prepend(dc->white_anchors, a);
a = sp_draw_anchor_new(dc, c, FALSE, *(c->last_point()));
if (a)
dc->white_anchors = g_slist_prepend(dc->white_anchors, a);
}
}
// fixme: recalculate active anchor?
}
}
示例2: if
void
SPConnEndPair::getEndpoints(Geom::Point endPts[]) const {
SPCurve *curve = _path->original_curve ? _path->original_curve : _path->curve;
SPItem *h2attItem[2];
getAttachedItems(h2attItem);
Geom::Matrix i2d = sp_item_i2doc_affine(SP_ITEM(_path));
for (unsigned h = 0; h < 2; ++h) {
if ( h2attItem[h] ) {
g_assert(h2attItem[h]->avoidRef);
endPts[h] = h2attItem[h]->avoidRef->getConnectionPointPos(_connEnd[h]->type, _connEnd[h]->id);
}
else if (!curve->is_empty())
{
if (h == 0) {
endPts[h] = *(curve->first_point())*i2d;
}
else {
endPts[h] = *(curve->last_point())*i2d;
}
}
}
}