예제 #1
0
        private PlyElement ReadElement()
        {
            string[] tokens = CurrentLine.Split(splitter, StringSplitOptions.RemoveEmptyEntries);
            int      count  = 0;

            if (!int.TryParse(tokens[2], out count))
            {
                throw new Exception(
                          string.Format("Invalid element count: \"{0}\"", tokens[2]));
            }

            PlyElement element = new PlyElement();

            element.Name = tokens[1];
            PlyElementType tempType = PlyElementType.other;

            if (Enum.TryParse <PlyElementType>(tokens[1], out tempType))
            {
                element.Type = tempType;
            }
            element.Count = count;


            while (NextHeaderLine().StartsWith("property"))
            {
                element.AddProperty(ReadProperty(CurrentLine));
            }
            return(element);
        }
예제 #2
0
 public PlyElement(PlyElementType elementType, object[] propertyValues)
 {
     ElementType     = elementType;
     _propertyValues = propertyValues;
 }