当前位置: 首页>>代码示例>>C#>>正文


C# NsNode.Add方法代码示例

本文整理汇总了C#中NsNode.Add方法的典型用法代码示例。如果您正苦于以下问题:C# NsNode.Add方法的具体用法?C# NsNode.Add怎么用?C# NsNode.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NsNode的用法示例。


在下文中一共展示了NsNode.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ContourTracker

 public ContourTracker(string label)
 {
     m_node = new NsNode(label);
     Random rand = new Random();
     int i = rand.Next(5345);
     m_node.Add(new ContourAttribute(m_node, null, null));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:7,代码来源:ContourTracker.cs

示例2: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new ParaboloidConst(newParent, polycofs));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:RBFPolynomials.cs

示例3: MakeNode

        static NsNode MakeNode(NsNode node, string line)
        {
            int i = 0;
            while (i < line.Length && line[i] == '\t')
                i++;

            while (node.Depth > i)
            {
                if (node.Parent == null)
                    return null;
                node = node.Parent;
            }
            node.Add(new NsNode(line.Substring(i)));
            node = node.Last();
            return node;
        }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:16,代码来源:NodeIO.cs

示例4: AddSubNodes

 static bool AddSubNodes(XmlNode xn, NsNode node)
 {
     object o = null;
     bool success = true;
     foreach (XmlNode xc in xn.ChildNodes)
     {
         if (xc.Name.ToLower().Contains("transformer"))
             continue;
         o = CreateInstance(xc, node);
         if (o is NsNode)
         {
                  Log(string.Format("NsNode created: {0}", o.GetType().ToString()));
             NsNode c = o as NsNode;
             success &= AddSubNodes(xc, c);
             node.Add(c);
         }
             else if (o is IAttribute)
             {
                  Log(string.Format("IAttribute created: {0}", o.GetType().ToString()));
                  node.Add(o as IAttribute);
             }
             else
             {
                  Log(string.Format("Garbage created: {0}", o.GetType().ToString()));
                  success = false;
             }
     }
     node.ChildrenLoaded();
     return success;
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:30,代码来源:NodeIO.cs

示例5: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new TapeRefAttribute(newParent, m_label, m_itemnumber, m_width));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:TapeRefAttribute.cs

示例6: ReadCSV

        public static NsNode ReadCSV(string pathname, bool bParse)
        {
            if (!File.Exists(pathname))
                return null;

            NsNode root = new NsNode(pathname);
            try
            {
                using (StreamReader sr = new StreamReader(pathname))
                {
                    string line = null;
                    string[] headers;
                    int nheader = 0;
                    double d;
                    string[] cols;
                    NsNode node;
                    line = sr.ReadLine();
                    headers = line.Split(',');
                    while ((line = sr.ReadLine()) != null)
                    {
                        cols = line.Split(',');
                        node = new NsNode();
                        nheader = 0;
                        foreach (string s in cols)
                        {
                            if (bParse)
                            {
                                try
                                {
                                    d = Convert.ToDouble(s);
                                    if (nheader < headers.Length)
                                        node.Add(new DoubleAttribute(node, headers[nheader++], d));
                                    else
                                        node.Add(new DoubleAttribute(node, "", d));
                                }
                                catch
                                {
                                    if (nheader < headers.Length)
                                        node.Add(new StringAttribute(node, headers[nheader++], s));
                                    else
                                        node.Add(new StringAttribute(node, "", s));
                                }
                            }
                            else
                            {
                                if (nheader < headers.Length)
                                    node.Add(new StringAttribute(node, headers[nheader++], s));
                                else
                                    node.Add(new StringAttribute(node, "", s));
                            }
                        }
                        root.Add(node);
                    }
                }
            }
            catch
            {
                return null;
            }
            return root;
        }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:61,代码来源:NodeCSV.cs

示例7: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new DateAttribute(newParent, m_label, Date));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:DateAttribute.cs

示例8: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new PolyHarmonic5(newParent));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:RBFBasii.cs

示例9: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new TapeAttribute(newParent, m_label, m_points));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:TapeAttribute.cs

示例10: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new PlyAttribute(newParent, m_id, m_speed, m_taperef, m_color));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:PlyAttribute.cs

示例11: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new PointAttribute(newParent, m_label, m_pt[0], m_pt[1]));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:PointAttribute.cs

