Пример #1
0
        /// <summary>
        /// 得到真实的下一层中,属于该分块的分块集合
        /// </summary>
        /// <returns></returns>
        public override IPositionSet GetTrueChildPositionSet()
        {
            PositionSetSet positionSetSet = new PositionSetSet();

            foreach (IPart_Connected part_Connected in SubPartList)
            {
                positionSetSet.AddPositionSet(part_Connected.GetTrueChildPositionSet());
            }

            return(positionSetSet);
        }
Пример #2
0
        private void OnGetLinePositionSetInSpecificLevel(ILevel level, int levelSequence, IPositionSet positionSet)
        {
            lock (layers)
            {
                if (linePartSetLayer == null)
                {
                    linePartSetLayer           = new Layer_M2MPartSetInSpecificLevel(level, positionSet);
                    linePartSetLayer.MainColor = Settings.Default.LinePositionSetInSpecificLevelColor;
                    linePartSetLayer.Alpha     = 50;
                    //linePartSetLayer.LineColor = Color.Red;
                    linePartSetLayer.Active = true;
                    layers.Add(linePartSetLayer);

                    positionSetSet = new PositionSetSet();

                    BottonLevelPositionSetLayer = new Layer_PositionSet_Point(positionSetSet);
                    BottonLevelPositionSetLayer.Point.IsDrawPointBorder = true;
                    BottonLevelPositionSetLayer.Point.PointRadius       = 2;
                    BottonLevelPositionSetLayer.Point.PointColor        = Settings.Default.BottonLevelPositionSetColor;
                    layers.Add(BottonLevelPositionSetLayer);
                }
                else
                {
                    linePartSetLayer.SpringLayerRepresentationChangedEvent(linePartSetLayer);
                }

                positionSetSet.Clear();
                positionSet.InitToTraverseSet();
                while (positionSet.NextPosition())
                {
                    IPart tempPart = level.GetPartRefByPartIndex((int)positionSet.GetPosition().GetX(), (int)positionSet.GetPosition().GetY());
                    if (tempPart != null)
                    {
                        positionSetSet.AddPositionSet(m2mStructure.GetBottonLevelPositionSetByAncestorPart((
                                                                                                               tempPart), levelSequence));
                    }
                }

                BottonLevelPositionSetLayer.SpringLayerRepresentationChangedEvent(BottonLevelPositionSetLayer);
            }

            flowControlerForm.BeginInvoke(Update);
            flowControlerForm.SuspendAndRecordWorkerThread();
        }