本文整理汇总了C++中SVGPathElement::GET_SIMPLE_VAL方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGPathElement::GET_SIMPLE_VAL方法的具体用法?C++ SVGPathElement::GET_SIMPLE_VAL怎么用?C++ SVGPathElement::GET_SIMPLE_VAL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGPathElement
的用法示例。
在下文中一共展示了SVGPathElement::GET_SIMPLE_VAL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void
SVGAnimateMotionElement::animationTraverse(svgl::AnimationInfo* animinfo)
{
_elementToAnimate = animinfo->element;
_translateToAnimate = 0;
SVGTransformable* toAnimate = dynamic_cast<SVGTransformable*>(_elementToAnimate);
if(!toAnimate) {
std::cerr << "element refered by 'animateMotion' is not a SVGTransformable" << __FL__;
return;
}
Attribute< SVGAnimatedTransformList >& transform = toAnimate->transform;
{
std::vector <float> v;
v.push_back(0);
v.push_back(0);
_translateToAnimate = new SVGTranslateTransform(v);
}
MYGET_ANIMATED_VAL(transform).insertItemBefore(_translateToAnimate, 0);
_doBezierAnim=false;
_doRotateAnim = rotate_no;
_rotateToAnimate=0;
const SVGNumberList& keytimes = GET_SIMPLE_VAL(KeyTimes);
const SVGPathSegList* pl=0;
dom::Node *n = getFirstChild();
if(n) {
SVGMPathElement* mpath = 0;
for(;n;n=n->getNextSibling()) {
mpath = dynamic_cast<SVGMPathElement*>(n);
if(mpath)
break;
}
if(mpath) {
unicode::String* href = mpath->GET_SIMPLE_VAL(Href);
if(href->getLength()) {
dom::Element* de = animinfo->externalEntityManager->get(href, getOwnerDocument());
//dom::Element* de = GET_SIMPLE_VAL(OwnerSVGElement)->getElementById(href->substring(1));
SVGPathElement* path = dynamic_cast<SVGPathElement*>(de);
if(de)
pl = &(path->GET_SIMPLE_VAL(PathSegList));
}
}
}
else
pl = &(GET_SIMPLE_VAL(Path));
if (pl && pl->numberOfItems()>=2) {
BezierPath bezier;
for(unsigned int i=0; i<pl->numberOfItems(); ++i) {
const SVGPathSeg* p = pl->getItem(i);
p->updateBezier(bezier);
}
_distanceIter = new svgl::BezierPathDistanceIterator(bezier,.1);
_bezierLength = svgl::length(bezier);
unicode::String* rotate_ptr = GET_SIMPLE_VAL(Rotate);
unicode::String& rotate = *rotate_ptr;
if (rotate_ptr && rotate.getLength()) {
static unicode::String
&auto_string = *unicode::String::internString("auto"),
&auto_reverse_string = *unicode::String::internString("auto-reverse");
float rot=0;
if(rotate==auto_string) {
_doRotateAnim=rotate_auto;
}
else if(rotate==auto_reverse_string) {
_doRotateAnim=rotate_auto_reverse;
}
else {
if (unicode::get_float(rotate, &rot)) {
_doRotateAnim=rotate_angle;
}
}
if(_doRotateAnim!=rotate_no) {
std::vector<float> v;
v.push_back(rot);
v.push_back(0);
v.push_back(0);
_rotateToAnimate = new SVGRotateTransform(v);
MYGET_ANIMATED_VAL(transform).insertItemBefore(_rotateToAnimate, 1);
}
}
_doBezierAnim = true;
}
else {
const SVGLengthList& values = GET_SIMPLE_VAL(Values);
unsigned int valuesSize = values.numberOfItems();
if(valuesSize) {
if(valuesSize % 2) {
std::cerr << "'values' for 'animateMotion' must be a list of pair of length" << __FL__;
return;
}
if(keytimes.numberOfItems()) {
if(keytimes.numberOfItems()!=values.numberOfItems()) {
std::cerr << "'keyTimes' and 'values' have different size" << __FL__;
//.........这里部分代码省略.........