Beispiel #1
0
        /** @copydoc EngineParameter::Clone */
        public override LayerParameterBase Clone()
        {
            ClipParameter p = new ClipParameter();

            p.Copy(this);
            return(p);
        }
Beispiel #2
0
 /** @copydoc LayerParameterBase::Copy */
 public override void Copy(LayerParameterBase src)
 {
     if (src is ClipParameter)
     {
         ClipParameter p = (ClipParameter)src;
         m_dfMin = p.m_dfMin;
         m_dfMax = p.m_dfMax;
     }
 }
Beispiel #3
0
        /** @copydoc LayerParameterBase::Load */
        public override object Load(System.IO.BinaryReader br, bool bNewInstance = true)
        {
            RawProto      proto = RawProto.Parse(br.ReadString());
            ClipParameter p     = FromProto(proto);

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

            return(p);
        }
Beispiel #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 ClipParameter FromProto(RawProto rp)
        {
            string        strVal;
            ClipParameter p = new ClipParameter();

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

            if ((strVal = rp.FindValue("min")) != null)
            {
                p.min = double.Parse(strVal);
            }

            if ((strVal = rp.FindValue("max")) != null)
            {
                p.max = double.Parse(strVal);
            }

            return(p);
        }