Exemple #1
0
        private static void AddObjectsPath(ArrayList arr)
        {
            int j;
            int count;

            for (int i = 0; i < arr.Count; i++)
            {
                switch ((arr[i] as MetaForm.ObjectEnt).type)
                {
                case MetaForm.ObjTypeRecord.objCloseLine:
                {
                    count = (arr[i] as MetaForm.ObjectEnt).points.Count - 1;
                    for (j = 0; j <= count; j++)
                    {
                        if (j < count)
                        {
                            MetaForm.DrawLine((PointF)(arr[i] as MetaForm.ObjectEnt).points[j],
                                              (PointF)(arr[i] as MetaForm.ObjectEnt).points[j + 1]);
                        }
                    }
                    j--;
                    if ((arr[i] as MetaForm.ObjectEnt).compobj != -1)
                    {
                        int item = (arr[i] as MetaForm.ObjectEnt).compobj;
                        int num  = i;
                        while ((arr[num] as MetaForm.ObjectEnt).compobj != -1)
                        {
                            item = (arr[num] as MetaForm.ObjectEnt).compobj;
                            num--;
                        }
                        if (j > count)
                        {
                            break;
                        }
                        MetaForm.DrawLine((PointF)(arr[i] as MetaForm.ObjectEnt).points[j],
                                          (PointF)(arr[item] as MetaForm.ObjectEnt).points[0]);
                        break;
                    }
                    else
                    {
                        if (j > count)
                        {
                            break;
                        }
                        MetaForm.DrawLine((PointF)(arr[i] as MetaForm.ObjectEnt).points[j],
                                          (PointF)(arr[i] as MetaForm.ObjectEnt).points[0]);
                        break;
                    }
                }

                case MetaForm.ObjTypeRecord.objCloseBezier:
                {
                    MetaForm.AddPolyBez((arr[i] as MetaForm.ObjectEnt).points);
                    j = (arr[i] as MetaForm.ObjectEnt).points.Count - 1;
                    if ((arr[i] as MetaForm.ObjectEnt).compobj != -1)
                    {
                        int item1 = (arr[i] as MetaForm.ObjectEnt).compobj;
                        int num1  = i;
                        while ((arr[num1] as MetaForm.ObjectEnt).compobj != -1)
                        {
                            item1 = (arr[num1] as MetaForm.ObjectEnt).compobj;
                            num1--;
                        }
                        MetaForm.DrawLine((PointF)(arr[i] as MetaForm.ObjectEnt).points[j],
                                          (PointF)(arr[item1] as MetaForm.ObjectEnt).points[0]);
                        break;
                    }
                    else
                    {
                        MetaForm.DrawLine((PointF)(arr[i] as MetaForm.ObjectEnt).points[j],
                                          (PointF)(arr[i] as MetaForm.ObjectEnt).points[0]);
                        break;
                    }
                }

                case MetaForm.ObjTypeRecord.objBezier:
                {
                    MetaForm.AddPolyBez((arr[i] as MetaForm.ObjectEnt).points);
                    break;
                }

                case MetaForm.ObjTypeRecord.objLine:
                {
                    count = (arr[i] as MetaForm.ObjectEnt).points.Count - 1;
                    for (j = 0; j <= count; j++)
                    {
                        if (j < count)
                        {
                            MetaForm.DrawLine((PointF)(arr[i] as MetaForm.ObjectEnt).points[j],
                                              (PointF)(arr[i] as MetaForm.ObjectEnt).points[j + 1]);
                        }
                    }
                    break;
                }
                }
            }
        }