예제 #1
0
파일: TreeList.cs 프로젝트: atomaszz/gelios
 void Init(int ALevel)
 {
     f_TreeList.Clear();
     f_TreeList.Level = ALevel;//08.11.2007
     f_Stack.Clear();
     f_Stack.AddToStack(ALevel);
     f_AltInfo.Clear();
 }
예제 #2
0
        /*   public void PrepareDeleteWorkShape(TBaseWorkShape AWS);
         * public int DeleteWorkShape();
         * public void SaveAllToFile(AnsiString AFileName, int ATypeParam, TDischargedMassiv AOgrSovm);
         * public TNodeMain CreateNode(TBaseWorkShape WS);
         * public TNodeAncestor CreateNodeAncestor(int AId, int AIdAncestor);
         * public void PrepareAddNode(TNodeMain Nd);
         * public void ClearNodeTypeCreate();
         * public TNode CheckAlternateWSFirst(TBaseWorkShape AWS);
         * public TNode CheckAlternateWSEnd(TBaseWorkShape AWS);*/
        public void LoadInfoForAlternate(ref TAltInfo AltIfo, int AParentShapeID)
        {
            TNodeAlt     Itm;
            TNodeMain    Node, First = null, Last = null;
            TAltInfoItem AI;

            AltIfo.Clear();
            for (int i = 0; i <= AlternateCount - 1; i++)
            {
                Itm = GetAlternateItem(i);
                if (Itm.NodeStart.IdParentShape == AParentShapeID)
                {
                    AI = AltIfo.AddAltIfo(Itm.ID, Itm.Num, AParentShapeID, Itm.NodeStart, Itm.NodeEnd);
                    if (AI != null && (Itm.ID == 0) && (Itm.Num == 0) && (AParentShapeID == 0))
                    {
                        AI.Main = true;
                    }
                }
            }
            for (int i = 0; i <= MainList.Count - 1; i++)
            {
                Node = (TNodeMain)(MainList.ElementAt(i));
                if (Node != null && Node.IdParentShape == AParentShapeID)
                {
                    AI = AltIfo.AddAltIfo(Node.IdAlternate, Node.NumAlt, AParentShapeID, First, Last);
                    if (AI != null)
                    {
                        AI.Main = true;
                        First   = Node;
                        while (First.Prior != null)
                        {
                            First = First.Prior;
                        }

                        Last = Node;
                        while (Last.Next != null)
                        {
                            Last = Last.Next;
                        }

                        AI.NodeStart = First;
                        AI.NodeEnd   = Last;
                    }
                }
            }
        }