Exemplo n.º 1
0
 public TFlag()
 {
     F_Position = -1;
     F_Shape    = null;
     F_Line     = null;
     F_Flag     = null;
 }
Exemplo n.º 2
0
        public TFlag AddFlag(TFlagShape AFlag, TBaseShape AShape, TRectLine ALine,
                             int APosition, ref bool AFlagExits)
        {
            TFlag     Member;
            TBaseLine MLine;
            int       APos;

            AFlagExits = true;
            for (int i = List.Count - 1; i >= 0; i--)
            {
                Member = (TFlag)(List.ElementAt(i));
                if (Member.Flag == AFlag)
                {
                    return(Member);
                }
            }
            Member          = new TFlag();
            Member.Position = APosition;
            Member.Shape    = AShape;
            Member.Line     = ALine;
            Member.Flag     = AFlag;
            List.Add(Member);
            AFlagExits = false;
            return(Member);
        }
Exemplo n.º 3
0
        override public TBaseShape GetShapeByLine(TRectLine ALine, int APos)
        {
            TRectLine Line;

            Line = (TRectLine)(GetWorkLine(0));
            if (Line == ALine)
            {
                if (APos < 2)
                {
                    return(null);
                }
                if (APos == 2)
                {
                    return(GetWorkShape(0));
                }
            }
            Line = (TRectLine)(GetWorkLine(4));
            if (Line == ALine)
            {
                if (APos > 0)
                {
                    return(null);
                }
                if (APos == 0)
                {
                    return(GetWorkShape(1));
                }
            }
            //требует дополнения
            return(null);
        }
Exemplo n.º 4
0
        void FlagDestroy(TRectLine ASender, TFlagShape AFlag, int APosFlag)
        {
            TFlag Flag = ListFlag.DeleteFlagByShape(AFlag);

            if (Flag != null && FOnWSFlagDestroy != null)
            {
                OnWSFlagDestroy(Flag, this);
            }
        }
Exemplo n.º 5
0
        override public TRectLine GetFirstLine()
        {
            TRectLine L = base.GetFirstLine();

            if (L == null)
            {
                L = (TRectLine)(GetWorkLine(0));
            }
            return(L);
        }
Exemplo n.º 6
0
        /*          void DoSetFlag();
         *        void DoSetFlagS();
         *        void DoSetFlagE();*/
        void FlagCreate(TRectLine ASender, TFlagShape AFlag, int APosFlag)
        {
            bool       res   = false;
            TBaseShape Shape = GetShapeByLine(ASender, APosFlag);
            TFlag      Flag  = ListFlag.AddFlag(AFlag, Shape, ASender, APosFlag, ref res);

            if (!res && FOnWSFlagCreate != null)
            {
                OnWSFlagCreate(Flag, this);
            }
        }
Exemplo n.º 7
0
 /*     void SetNextWorkShape(TBaseWorkShape AValue);
  *   void CreateImage();
  *   void CreateBaseLine();
  *   TLineCuttingItem FindLine(Point APointStart, Point APointEnd);
  *   bool AddToPointList(Point APointStart, Point APointEnd);
  *   bool ComparePoint(TLineCuttingItem A, TLineCuttingItem B, ref Point AStart, ref Point AEnd);
  *   void ApplyOffset(int Ax, int Ay);
  *   void Paint(TCanvas ACanvas);*/
 public TLineCutting(Graphics ACanvas)
 {
     f_PointList     = new List <object>();
     f_BaseLineList  = new List <object>();
     f_WorkShape     = null;
     f_NextWorkShape = null;
     f_BaseX         = f_BaseY = 0;
     f_StartBaseX    = f_StartBaseY = 0;
     f_Canvas        = ACanvas;
     f_FirstLine     = new TRectLine(0, 0);
     f_LastLine      = new TRectLine(0, 0);
     f_IsFirstWS     = f_IsLastWS = false;
     f_DLines        = new TDynamicArray();
     f_DShapes       = new TDynamicArray();
 }
Exemplo n.º 8
0
 public virtual TBaseShape GetShapeByLine(TRectLine ALine, int APos)
 {
     return(null);
 }
Exemplo n.º 9
0
 public void AddWorkLine(TRectLine ALine)
 {
     f_WorkLines.Add(ALine);
 }