public AlphaSplatTerrainConfig(string title, AutoSplatRules autoSplatRules, MosaicDescription srcdesc)
        {
            InitTextureNames();
            // Override texture names from rules, if applicable
            for (int i = 0; i < autoSplatRules.layerTextureNames.Length; i++)
            {
                if (!string.IsNullOrEmpty(autoSplatRules.layerTextureNames[i]))
                {
                    layerTextureNames[i] = autoSplatRules.layerTextureNames[i];
                }
            }

            // Create alpha map texture mosaics
            for (int i = 0; i < NUM_ALPHA_MAPS; i++)
            {
                string            alphaMapMosaicName = title + "AlphaMap" + i;
                MosaicDescription desc = new MosaicDescription(alphaMapMosaicName, srcdesc);

                alphaMapMosaicNames[i] = alphaMapMosaicName;
                alphaMapMosaics[i]     = new TextureMosaic(alphaMapMosaicName, 0, desc);

                alphaMapMosaics[i].MosaicModificationStateChanged += Mosaic_OnMosaicModificationStateChanged;
                alphaMapMosaics[i].MosaicChanged += Mosaic_OnMosaicChanged;
            }

            AutoSplatRules = autoSplatRules;
            InitializeAutoSplatRules(srcdesc);
        }
        public AlphaSplatTerrainConfig(string title, AutoSplatRules autoSplatRules, MosaicDescription srcdesc)
        {
            InitTextureNames();
            // Override texture names from rules, if applicable
            for (int i = 0; i < autoSplatRules.layerTextureNames.Length; i++)
            {
                if (!string.IsNullOrEmpty(autoSplatRules.layerTextureNames[i]))
                {
                    layerTextureNames[i] = autoSplatRules.layerTextureNames[i];
                }
            }

            // Create alpha map texture mosaics
            for (int i = 0; i < NUM_ALPHA_MAPS; i++)
            {
                string alphaMapMosaicName = title + "AlphaMap" + i;
                MosaicDescription desc = new MosaicDescription(alphaMapMosaicName, srcdesc);

                alphaMapMosaicNames[i] = alphaMapMosaicName;
                alphaMapMosaics[i] = new TextureMosaic(alphaMapMosaicName, 0, desc);

                alphaMapMosaics[i].MosaicModificationStateChanged += Mosaic_OnMosaicModificationStateChanged;
                alphaMapMosaics[i].MosaicChanged += Mosaic_OnMosaicChanged;
            }

            AutoSplatRules = autoSplatRules;
            InitializeAutoSplatRules(srcdesc);
        }
        private void InitializeAutoSplatRules(MosaicDescription desc)
        {
            if (AutoSplatRules != null)
            {
                return;
            }

            long minHeightMM;
            long maxHeightMM;

            if (desc == null)
            {
                // Set arbitrary min/max heights
                minHeightMM = -10000 * (long)TerrainManager.oneMeter;
                maxHeightMM = 10000 * (long)TerrainManager.oneMeter;
            }
            else
            {
                minHeightMM = (long)(desc.GlobalMinHeightMeters * TerrainManager.oneMeter);
                maxHeightMM = (long)(desc.GlobalMaxHeightMeters * TerrainManager.oneMeter);
            }
            AutoSplatRules = new AutoSplatRules(minHeightMM, maxHeightMM, new AutoSplatConfig());
        }
        private void InitializeAutoSplatRules(MosaicDescription desc)
        {
            if (AutoSplatRules != null)
            {
                return;
            }

            long minHeightMM;
            long maxHeightMM;

            if (desc == null)
            {
                // Set arbitrary min/max heights
                minHeightMM = -10000 * (long) TerrainManager.oneMeter;
                maxHeightMM = 10000*(long) TerrainManager.oneMeter;
            }
            else
            {
                minHeightMM = (long) (desc.GlobalMinHeightMeters * TerrainManager.oneMeter);
                maxHeightMM = (long) (desc.GlobalMaxHeightMeters * TerrainManager.oneMeter);
            }
            AutoSplatRules = new AutoSplatRules(minHeightMM, maxHeightMM, new AutoSplatConfig());
        }