public void DrawViewportWires(GH_PreviewWireArgs args)
        {
            if (Value == null)
            {
                return;
            }

            //Draw lines
            if (Value.Line != null)
            {
                if (args.Color == System.Drawing.Color.FromArgb(255, 150, 0, 0)) // this is a workaround to change colour between selected and not
                {
                    if (Value.Element.IsDummy)
                    {
                        args.Pipeline.DrawDottedLine(Value.Line.PointAtStart, Value.Line.PointAtEnd, UI.Colour.Dummy1D);
                    }
                    else
                    {
                        if ((System.Drawing.Color)Value.Colour != System.Drawing.Color.FromArgb(0, 0, 0))
                        {
                            args.Pipeline.DrawCurve(Value.Line, Value.Colour, 2);
                        }
                        else
                        {
                            System.Drawing.Color col = UI.Colour.ElementType(Value.Element.Type);
                            args.Pipeline.DrawCurve(Value.Line, col, 2);
                        }
                        args.Pipeline.DrawPoint(Value.Line.PointAtStart, Rhino.Display.PointStyle.RoundSimple, 3, UI.Colour.Element1dNode);
                        args.Pipeline.DrawPoint(Value.Line.PointAtEnd, Rhino.Display.PointStyle.RoundSimple, 3, UI.Colour.Element1dNode);
                    }
                }
                else
                {
                    if (Value.Element.IsDummy)
                    {
                        args.Pipeline.DrawDottedLine(Value.Line.PointAtStart, Value.Line.PointAtEnd, UI.Colour.Element1dSelected);
                    }
                    else
                    {
                        args.Pipeline.DrawCurve(Value.Line, UI.Colour.Element1dSelected, 2);
                        args.Pipeline.DrawPoint(Value.Line.PointAtStart, Rhino.Display.PointStyle.RoundControlPoint, 3, UI.Colour.Element1dNodeSelected);
                        args.Pipeline.DrawPoint(Value.Line.PointAtEnd, Rhino.Display.PointStyle.RoundControlPoint, 3, UI.Colour.Element1dNodeSelected);
                    }
                }
            }
            //Draw releases
            if (!Value.Element.IsDummy)
            {
                PolyCurve crv = new PolyCurve();
                crv.Append(Value.Line);
                double   angle = Value.Element.OrientationAngle;
                GsaBool6 start = Value.ReleaseStart;
                GsaBool6 end   = Value.ReleaseEnd;

                UI.Display.DrawReleases(args, crv, angle, start, end);
            }
        }
