本文整理汇总了C++中SVGPathParser::setCurrentConsumer方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGPathParser::setCurrentConsumer方法的具体用法?C++ SVGPathParser::setCurrentConsumer怎么用?C++ SVGPathParser::setCurrentConsumer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGPathParser
的用法示例。
在下文中一共展示了SVGPathParser::setCurrentConsumer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: source
PassRefPtr<SVGPathSeg> SVGPathSegList::appendItem(PassRefPtr<SVGPathSeg> passItem)
{
updateListFromByteStream();
RefPtr<SVGPathSeg> item = Base::appendItem(passItem);
if (m_byteStream) {
SVGPathByteStreamBuilder builder;
builder.setCurrentByteStream(m_byteStream.get());
SVGPathSegListSource source(lastAppended(), end());
SVGPathParser parser;
parser.setCurrentConsumer(&builder);
parser.setCurrentSource(&source);
parser.parsePathDataFromSource(UnalteredParsing, false);
}
return item.release();
}
示例2: byteStream
const SVGPathByteStream* SVGPathSegList::byteStream() const
{
if (!m_byteStream) {
m_byteStream = SVGPathByteStream::create();
if (!Base::isEmpty()) {
SVGPathByteStreamBuilder builder;
builder.setCurrentByteStream(m_byteStream.get());
SVGPathSegListSource source(begin(), end());
SVGPathParser parser;
parser.setCurrentConsumer(&builder);
parser.setCurrentSource(&source);
parser.parsePathDataFromSource(UnalteredParsing);
}
}
return m_byteStream.get();
}
示例3: updateListFromByteStream
void SVGPathSegList::updateListFromByteStream()
{
if (m_listSyncedToByteStream)
return;
Base::clear();
if (m_byteStream && !m_byteStream->isEmpty()) {
SVGPathSegListBuilder builder;
builder.setCurrentSVGPathElement(m_contextElement);
builder.setCurrentSVGPathSegList(this);
builder.setCurrentSVGPathSegRole(PathSegUnalteredRole);
SVGPathByteStreamSource source(m_byteStream.get());
SVGPathParser parser;
parser.setCurrentConsumer(&builder);
parser.setCurrentSource(&source);
parser.parsePathDataFromSource(UnalteredParsing);
}
m_listSyncedToByteStream = true;
}
示例4: buildPathFromString
bool SVGPathParserFactory::buildPathFromString(const CStdString& d, KdPath& result) {
if (d.IsEmpty())
return false;
SVGPathBuilder* builder = new SVGPathBuilder();
builder->setCurrentPath(&result);
//OwnPtr<SVGPathStringSource> source = SVGPathStringSource::create(d);
SVGPathStringSource* source = new SVGPathStringSource(d);
//SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
SVGPathParser* parser = new SVGPathParser();
parser->setCurrentSource(source);
parser->setCurrentConsumer(builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
parser->cleanup();
delete parser;
delete source;
delete builder;
return ok;
}