Exemplo n.º 1
0
        /** @copydoc EngineParameter::Clone */
        public override LayerParameterBase Clone()
        {
            SerfParameter p = new SerfParameter();

            p.Copy(this);
            return(p);
        }
Exemplo n.º 2
0
        /** @copydoc EngineParameter::Copy */
        public override void Copy(LayerParameterBase src)
        {
            base.Copy(src);

            if (src is SerfParameter)
            {
                SerfParameter p = (SerfParameter)src;
                m_dfThreshold = p.m_dfThreshold;
            }
        }
Exemplo n.º 3
0
        /** @copydoc LayerParameterBase::Load */
        public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
        {
            RawProto      proto = RawProto.Parse(br.ReadString());
            SerfParameter p     = FromProto(proto);

            if (!bNewInstance)
            {
                Copy(p);
            }

            return(p);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Parses the parameter from a RawProto.
        /// </summary>
        /// <param name="rp">Specifies the RawProto to parse.</param>
        /// <returns>A new instance of the parameter is returned.</returns>
        public static new SerfParameter FromProto(RawProto rp)
        {
            string        strVal;
            SerfParameter p = new SerfParameter();

            ((EngineParameter)p).Copy(EngineParameter.FromProto(rp));

            if ((strVal = rp.FindValue("threshold")) != null)
            {
                p.threshold = ParseDouble(strVal);
            }

            return(p);
        }