Exemple #1
0
        private COLLADAScene GetScene(Library_Visual_Scenes scenes)
        {
            var scene = new COLLADAScene();

            scene.Instance_Visual_Scene = new InstanceWithExtra()
            {
                Url = $"#{scenes.Visual_Scene.First().Id}"
            };

            return(scene);
        }
Exemple #2
0
        private Library_Visual_Scenes GetScenes(Node geometryNode, IEnumerable <Node> lightNodes, string modelName)
        {
            var visualScenes = new Library_Visual_Scenes();
            var visualScene  = new Visual_Scene()
            {
                Id = "scene"
            };

            var masterNode = new Node()
            {
                Id   = modelName,
                Name = modelName
            };

            masterNode.NodeProperty.Add(geometryNode);

            lightNodes.ToList().ForEach(l => geometryNode.NodeProperty.Add(l));

            visualScene.Node.Add(masterNode);
            visualScenes.Visual_Scene.Add(visualScene);

            return(visualScenes);
        }
Exemple #3
0
        public XmlColladaSchema(XmlDocument doc)
        {
            XPathNavigator navigator = doc.CreateNavigator();

            // Move to the first child element of the document. This will be the root element.
            //navigator.MoveToChild(XPathNodeType.Element);
            navigator.MoveToFirstChild();
            string uri = string.Empty;
            if (navigator.HasAttributes == true)
            {
                uri = navigator.NamespaceURI;
            }

            // Handle asset data
            XPathNodeIterator nodesIterator;
            nodesIterator = navigator.SelectChildren(XmlCollada.Library_Geometries.root, uri);
            if (nodesIterator.MoveNext())
            {
                _asset = new XmlCollada.Asset(nodesIterator, uri);
            }

            // Handle geometry library data
            nodesIterator = navigator.SelectChildren(XmlCollada.Library_Geometries.root, uri);
            if (nodesIterator.MoveNext())
            {
                _geometries = new XmlCollada.Library_Geometries(nodesIterator, uri);
            }

            // Handle effects data
            nodesIterator = navigator.SelectChildren(XmlCollada.Library_Effects.root, uri);
            if (nodesIterator.MoveNext())
            {
                _effects = new XmlCollada.Library_Effects(nodesIterator, uri);
            }

            // Handle material data
            nodesIterator = navigator.SelectChildren(XmlCollada.Library_Materials.root, uri);
            if (nodesIterator.MoveNext())
            {
                _materials = new XmlCollada.Library_Materials(nodesIterator, uri);
            }

            // Handle visual scene data
            nodesIterator = navigator.SelectChildren(XmlCollada.Library_Visual_Scenes.root, uri);
            if (nodesIterator.MoveNext())
            {
                _visualScenes = new XmlCollada.Library_Visual_Scenes(nodesIterator, uri);
            }

            // Handle image data
            nodesIterator = navigator.SelectChildren(XmlCollada.Library_Images.root, uri);
            if (nodesIterator.MoveNext())
            {
                _images = new XmlCollada.Library_Images(nodesIterator, uri);
            }

            // Handle the scene
            nodesIterator = navigator.SelectChildren(XmlCollada.Scene.root, uri);
            if (nodesIterator.MoveNext())
            {
                _scene = new XmlCollada.Scene(nodesIterator, uri);
            }
        }
Exemple #4
0
 public XmlColladaSchema(Asset asset, Library_Geometries geometries, Library_Effects effects,
     Library_Materials materials, Library_Visual_Scenes visualScenes,
     Library_Images images, Scene scene)
 {
     _asset = asset;
     _geometries = geometries;
     _effects = effects;
     _materials = materials;
     _visualScenes = visualScenes;
     _images = images;
     _scene = scene;
 }