本文整理汇总了C++中agg::path_storage::join_path方法的典型用法代码示例。如果您正苦于以下问题:C++ path_storage::join_path方法的具体用法?C++ path_storage::join_path怎么用?C++ path_storage::join_path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类agg::path_storage
的用法示例。
在下文中一共展示了path_storage::join_path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddDrawCmdToAGGPathStorage
void ASSDrawEngine::AddDrawCmdToAGGPathStorage(DrawCmd* cmd, agg::path_storage& path, DRAWCMDMODE mode)
{
if (mode == HILITE && cmd->prev)
path.move_to(cmd->prev->m_point->x(), cmd->prev->m_point->y());
switch(cmd->type)
{
case M:
path.move_to(cmd->m_point->x(),cmd->m_point->y());
break;
case B:
if (cmd->initialized)
{
//path.move_to(cmd->prev->m_point->x(),cmd->prev->m_point->y());
PointList::iterator iterate = cmd->controlpoints.begin();
int x[2], y[2];
x[0] = (*iterate)->x();
y[0] = (*iterate)->y();
iterate++;
x[1] = (*iterate)->x();
y[1] = (*iterate)->y();
path.curve4(x[0], y[0], x[1], y[1], cmd->m_point->x(),cmd->m_point->y());
break;
}
case L:
if (mode == CTRL_LN)
path.move_to(cmd->m_point->x(),cmd->m_point->y());
else
path.line_to(cmd->m_point->x(),cmd->m_point->y());
break;
case S:
unsigned np = cmd->controlpoints.size();
agg::pod_array<double> m_polygon(np * 2);
unsigned _pn = 0;
PointList::iterator iterate = cmd->controlpoints.begin();
while (iterate != cmd->controlpoints.end())
{
m_polygon[_pn] = (*iterate)->x(); _pn++;
m_polygon[_pn] = (*iterate)->y(); _pn++;
iterate++;
}
//m_polygon[_pn++] = cmd->m_point->x();
//m_polygon[_pn++] = cmd->m_point->y();
//path.move_to(cmd->prev->m_point->x(),cmd->prev->m_point->y());
if (mode == CTRL_LN)
{
_pn = 0;
while (_pn < np * 2)
{
path.line_to((int) m_polygon[_pn],(int) m_polygon[_pn + 1]);
_pn += 2;
}
path.line_to(cmd->m_point->x(), cmd->m_point->y());
}
else
{
//path.line_to((int) m_polygon[0],(int) m_polygon[1]);
aggpolygon poly(&m_polygon[0], np, false, false);
agg::conv_bcspline<agg::simple_polygon_vertex_source> bspline(poly);
bspline.interpolation_step(0.01);
agg::path_storage npath;
npath.join_path(bspline);
path.join_path(npath);
if (mode == HILITE)
path.move_to((int) m_polygon[np * 2 - 2], (int) m_polygon[np * 2 - 1] );
path.line_to(cmd->m_point->x(), cmd->m_point->y());
}
break;
}
}