OpenSim.Region.CoreModules.World.Voxels.VoxelModule.LoadFromStream C# (CSharp) Метод

LoadFromStream() публичный Метод

Loads a terrain file from a stream and installs it in the scene.
public LoadFromStream ( string filename, Stream stream ) : void
filename string Filename to terrain file. Type is determined by extension.
stream Stream
Результат void
        public void LoadFromStream(string filename, Stream stream)
        {
            foreach (KeyValuePair<string, IVoxelFileHandler> loader in m_loaders)
            {
                if (filename.EndsWith(loader.Key))
                {
                    lock (m_scene)
                    {
                        try
                        {
                            IVoxelChannel channel = loader.Value.LoadStream(stream);
                            m_scene.Voxels = channel;
                            m_channel = (VoxelChannel)channel;
                            UpdateRevertMap();
                        }
                        catch (NotImplementedException)
                        {
                            m_log.Error("[TERRAIN]: Unable to load voxelmap, the " + loader.Value +
                                        " parser does not support file loading. (May be save only)");
                            throw new Exception(String.Format("unable to load heightmap: parser {0} does not support loading", loader.Value));
                        }
                    }

                    CheckForTerrainUpdates();
                    m_log.Info("[TERRAIN]: File (" + filename + ") loaded successfully");
                    return;
                }
            }
            m_log.Error("[TERRAIN]: Unable to load heightmap, no file loader available for that format.");
            throw new Exception(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename));
        }

Same methods

VoxelModule::LoadFromStream ( string filename, Uri pathToTerrainHeightmap ) : void