void AnchorIndicatorGraphicsItem::updateAnchorIndicator(const AnchorLine &sourceAnchorLine, const AnchorLine targetAnchorLine)
{
    m_sourceAnchorLineType = sourceAnchorLine.type();
    m_targetAnchorLineType = targetAnchorLine.type();

    m_startPoint = createAnchorPoint(sourceAnchorLine.qmlItemNode(), sourceAnchorLine.type());

    if (targetAnchorLine.qmlItemNode() == sourceAnchorLine.qmlItemNode().instanceParentItem())
        m_endPoint = createParentAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type(), sourceAnchorLine.qmlItemNode());
    else
        m_endPoint = createAnchorPoint(targetAnchorLine.qmlItemNode(), targetAnchorLine.type());

    m_firstControlPoint = createControlPoint(m_startPoint, sourceAnchorLine.type(), m_endPoint);
    m_secondControlPoint = createControlPoint(m_endPoint, targetAnchorLine.type(), m_startPoint);

    updateAnchorLinePoints(&m_sourceAnchorLineFirstPoint, &m_sourceAnchorLineSecondPoint, sourceAnchorLine);
    updateAnchorLinePoints(&m_targetAnchorLineFirstPoint, &m_targetAnchorLineSecondPoint, targetAnchorLine);

    updateBoundingRect();
    update();
}
bool LayerAnimationStudy10::init()
{
    if (!LayerColor::initWithColor(Color4B::WHITE))
    {
        return false;
    }
    
    Size winSize = Director::getInstance()->getWinSize();
    
    Sprite* pItemSprite = Sprite::create("res/ui/coin.png");
    pItemSprite->setPosition(100.0f,300.0f);
    addChild(pItemSprite);
    
    PointArray* pPtArray = PointArray::create(10);
    pPtArray->addControlPoint(Vec2(winSize.width*0.5f, 50));
    pPtArray->addControlPoint(Vec2(winSize.width-80.0f,120));
    pPtArray->addControlPoint(Vec2(winSize.width-80,winSize.height-80));
    pPtArray->addControlPoint(Vec2(50.0f,winSize.height-80));
    pPtArray->addControlPoint(Vec2(50.0f, 120));
    pPtArray->addControlPoint(Vec2(winSize.width*0.5f, 50));
    
    int referenceCount = (int)pPtArray->getControlPoints()->size(); // 6个
    for (int i=0; i<referenceCount; ++i)
    {
        Vec2 ptItem = pPtArray->getControlPointAtIndex(i);
        createControlPoint(ptItem);
    }
    
    pItemSprite->setPosition(pPtArray->getControlPointAtIndex(0));
    
    DrawNode* pDrawNode = DrawNode::create();
    addChild(pDrawNode);
    pDrawNode->drawCatmullRom(pPtArray, 100, Color4F::GREEN);
    pDrawNode->setVisible(false);
    
    TargetedAction* pTargetAction = TargetedAction::create(pItemSprite, CatmullRomTo::create(3.0f, pPtArray));
    this->runAction(Sequence::create(DelayTime::create(1.0f), pTargetAction, nullptr));
    
    return true;
}