本文整理汇总了C++中LineBuffer::LineTo方法的典型用法代码示例。如果您正苦于以下问题:C++ LineBuffer::LineTo方法的具体用法?C++ LineBuffer::LineTo怎么用?C++ LineBuffer::LineTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LineBuffer
的用法示例。
在下文中一共展示了LineBuffer::LineTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawSymbol
void SE_Renderer::DrawSymbol(SE_RenderPrimitiveList& symbol,
const SE_Matrix& xform,
double angleRad,
bool excludeRegion)
{
RS_Bounds extents(DBL_MAX, DBL_MAX, DBL_MAX, -DBL_MAX, -DBL_MAX, -DBL_MAX);
unsigned int nprims = symbol.size();
for (unsigned int i=0; i<nprims; ++i)
{
SE_RenderPrimitive* primitive = symbol[i];
if (primitive->type == SE_RenderPrimitive_Polygon || primitive->type == SE_RenderPrimitive_Polyline)
{
SE_RenderPolyline* rp = (SE_RenderPolyline*)primitive;
LineBuffer* lb = rp->geometry->xf_buffer();
// update the extents with this primitive
RS_Bounds lbnds;
lb->ComputeBounds(lbnds);
extents.add_bounds(lbnds);
if (m_bSelectionMode)
{
if (primitive->type == SE_RenderPrimitive_Polygon)
DrawScreenPolygon(lb, &xform, m_selFillColor);
m_selLineStroke.cap = rp->lineStroke.cap;
m_selLineStroke.join = rp->lineStroke.join;
m_selLineStroke.miterLimit = rp->lineStroke.miterLimit;
DrawScreenPolyline(lb, &xform, m_selLineStroke);
}
else
{
if (primitive->type == SE_RenderPrimitive_Polygon)
DrawScreenPolygon(lb, &xform, ((SE_RenderPolygon*)primitive)->fill);
DrawScreenPolyline(lb, &xform, rp->lineStroke);
}
}
else if (primitive->type == SE_RenderPrimitive_Text)
{
SE_RenderText* tp = (SE_RenderText*)primitive;
// update the extents with this primitive's bounds
for (int j=0; j<4; ++j)
extents.add_point(primitive->bounds[j]);
// get position and angle to use
double x, y;
xform.transform(tp->position[0], tp->position[1], x, y);
RS_TextDef tdef = tp->tdef;
tdef.rotation() += angleRad * M_180PI;
if (m_bSelectionMode)
{
tdef.textcolor() = m_textForeColor;
tdef.ghostcolor() = m_textBackColor;
// tdef.framecolor() = m_textBackColor;
// tdef.opaquecolor() = m_textBackColor;
}
// Here we cannot use the cached RS_TextMetrics in the SE_RenderText object.
// We must recalculate the text metrics with the new tdef before we can call DrawScreenText.
RS_TextMetrics tm;
if (this->GetRSFontEngine()->GetTextMetrics(tp->content, tdef, tm, false))
DrawScreenText(tm, tdef, x, y, NULL, 0, 0.0);
}
else if (primitive->type == SE_RenderPrimitive_Raster)
{
SE_RenderRaster* rp = (SE_RenderRaster*)primitive;
if (m_bSelectionMode)
{
// if the raster symbol is selected, then draw the mask selection polygon only
LineBuffer *lb = LineBufferPool::NewLineBuffer(m_pPool, 5);
std::auto_ptr<LineBuffer> spLB(lb);
lb->MoveTo(rp->bounds[3].x, rp->bounds[3].y);
for (int i = 0; i < 4; ++i)
{
lb->LineTo(rp->bounds[i].x, rp->bounds[i].y);
}
DrawScreenPolygon(lb, &xform, m_selFillColor);
DrawScreenPolyline(lb, &xform, m_selLineStroke);
LineBufferPool::FreeLineBuffer(m_pPool, spLB.release());
}
else
{
ImageData& imgData = rp->imageData;
if (imgData.data != NULL)
{
// update the extents with this primitive's bounds
for (int j=0; j<4; ++j)
extents.add_point(primitive->bounds[j]);
// get position and angle to use
//.........这里部分代码省略.........