public BaseNode[] createVrmlFromString(string vrmlSyntax) { Vrml97Tokenizer tokenizer = new Vrml97Tokenizer(new StringReader(vrmlSyntax)); VrmlParser parser = new VrmlParser(tokenizer); MFNode node = new MFNode(); parser.Parse(node); return null; }
public void Visit(MFNode field) { field.ClearValues(); m_context.PushNodeContainer(field); ParseMField(m_nodeStatementParser); m_context.PopNodeContainer(); }
public void visit(MFNode field) { field.clearValues(); context.PushNodeContainer(field); ParseMField(nodeStatementParser); context.PopNodeContainer(); }
public BaseNode[] createVrmlFromString(string vrmlSyntax) { Vrml97Tokenizer tokenizer = new Vrml97Tokenizer(new StringReader(vrmlSyntax)); VrmlParser parser = new VrmlParser(tokenizer); MFNode node = new MFNode(); parser.Parse(node); return(null); }
public override Field Clone() { var clone = new MFNode(); foreach (var child in Values) { clone.AppendValue(child.clone()); } return(clone); }
public void Parse(MFNode container) { var context = new ParserContext(_tokenizer); try { _fieldParser = new FieldParser(context, ParseNodeStatement); context.PushNodeContainer(container); ParseStatements(context); context.PopNodeContainer(); } catch (VrmlParseException exc) { throw new InvalidVRMLSyntaxException(exc.Message + " at Line: " + context.LineIndex + " Column: " + context.ColumnIndex); } }
private static void AddAMFToMFNode(MeshFilter mfT, List <MFNode> listMF) { // 查找一个可以放得下的MFNode,无则创建一个新的Node foreach (MFNode node in listMF) { if (node.vertCount + mfT.sharedMesh.vertexCount < 65000) { node.mfs.Add(mfT); node.vertCount += mfT.sharedMesh.vertexCount; return; } } // 创建一个新的Node MFNode nodeNew = new MFNode(); nodeNew.mfs.Add(mfT); nodeNew.vertCount += mfT.sharedMesh.vertexCount; listMF.Add(nodeNew); }
X3DFieldBase ParseUntypedFieldValueArray() { char ts = GetNextTerminalSymbolToken(); // [ object token = PeekNextToken(); X3DFieldBase ret = null; VRMLTokenIdKeywordOrFieldType idToken = token as VRMLTokenIdKeywordOrFieldType; if (idToken != null) { ret = new MFNode(ParseUntypedFieldValueNodeArray()); } VRMLTokenString strToken = token as VRMLTokenString; if (strToken != null) { ret = new MFString(ParseUntypedFieldValueStringArray()); } VRMLTokenNumber numberToken = token as VRMLTokenNumber; if (numberToken != null) { ret = new MFNumbers(ParseUntypedFieldValueNumbers()); } ts = GetNextTerminalSymbolToken(); if (ts != ']') { ErrorParsingToken("]", ts.ToString(), "unknown type value (array)"); } if (ret == null) { ret = new MFEmpty(); } return(ret); }
public void Visit(MFNode field) { field.AppendValue(Child); }
public void visit(MFNode field) { field.AppendValue(_child); }