示例12: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new MarkAttribute(newParent, m_label, m_point, m_plyid));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:MarkAttribute.cs

示例13: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new StringAttribute(newParent, m_label, m_value));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:StringAttribute.cs

示例14: CopyTo

 ///// <summary>
 ///// Fit the surface using the UI Settings (SailRBFSingleton or MoldRBFSingleton will setup the basis and poly)
 ///// </summary>
 ///// <param name="fitpoints"></param>
 //public void Fit(List<double[]> fitpoints)
 //{
 //     Add(new MeshNode("Surface", this));
 //     //double relaxation = LoadRBFData();
 //     if (fitpoints != null)
 //     {
 //          Relaxation = relaxation;
 //          Regen(fitpoints);
 //     }
 //}
 ///// <summary>
 ///// loads the RBF data depending on the this type (Sail or Mold).  Sail = SailRBFSingleton data, mold = MoldRBFSingleton data
 ///// </summary>
 ///// <returns> relaxation value of specific RBF </returns>
 //private double LoadRBFData()
 //{
 //     switch (this.Label.ToLower().Contains("sail") ? SailRBFSingleton.Poly : MoldRBFSingleton.Poly)
 //     {
 //          case NHTGenComps.PolyTypes.Conic:
 //               {
 //                    Add(new RBFConic(this));
 //                    break;
 //               }
 //          case NHTGenComps.PolyTypes.Paraboloid_Long:
 //               {
 //                    Add(new RBFParaboloid3(this));
 //                    break;
 //               }
 //          case NHTGenComps.PolyTypes.Paraboloid_Short:
 //               {
 //                    Add(new RBFParaboloid2(this));
 //                    break;
 //               }
 //          case NHTGenComps.PolyTypes.Poly:
 //               {
 //                    Add(new RBFPoly1(this));
 //                    break;
 //               }
 //          default:
 //               {
 //                    Add(new RBFPoly1(this));
 //                    break;
 //               }
 //     }
 //     switch (this.Label.ToLower().Contains("sail") ? SailRBFSingleton.Basis : MoldRBFSingleton.Basis)
 //     {
 //          case NHTGenComps.BasisTypes.ThinPlate3:
 //               {
 //                    rbf = new ThinPlateSpline3(this);
 //                    break;
 //               }
 //          //case NHTGenComps.BasisTypes.Gaussian:
 //          //     {
 //          //          rbf = new Gaussian(this);
 //          //          break;
 //          //     }
 //          case NHTGenComps.BasisTypes.Multiquadratic:
 //               {
 //                    rbf = new Multiquadratic(this);
 //                    break;
 //               }
 //          case NHTGenComps.BasisTypes.ThinPlate:
 //               {
 //                    rbf = new ThinPlateSpline(this);
 //                    break;
 //               }
 //          case NHTGenComps.BasisTypes.PolyHarmonic3:
 //               {
 //                    rbf = new PolyHarmonic3(this);
 //                    break;
 //               }
 //          case NHTGenComps.BasisTypes.PolyHarmonic4:
 //               {
 //                    rbf = new PolyHarmonic4(this);
 //                    break;
 //               }
 //          case NHTGenComps.BasisTypes.PolyHarmonic5:
 //               {
 //                    rbf = new PolyHarmonic5(this);
 //                    break;
 //               }
 //          default:
 //               {
 //                    rbf = new ThinPlateSpline(this);
 //                    break;
 //               }
 //     }
 //     return this.Label.ToLower().Contains("sail") ? SailRBFSingleton.Relaxation : MoldRBFSingleton.Relaxation;
 //}
 public override NsNode CopyTo(NsNode newParent)
 {
     //return base.CopyTo(newParent);
        SurfaceRBF cpy = (SurfaceRBF)newParent.Add(new SurfaceRBF(Label, newParent));
        Nodes.ForEach(delegate(NsNode n)
        {
             n.CopyTo(cpy);
//.........这里部分代码省略.........
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:101,代码来源:RbfSurface.cs

示例15: CopyTo

 public IAttribute CopyTo(NsNode newParent)
 {
     return newParent.Add(new ArrayAttribute(newParent, m_label, m_array));
 }
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:4,代码来源:ArrayAttribute.cs


注:本文中的NsNode.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。