Пример #1
0
            //-----------------------------------------------------------------------
            internal void finishCurve(char lc)
            {
                int n;

                if (lc == 'c' || lc == 'C' || lc == 's' || lc == 'S')
                {
                    n = 3;
                }
                else if (lc == 'q' || lc == 'Q' || lc == 't' || lc == 'T')
                {
                    n = 2;
                }
                else
                {
                    n = curve.size() - 1;
                }

                for (int i = 0; i < curve.size(); i += n)
                {
                    if (i + 3 >= curve.size())
                    {
                        break;
                    }
                    BezierCurve2 bc2 = new BezierCurve2();
                    bc2.setNumSeg(mNumSeg);
                    bc2.addPoint(curve[i + 0]);
                    bc2.addPoint(curve[i + 1]);
                    bc2.addPoint(curve[i + 2]);
                    bc2.addPoint(curve[i + 3]);
                    Shape bc2shape = bc2.realizeShape();
                    //Vector2 lp = shape.getPoint(shape.getPoints().size() - 1);
                    Vector2 lp = shape.getPoint(shape.getPointCount() - 1);
                    //for (std::vector<Vector2>::iterator iter = bc2shape.getPoints().begin(); iter != bc2shape.getPoints().end(); iter++)
                    for (int j = 0; j < bc2shape.getPointCount(); j++)
                    {
                        //if (iter == bc2shape.getPoints().begin())
                        if (j == 0)
                        {
                            //if (*iter != lp) shape.addPoint(*iter);
                            if (bc2shape.getPointsReference()[j] != lp)
                            {
                                shape.addPoint(bc2shape.getPointsReference()[j]);
                            }
                        }
                        else
                        {
                            shape.addPoint(bc2shape.getPointsReference()[j]);//shape.addPoint(*iter);
                        }
                    }
                }
                curve.clear();
            }
Пример #2
0
 public void clear()
 {
     mPaths.clear();
 }
Пример #3
0
 //* Clears the content of the Path
 public Path reset()
 {
     mPoints.clear();
     return(this);
 }
Пример #4
0
 /// Clears all the content
 public void clear()
 {
     mShapes.clear();
 }