コード例 #1
0
        // Look up the path set associated with a particular mesh
        public static InteriorPathSet FindPathsForMesh(WorldEditor app, string meshName)
        {
            InteriorPathSetLookup result;

            if (pathSetDictionary.TryGetValue(meshName, out result))
            {
                return(result.paths);
            }
            else
            {
                string meshNameWithoutExtension = Path.GetFileNameWithoutExtension(meshName);
                string modelPathFile            = meshNameWithoutExtension + ".modelpaths";
                try {
                    Stream          stream  = ResourceManager.FindCommonResourceData(modelPathFile);
                    InteriorPathSet pathset = new InteriorPathSet(stream, app, meshNameWithoutExtension);
                    return(pathset);
                }
                catch (Exception e) {
                    LogManager.Instance.Write("Could not read '{0}'; error was '{1}'",
                                              modelPathFile, e.Message);
                    pathSetDictionary[meshNameWithoutExtension] = new InteriorPathSetLookup(false, null);
                    return(null);
                }
            }
        }
コード例 #2
0
        // This constructor reads the xml from the file, filling in
        // the instance, and adding it to the dictionary mapping mesh
        // name to InteriorPathSet instance.
        public InteriorPathSet(Stream filestream, WorldEditor app, string meshName)
        {
            this.meshName = meshName;
            XmlReader r = XmlReader.Create(filestream, app.XMLReaderSettings);

            FromXml(r, app);
            pathSetDictionary[meshName] = new InteriorPathSetLookup(true, this);
        }
コード例 #3
0
 // Look up the path set associated with a particular mesh
 public static InteriorPathSet FindPathsForMesh(WorldEditor app, string meshName)
 {
     InteriorPathSetLookup result;
     if (pathSetDictionary.TryGetValue(meshName, out result))
         return result.paths;
     else {
         string meshNameWithoutExtension = Path.GetFileNameWithoutExtension(meshName);
         string modelPathFile = meshNameWithoutExtension + ".modelpaths";
         try {
             Stream stream = ResourceManager.FindCommonResourceData(modelPathFile);
             InteriorPathSet pathset = new InteriorPathSet(stream, app, meshNameWithoutExtension);
             return pathset;
         }
         catch (Exception e) {
             LogManager.Instance.Write("Could not read '{0}'; error was '{1}'",
                                       modelPathFile, e.Message);
             pathSetDictionary[meshNameWithoutExtension] = new InteriorPathSetLookup(false, null);
             return null;
         }
     }
 }
コード例 #4
0
 // This constructor reads the xml from the file, filling in
 // the instance, and adding it to the dictionary mapping mesh
 // name to InteriorPathSet instance.
 public InteriorPathSet(Stream filestream, WorldEditor app, string meshName)
 {
     this.meshName = meshName;
     XmlReader r = XmlReader.Create(filestream, app.XMLReaderSettings);
     FromXml(r, app);
     pathSetDictionary[meshName] = new InteriorPathSetLookup(true, this);
 }
コード例 #5
0
 // This constructor is used when saving a collection of
 // InteriorPaths from a UI model object.
 public InteriorPathSet(string meshName)
 {
     this.meshName = meshName;
     pathSetDictionary[meshName] = new InteriorPathSetLookup(true, this);
 }
コード例 #6
0
 // This constructor is used when saving a collection of
 // InteriorPaths from a UI model object.
 public InteriorPathSet(string meshName)
 {
     this.meshName = meshName;
     pathSetDictionary[meshName] = new InteriorPathSetLookup(true, this);
 }