本文整理汇总了C++中SVGPathTraversalStateBuilder类的典型用法代码示例。如果您正苦于以下问题:C++ SVGPathTraversalStateBuilder类的具体用法?C++ SVGPathTraversalStateBuilder怎么用?C++ SVGPathTraversalStateBuilder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SVGPathTraversalStateBuilder类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getPointAtLengthOfSVGPathByteStream
bool getPointAtLengthOfSVGPathByteStream(SVGPathByteStream* stream, float length, SVGPoint& point)
{
ASSERT(stream);
if (stream->isEmpty())
return false;
PathTraversalState traversalState(PathTraversalState::Action::VectorAtLength);
SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, length);
auto source = std::make_unique<SVGPathByteStreamSource>(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
point = builder->currentPoint();
parser->cleanup();
return ok;
}
示例2: getSVGPathSegAtLengthFromSVGPathByteStream
bool getSVGPathSegAtLengthFromSVGPathByteStream(SVGPathByteStream* stream, float length, unsigned& pathSeg)
{
ASSERT(stream);
if (stream->isEmpty())
return false;
PathTraversalState traversalState(PathTraversalState::Action::SegmentAtLength);
SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, length);
auto source = std::make_unique<SVGPathByteStreamSource>(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
pathSeg = builder->pathSegmentIndex();
parser->cleanup();
return ok;
}
示例3: getTotalLengthOfSVGPathByteStream
bool getTotalLengthOfSVGPathByteStream(SVGPathByteStream* stream, float& totalLength)
{
ASSERT(stream);
if (stream->isEmpty())
return false;
PathTraversalState traversalState(PathTraversalState::Action::TotalLength);
SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, 0);
auto source = std::make_unique<SVGPathByteStreamSource>(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
totalLength = builder->totalLength();
parser->cleanup();
return ok;
}
示例4: getPointAtLengthOfSVGPathByteStream
bool getPointAtLengthOfSVGPathByteStream(SVGPathByteStream* stream, float length, FloatPoint& point)
{
ASSERT(stream);
if (stream->isEmpty())
return false;
PathTraversalState traversalState(PathTraversalState::TraversalPointAtLength);
SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, length);
OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
point = builder->currentPoint();
parser->cleanup();
return ok;
}
示例5: ASSERT
bool SVGPathParserFactory::getTotalLengthOfSVGPathByteStream(SVGPathByteStream* stream, float& totalLength)
{
ASSERT(stream);
if (stream->isEmpty())
return false;
PathTraversalState traversalState(PathTraversalState::TraversalTotalLength);
SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, 0);
OwnPtr<SVGPathByteStreamSource> source = SVGPathByteStreamSource::create(stream);
SVGPathParser* parser = globalSVGPathParser(source.get(), builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
totalLength = builder->totalLength();
parser->cleanup();
return ok;
}
示例6: getTotalLengthOfSVGPathByteStream
bool getTotalLengthOfSVGPathByteStream(const SVGPathByteStream* stream, float& totalLength)
{
ASSERT(stream);
if (stream->isEmpty())
return false;
PathTraversalState traversalState(PathTraversalState::TraversalTotalLength);
SVGPathTraversalStateBuilder* builder = globalSVGPathTraversalStateBuilder(traversalState, 0);
SVGPathByteStreamSource source(stream);
SVGPathParser* parser = globalSVGPathParser(&source, builder);
bool ok = parser->parsePathDataFromSource(NormalizedParsing);
totalLength = builder->totalLength();
parser->cleanup();
return ok;
}