Beispiel #2
0
        //public GsaBool6(Bool6 bool6)
        //{
        //   m_x = bool6.X;
        //    m_y = bool6.Y;
        //    m_z = bool6.Z;
        //    m_xx = bool6.XX;
        //    m_yy = bool6.YY;
        //    m_zz = bool6.ZZ;
        //}


        public GsaBool6 Duplicate()
        {
            GsaBool6 dup = new GsaBool6
            {
                X  = m_x,
                Y  = m_y,
                Z  = m_z,
                XX = m_xx,
                YY = m_yy,
                ZZ = m_zz
            };

            return(dup);
        }
 public GsaNode(Point3d position, GsaBool6 bool6)
 {
     Node.Position.X   = position.X;
     Node.Position.Y   = position.Y;
     Node.Position.Z   = position.Z;
     Node.Restraint.X  = bool6.X;
     Node.Restraint.Y  = bool6.Y;
     Node.Restraint.Z  = bool6.Z;
     Node.Restraint.XX = bool6.XX;
     Node.Restraint.YY = bool6.YY;
     Node.Restraint.ZZ = bool6.ZZ;
     m_plane           = Plane.WorldXY;
     m_plane.Origin    = position;
 }
 public GsaNode(Point3d position, int ID, GsaBool6 bool6, Plane plane)
 {
     Node.Position.X   = position.X;
     Node.Position.Y   = position.Y;
     Node.Position.Z   = position.Z;
     m_id              = ID;
     Node.Restraint.X  = bool6.X;
     Node.Restraint.Y  = bool6.Y;
     Node.Restraint.Z  = bool6.Z;
     Node.Restraint.XX = bool6.XX;
     Node.Restraint.YY = bool6.YY;
     Node.Restraint.ZZ = bool6.ZZ;
     m_plane           = plane;
     m_plane.Origin    = position;
 }
        //public GsaBool6(Bool6 bool6)
        //{
        //   m_x = bool6.X;
        //    m_y = bool6.Y;
        //    m_z = bool6.Z;
        //    m_xx = bool6.XX;
        //    m_yy = bool6.YY;
        //    m_zz = bool6.ZZ;
        //}


        public GsaBool6 Duplicate()
        {
            if (this == null)
            {
                return(null);
            }
            GsaBool6 dup = new GsaBool6
            {
                X  = m_x,
                Y  = m_y,
                Z  = m_z,
                XX = m_xx,
                YY = m_yy,
                ZZ = m_zz
            };

            return(dup);
        }
        public void DrawViewportWires(GH_PreviewWireArgs args)
        {
            if (Value == null)
            {
                return;
            }

            //Draw lines
            if (Value.PolyCurve != null)
            {
                if (args.Color == System.Drawing.Color.FromArgb(255, 150, 0, 0)) // this is a workaround to change colour between selected and not
                {
                    if (Value.Member.IsDummy)
                    {
                        args.Pipeline.DrawDottedPolyline(Value.Topology, UI.Colour.Dummy1D, false);
                    }
                    else
                    {
                        if ((System.Drawing.Color)Value.Colour != System.Drawing.Color.FromArgb(0, 0, 0))
                        {
                            args.Pipeline.DrawCurve(Value.PolyCurve, Value.Colour, 2);
                        }
                        else
                        {
                            System.Drawing.Color col = UI.Colour.ElementType(Value.Member.Type1D);
                            args.Pipeline.DrawCurve(Value.PolyCurve, col, 2);
                        }
                    }
                }
                else
                {
                    if (Value.Member.IsDummy)
                    {
                        args.Pipeline.DrawDottedPolyline(Value.Topology, UI.Colour.Member1dSelected, false);
                    }
                    else
                    {
                        args.Pipeline.DrawCurve(Value.PolyCurve, UI.Colour.Member1dSelected, 2);
                    }
                }
            }

            //Draw points.
            if (Value.Topology != null)
            {
                if (!Value.Member.IsDummy)
                {
                    List <Point3d> pts = Value.Topology;
                    for (int i = 0; i < pts.Count; i++)
                    {
                        if (args.Color == System.Drawing.Color.FromArgb(255, 150, 0, 0)) // this is a workaround to change colour between selected and not
                        {
                            if (i == 0 | i == pts.Count - 1)                             // draw first point bigger
                            {
                                args.Pipeline.DrawPoint(pts[i], Rhino.Display.PointStyle.RoundSimple, 3, UI.Colour.Member1dNode);
                            }
                            else
                            {
                                args.Pipeline.DrawPoint(pts[i], Rhino.Display.PointStyle.RoundSimple, 2, UI.Colour.Member1dNode);
                            }
                        }
                        else
                        {
                            if (i == 0 | i == pts.Count - 1) // draw first point bigger
                            {
                                args.Pipeline.DrawPoint(pts[i], Rhino.Display.PointStyle.RoundControlPoint, 3, UI.Colour.Member1dNodeSelected);
                            }
                            else
                            {
                                args.Pipeline.DrawPoint(pts[i], Rhino.Display.PointStyle.RoundControlPoint, 2, UI.Colour.Member1dNodeSelected);
                            }
                        }
                    }
                }
            }

            //Draw releases
            if (!Value.Member.IsDummy)
            {
                PolyCurve crv   = Value.PolyCurve;
                double    angle = Value.Member.OrientationAngle;
                GsaBool6  start = Value.ReleaseStart;
                GsaBool6  end   = Value.ReleaseEnd;

                UI.Display.DrawReleases(args, crv, angle, start, end);
            }
        }