コード例 #1
0
        //public GsaElement1d(Element element, LineCurve line)
        //{
        //    m_element = element;
        //    m_line = line;
        //}

        public GsaElement1d Duplicate()
        {
            GsaElement1d dup = new GsaElement1d
            {
                m_element = m_element //add clone or duplicate if available
            };

            if (m_line != null)
            {
                dup.m_line = (LineCurve)m_line.Duplicate();
            }
            dup.ID = m_id;

            if (m_rel1 != null)
            {
                dup.ReleaseStart = m_rel1.Duplicate();
            }
            if (m_rel2 != null)
            {
                dup.ReleaseEnd = m_rel2.Duplicate();
            }
            if (m_section != null)
            {
                dup.Section = m_section.Duplicate();
            }

            return(dup);
        }
コード例 #2
0
        //public GsaElement1d(Element element, LineCurve line)
        //{
        //    m_element = element;
        //    m_line = line;
        //}

        public GsaElement1d Duplicate()
        {
            if (this == null)
            {
                return(null);
            }
            GsaElement1d dup = new GsaElement1d();

            dup.m_element = new Element()
            {
                Group            = m_element.Group,
                IsDummy          = m_element.IsDummy,
                Name             = m_element.Name.ToString(),
                Offset           = m_element.Offset,
                OrientationAngle = m_element.OrientationAngle,
                OrientationNode  = m_element.OrientationNode,
                ParentMember     = m_element.ParentMember,
                Property         = m_element.Property,
                Topology         = new ReadOnlyCollection <int>(m_element.Topology.ToList()),
                Type             = m_element.Type //GsaToModel.Element1dType((int)Element.Type)
            };


            if ((System.Drawing.Color)m_element.Colour != System.Drawing.Color.FromArgb(0, 0, 0)) // workaround to handle that System.Drawing.Color is non-nullable type
            {
                dup.m_element.Colour = m_element.Colour;
            }

            dup.Element.Offset.X1 = m_element.Offset.X1;
            dup.Element.Offset.X2 = m_element.Offset.X2;
            dup.Element.Offset.Y  = m_element.Offset.Y;
            dup.Element.Offset.Z  = m_element.Offset.Z;

            if (m_line != null)
            {
                dup.m_line = (LineCurve)m_line.Duplicate();
            }
            dup.ID = m_id;

            if (m_rel1 != null)
            {
                dup.ReleaseStart = m_rel1.Duplicate();
            }
            if (m_rel2 != null)
            {
                dup.ReleaseEnd = m_rel2.Duplicate();
            }
            if (m_section != null)
            {
                dup.Section = m_section.Duplicate();
            }

            return(dup);
        }