Ejemplo n.º 1
0
        //private void Show3dPlot(Rectangle area)
        //{
        //    float[] areaData = new float[area.Width * area.Height];
        //    float[] borderedArea = _file.GetArea(area).ToArea<float>(_file.Header.BytesPerSample);

        //    var borderedAreaWidth = area.X + area.Width - _file.Width > 0 ? _file.Width - area.X : area.Width;

        //    for (int i = 0; i < borderedArea.Length; i++)
        //    {
        //        var heightIndex = i / borderedAreaWidth * borderedAreaWidth;
        //        var widthIndex = i % borderedAreaWidth;
        //        areaData[widthIndex + heightIndex] = borderedArea[i];
        //    }

        //    using (var plotFrm = new Forms.Plot3dForm(area.Location.X,
        //        area.Location.X + area.Width, area.Location.Y, area.Location.Y + area.Height, areaData))
        //    {
        //        plotFrm.ShowDialog();
        //    }
        //}


        private string GetSectionFormCaption(Behaviors.Sections.Abstract.Section section)
        {
            var type = section.GetType();


            if (type == typeof(Behaviors.Sections.Concrete.HorizontalSection))
            {
                return "Горизонтальное сечение";
            }
            else if (type == typeof(Behaviors.Sections.Concrete.VerticalSection))
            {
                return "Вертикальное сечение";
            }
            else if (type == typeof(Behaviors.Sections.Concrete.LinearSection))
            {
                return "Произвольное сечение";
            }

            throw new NotSupportedException("unsupported section type");
        }
Ejemplo n.º 2
0
        private void AddBehavior(Behaviors.IBehaviorModel behaviorModel, TreeNode cardNode, bool select)
        {
            var bhvAttr = behaviorModel.GetType().GetAttribute<Behaviors.BehaviorModelAttribute>();
            var node = new TreeNode(behaviorModel.Name)
            {
                Tag = behaviorModel,
                ImageKey = "Behavior",
                SelectedImageKey = "Behavior"
            };
            cardNode.Nodes.Add(node);

            if (select)
            {
                ShowNode(node, true);
            }
        }