示例#1
0
        private List <string> GetTags(ModelComponent InModelComponent)
        {
            List <string> NodeTags = new List <string>();

            NodeTags.Add(string.Format("Rhino.ID: {0}", InModelComponent.Id));

            string ComponentTypeString = FUniqueNameGenerator.GetDefaultTypeName(InModelComponent);

            NodeTags.Add(string.Format("Rhino.Entity.Type: {0}", ComponentTypeString));

            //Add the groups this object belongs to.
            RhinoObject InRhinoObject = InModelComponent as RhinoObject;

            if (InRhinoObject != null && InRhinoObject.GroupCount > 0)
            {
                int[] GroupIndices = InRhinoObject.GetGroupList();
                for (int GroupArrayIndex = 0; GroupArrayIndex < GroupIndices.Length; ++GroupArrayIndex)
                {
                    string GroupName = GroupNameList[GroupIndices[GroupArrayIndex]];
                    if (GroupName != null)
                    {
                        NodeTags.Add(GroupName);
                    }
                }
            }

            return(NodeTags);
        }
示例#2
0
        /// <summary>
        /// Creates a new hierarchy node info for a given Rhino Model Component, used to determine names and labels as well as linking.
        /// </summary>
        /// <param name="InModelComponent"></param>
        /// <param name="ParentNode"></param>
        /// <param name="MaterialIndex"></param>
        /// <param name="ParentTransform"></param>
        /// <returns></returns>
        private RhinoSceneHierarchyNodeInfo GenerateNodeInfo(ModelComponent InModelComponent, bool bIsInstanceDefinition, int MaterialIndex, Transform ParentTransform)
        {
            string Name  = GetModelComponentName(InModelComponent);
            string Label = bIsInstanceDefinition
                                ? FUniqueNameGenerator.GetTargetName(InModelComponent)
                                : ActorLabelGenerator.GenerateUniqueName(InModelComponent);
            List <string> Tags = GetTags(InModelComponent);
            const bool    bOverrideMaterial = false;

            return(new RhinoSceneHierarchyNodeInfo(InModelComponent, Name, Label, Tags, MaterialIndex, bOverrideMaterial, ParentTransform));
        }
示例#3
0
 private string BuildLayerString(Layer CurrentLayer, RhinoSceneHierarchyNode ParentNode)
 {
     return(BuildLayerString(FUniqueNameGenerator.GetTargetName(CurrentLayer), ParentNode));
 }