Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 public void Visit(MFNode field)
 {
     field.ClearValues();
     m_context.PushNodeContainer(field);
     ParseMField(m_nodeStatementParser);
     m_context.PopNodeContainer();
 }
Ejemplo n.º 3
0
 public void visit(MFNode field)
 {
     field.clearValues();
     context.PushNodeContainer(field);
     ParseMField(nodeStatementParser);
     context.PopNodeContainer();
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        public override Field Clone()
        {
            var clone = new MFNode();

            foreach (var child in Values)
            {
                clone.AppendValue(child.clone());
            }
            return(clone);
        }
Ejemplo n.º 6
0
        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);
            }
        }
Ejemplo n.º 7
0
        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);
            }
        }
Ejemplo n.º 8
0
    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);
    }
Ejemplo n.º 9
0
        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);
        }
Ejemplo n.º 10
0
 public void Visit(MFNode field)
 {
     field.AppendValue(Child);
 }
Ejemplo n.º 11
0
 public void visit(MFNode field)
 {
     field.AppendValue(_child);
 }
Ejemplo n.º 12
0
 public void visit(MFNode field) {
     field.AppendValue(_child);
 }
Ejemplo n.º 13
0
 public void visit(MFNode field) {
     field.clearValues();
     context.PushNodeContainer(field);
     ParseMField(nodeStatementParser);
     context.PopNodeContainer();
 }