public void Add(ProductionNodeDescription description, string creationInfo, NodeInfoList neededNodes) { int status = SafeNativeMethods.xnNodeInfoListAdd(this.InternalObject, description, creationInfo, neededNodes == null ? IntPtr.Zero : neededNodes.InternalObject); WrapperUtils.ThrowOnError(status); }
/// @brief Internal method to update the node information stored in @ref m_nodeInformation protected void UpdateNodeInformation() { if (!Valid) { return; } NodeInfoList nodeList = m_context.BasicContext.EnumerateExistingNodes(); foreach (NodeInfo nodeInfo in nodeList) { ProductionNodeDescription desc = nodeInfo.Description; bool foundPlace = false; for (int i = 0; i < m_nodeInformation.Count; i++) { if (m_nodeInformation[i].Type == desc.Type) { m_nodeInformation[i] = desc; foundPlace = true; break; } } if (!foundPlace) { m_nodeInformation.Add(desc); } } nodeList.Dispose(); }
public void Add(ProductionNodeDescription description, string creationInfo, NodeInfoList neededNodes) { UInt32 status = OpenNIImporter.xnNodeInfoListAdd(this.InternalObject, description, creationInfo, neededNodes == null ? IntPtr.Zero : neededNodes.InternalObject); WrapperUtils.CheckStatus(status); }
/// @brief Method to get node description for nodes which were active /// /// This method gets the saved loaded nodes description in the context. /// @param nt The node type to get /// @param desc The description of the node type (irrelevant if returns false). /// @return true if there was a loaded node of that type, false otherwise. public static bool GetProductionNodeInformation(NodeType nt, out ProductionNodeDescription desc) { for (int i = 0; i < m_nodeInformation.Count; i++) { desc = m_nodeInformation[i]; if (desc.Type == nt) { return(true); } } // if we reached here then we found nothing. desc = new ProductionNodeDescription(); return(false); }