private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport)
        {
            if (DrawUtil.DrawInfo)
            {
                if (_infoPanel == null)
                {
                    _infoPanel = new InfoPanel();
                    _infoPanel.Positions.Add(Value.Location);

                    _infoPanel.Content.Add("LC: " + LoadCase);
                    if (!Forces.IsTiny())
                    {
                        _infoPanel.Content.Add("Force: " + Forces.Length);
                    }
                    if (!Moments.IsTiny())
                    {
                        _infoPanel.Content.Add("Moment: " + Moments.Length);
                    }
                    if (!Displacement.IsTiny())
                    {
                        _infoPanel.Content.Add("Displacement: " + Displacement.Length);
                    }
                    if (!DisplacementRotational.IsTiny())
                    {
                        _infoPanel.Content.Add("Rot.Displacement: " + DisplacementRotational.Length);
                    }
                }
                _infoPanel.Draw(pipeline, viewport);
            }
        }
        public void DrawViewportWires(GH_PreviewWireArgs args)
        {
            //ClippingBox
            //args.Pipeline.DrawBox(ClippingBox, System.Drawing.Color.Black);
            if (!(Value is null)) //if no point or, force AND moment are zero, nothing to draw
            {
                System.Drawing.Color col = args.Color;
                if (!DrawUtil.CheckSelection(col))
                {
                    col = DrawUtil.DrawColorLoads;
                }
                else
                {
                    drawInfoPanel(args.Pipeline, args.Viewport);
                }

                args.Pipeline.DrawPoint(Value.Location, Rhino.Display.PointStyle.X, 5, DrawUtil.DrawColorLoads);

                if (!(Forces.IsTiny() && Moments.IsTiny() && Displacement.IsTiny() && DisplacementRotational.IsTiny()) && DrawUtil.ScaleFactorLoads > 0.0001)
                {
                    if (!_loadCondition.isValid)
                    {
                        updateLoadTransforms();
                    }
                    _loadCondition.Draw(args.Pipeline, col);
                }
            }
        }
        public void DrawViewportWires(GH_PreviewWireArgs args)
        {
            //draw clippingbox
            //args.Pipeline.DrawBox(ClippingBox, System.Drawing.Color.Black);
            if (!(Value is null))
            {
                System.Drawing.Color col = args.Color;
                if (!DrawUtil.CheckSelection(col))
                {
                    col = DrawUtil.DrawColorLoads;
                }
                else
                {
                    drawInfoPanel(args.Pipeline, args.Viewport);
                }

                args.Pipeline.DrawCurve(Value, DrawUtil.DrawColorLoads, args.Thickness + 1);

                if (DrawUtil.ScaleFactorLoads > 0.0001 && !(Forces.IsTiny() && Moments.IsTiny()))
                {
                    if (!_loadCondition.isValid)
                    {
                        updateLoadTransforms();
                    }
                    _loadCondition.Draw(args.Pipeline, col);
                }
            }
        }
        private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport)
        {
            if (DrawUtil.DrawInfo)
            {
                if (_infoPanel == null)
                {
                    _infoPanel = new InfoPanel();
                    _infoPanel.Positions.Add(Value.PointAtNormalizedLength(0.5));

                    _infoPanel.Content.Add("LC: " + LoadCase);
                    if (!Forces.IsTiny())
                    {
                        _infoPanel.Content.Add("Force: " + Forces.Length);
                    }
                    if (!Moments.IsTiny())
                    {
                        _infoPanel.Content.Add("Moment: " + Moments.Length);
                    }
                }
                _infoPanel.Draw(pipeline, viewport);
            }
        }
Exemple #5
0
        private void drawInfoPanel(Rhino.Display.DisplayPipeline pipeline, Rhino.Display.RhinoViewport viewport)
        {
            if (DrawUtil.DrawInfo)
            {
                if (_infoPanel == null)
                {
                    _infoPanel = new InfoPanel();
                    var amp = AreaMassProperties.Compute(Value);
                    _infoPanel.Positions.Add(Value.ClosestPoint(amp.Centroid));

                    _infoPanel.Content.Add("LC: " + LoadCase);
                    if (!Forces.IsTiny())
                    {
                        _infoPanel.Content.Add("Force: " + Forces.Length);
                    }
                    if (!Moments.IsTiny())
                    {
                        _infoPanel.Content.Add("Moment: " + Moments.Length);
                    }
                }
                _infoPanel.Draw(pipeline, viewport);
            }
        }