Esempio n. 1
0
        // Clone
        public override MaterialLayer clone()
        {
            MaterialGroupLayer layer = new MaterialGroupLayer(data);

            layer.type = "group";
            return(layer);
        }
Esempio n. 2
0
        // Load
        public static MaterialLayer load(XElement data)
        {
            MaterialLayer layer = null;

            switch (data.Attribute("type").Value)
            {
            case "root":
                layer = new MaterialGroupLayer(data);
                break;

            case "group":
                layer = new MaterialGroupLayer(data);
                break;

            case "texture":
                layer = new MaterialTextureLayer(data);
                break;

            case "perlin":
                layer = new MaterialPerlinLayer(data);
                break;

            case "worley":
                layer = new MaterialWorleyLayer(data);
                break;

            case "uniform_scatter":
                layer = new MaterialUniformScatterLayer(data);
                break;

            case "radial_scatter":
                layer = new MaterialRadialScatterLayer(data);
                break;

            case "edge_scatter":
                layer = new MaterialEdgeScatterLayer(data);
                break;

            case "leaves":
                layer = new MaterialLeavesLayer(data);
                break;
            }

            System.Diagnostics.Debug.Assert(layer != null, "Layer wasn't created (is null)");
            return(layer);
        }
Esempio n. 3
0
        // populate tree view
        public void populateTreeView(MaterialGroupLayer rootLayer)
        {
            SuspendLayout();

            // Clear existing nodes
            layersTreeView.Nodes.Clear();

            // Build nodes
            LayerNode rootNode = recursiveBuildNode(rootLayer);

            // Set tree view to root node
            layersTreeView.Nodes.Add(rootNode);

            // Expand all
            layersTreeView.ExpandAll();

            ResumeLayout();
        }
Esempio n. 4
0
        // Create
        public static MaterialLayer create(string type)
        {
            MaterialLayer layer = null;

            switch (type)
            {
            case "group":
                layer = new MaterialGroupLayer("group", true);
                break;

            case "texture":
                layer = new MaterialTextureLayer();
                break;

            case "perlin":
                layer = new MaterialPerlinLayer();
                break;

            case "worley":
                layer = new MaterialWorleyLayer();
                break;

            case "uniform_scatter":
                layer = new MaterialUniformScatterLayer();
                break;

            case "radial_scatter":
                layer = new MaterialRadialScatterLayer();
                break;

            case "edge_scatter":
                layer = new MaterialEdgeScatterLayer();
                break;

            case "leaves":
                layer = new MaterialLeavesLayer();
                break;
            }

            System.Diagnostics.Debug.Assert(layer != null, "Layer wasn't created (is null)");
            return(layer);
        }
Esempio n. 5
0
        // Create
        public static MaterialLayer create(string type)
        {
            MaterialLayer layer = null;
            switch (type)
            {
                case "group":
                    layer = new MaterialGroupLayer("group", true);
                    break;

                case "texture":
                    layer = new MaterialTextureLayer();
                    break;

                case "perlin":
                    layer = new MaterialPerlinLayer();
                    break;

                case "worley":
                    layer = new MaterialWorleyLayer();
                    break;

                case "uniform_scatter":
                    layer = new MaterialUniformScatterLayer();
                    break;

                case "radial_scatter":
                    layer = new MaterialRadialScatterLayer();
                    break;

                case "edge_scatter":
                    layer = new MaterialEdgeScatterLayer();
                    break;

                case "leaves":
                    layer = new MaterialLeavesLayer();
                    break;
            }

            System.Diagnostics.Debug.Assert(layer != null, "Layer wasn't created (is null)");
            return layer;
        }
Esempio n. 6
0
 // Load root layer
 protected virtual void loadRootLayer(XElement data)
 {
     _rootLayer = MaterialLayer.load(data.Element("Layer")) as MaterialGroupLayer;
 }
Esempio n. 7
0
 public virtual void createRootLayer()
 {
     _rootLayer = new MaterialGroupLayer("root", true);
 }
Esempio n. 8
0
        // Load
        public static MaterialLayer load(XElement data)
        {
            MaterialLayer layer = null;
            switch (data.Attribute("type").Value)
            {
                case "root":
                    layer = new MaterialGroupLayer(data);
                    break;

                case "group":
                    layer = new MaterialGroupLayer(data);
                    break;

                case "texture":
                    layer = new MaterialTextureLayer(data);
                    break;

                case "perlin":
                    layer = new MaterialPerlinLayer(data);
                    break;

                case "worley":
                    layer = new MaterialWorleyLayer(data);
                    break;

                case "uniform_scatter":
                    layer = new MaterialUniformScatterLayer(data);
                    break;

                case "radial_scatter":
                    layer = new MaterialRadialScatterLayer(data);
                    break;

                case "edge_scatter":
                    layer = new MaterialEdgeScatterLayer(data);
                    break;

                case "leaves":
                    layer = new MaterialLeavesLayer(data);
                    break;
            }

            System.Diagnostics.Debug.Assert(layer != null, "Layer wasn't created (is null)");
            return layer;
        }
Esempio n. 9
0
 // Clone
 public override MaterialLayer clone()
 {
     MaterialGroupLayer layer = new MaterialGroupLayer(data);
     layer.type = "group";
     return layer;
 }
Esempio n. 10
0
 // Load root layer
 virtual protected void loadRootLayer(XElement data)
 {
     _rootLayer = MaterialLayer.load(data.Element("Layer")) as MaterialGroupLayer;
 }
Esempio n. 11
0
 virtual public void createRootLayer()
 {
     _rootLayer = new MaterialGroupLayer("root", true);
 }