Ejemplo n.º 1
0
        public void DrawViewportWires(GH_PreviewWireArgs args)
        {
            //ClippingBox
            //args.Pipeline.DrawBox(ClippingBox, System.Drawing.Color.Black);
            if (Value != null)
            {
                System.Drawing.Color col = args.Color;
                if (!DrawUtil.CheckSelection(col))
                {
                    col = DrawUtil.DrawColorStructuralElements;
                }
                else
                {
                    drawLocalFrame(args.Pipeline);
                }

                args.Pipeline.DrawBrepWires(Value, col, -1);
            }
        }
Ejemplo n.º 2
0
        private void updateLoadTransforms()
        {
            _loadCondition = new LoadCondition(Forces, Moments);

            Vector3d lx = Vector3d.Zero;

            if (!(ReferenceArea is null))
            {
                lx = ReferenceArea.DirectionLocalX;
            }
            //   iterate over BrepFaces
            foreach (BrepFace bf in Value.Faces)
            {
                //   iterate over Edges of current face and draw this edge
                foreach (int beIndex in bf.AdjacentEdges())
                {
                    _loadCondition.Transforms.AddRange(DrawUtil.GetCurveTransforms(Value.Edges[beIndex], UseHostLocal, lx, bf, DrawUtil.ScaleFactorLoads, DrawUtil.DensityFactorLoads));
                }
            }
        }
Ejemplo n.º 3
0
        private void updateLocalFrameTransforms()
        {
            _localFrame.Transforms.Clear();

            var dz = DirectionLocalZ.IsTiny() ? -1 * Vector3d.ZAxis : DirectionLocalZ;

            if (DrawUtil.DensityFactorLocalFrame < 0.001)
            {
                double    p      = Value.Domain.ParameterAt(0.5);
                Point3d   pMid   = Value.PointAt(p);
                Vector3d  tMid   = Value.TangentAt(p);
                Transform tScale = Rhino.Geometry.Transform.Scale(Point3d.Origin, DrawUtil.ScaleFactorLocalFrame);
                Transform tOri   = TransformUtils.GetGlobalTransformLine(tMid, dz);
                Transform tTrans = Rhino.Geometry.Transform.Translation(new Vector3d(pMid));
                _localFrame.Transforms.Add(tTrans * tOri * tScale);
            }
            else
            {
                _localFrame.Transforms.AddRange(DrawUtil.GetCurveTransforms(Value, true, dz, null, DrawUtil.ScaleFactorLocalFrame, DrawUtil.DensityFactorLocalFrame));
            }
        }
Ejemplo n.º 4
0
        public void DrawViewportMeshes(GH_PreviewMeshArgs args)
        {
            if (Value != null)
            {
                System.Drawing.Color          col = args.Material.Diffuse;
                Rhino.Display.DisplayMaterial areaStrcMaterial = new Rhino.Display.DisplayMaterial(args.Material);
                if (!DrawUtil.CheckSelection(col))
                {
                    col = DrawUtil.DrawColorStructuralElements;

                    areaStrcMaterial.Diffuse      = col;
                    areaStrcMaterial.Specular     = col;
                    areaStrcMaterial.Emission     = col;
                    areaStrcMaterial.BackDiffuse  = col;
                    areaStrcMaterial.BackSpecular = col;
                    areaStrcMaterial.BackEmission = col;
                }

                args.Pipeline.DrawBrepShaded(Value, areaStrcMaterial);
            }
        }
Ejemplo n.º 5
0
        public void DrawViewportWires(GH_PreviewWireArgs args)
        {
            //ClippingBox
            //args.Pipeline.DrawBox(ClippingBox, System.Drawing.Color.Black);
            if (Value != null)
            {
                System.Drawing.Color colStr = args.Color;
                System.Drawing.Color colSup = args.Color;
                if (!DrawUtil.CheckSelection(colStr))
                {
                    colStr = DrawUtil.DrawColorStructuralElements;
                    colSup = System.Drawing.Color.Black;
                }
                else
                {
                    drawLocalFrame(args.Pipeline);
                }

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

                drawSupportLine(args.Pipeline, colSup, false);
            }
        }
Ejemplo n.º 6
0
        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;
                }
                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);
                }
            }
        }
Ejemplo n.º 7
0
        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;
                }
                args.Pipeline.DrawPoint(Value.Location, Rhino.Display.PointStyle.X, 5, DrawUtil.DrawColorLoads);

                if (!(Forces.IsTiny() && Moments.IsTiny()) && DrawUtil.ScaleFactorLoads > 0.0001)
                {
                    if (!_loadCondition.isValid)
                    {
                        updateLoadTransforms();
                    }
                    _loadCondition.Draw(args.Pipeline, col);
                }
            }
        }
Ejemplo n.º 8
0
        public void DrawViewportWires(GH_PreviewWireArgs args)
        {
            //ClippingBox
            //args.Pipeline.DrawBox(ClippingBox, System.Drawing.Color.Black);
            if (Value != null)
            {
                System.Drawing.Color colStr = args.Color;
                System.Drawing.Color colSup = args.Color;
                if (!DrawUtil.CheckSelection(colStr))
                {
                    colStr = DrawUtil.DrawColorStructuralElements;
                    colSup = System.Drawing.Color.Black;
                }
                else
                {
                    drawLocalFrame(args.Pipeline);
                }

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

                drawSupportPoint(args.Pipeline, colSup, false);
            }
        }