/* void FillTreeFromList(TListNode* AListNode, int AParentShapeID, TBaseWorkShape* AStart, TBaseWorkShape* AEnd);*/ public TTreeList() { f_TreeList = new TMainTreeList(); f_TreeList.Level = 0; f_Stack = new TTreeStack(); f_AltInfo = new TAltInfo(); }
/* 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; } } } }