Advertisement
dmitrysenkovich

Untitled

Aug 27th, 2014
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 31.67 KB | None | 0 0
  1. Index: ExportSurface.cs
  2. ===================================================================
  3. --- ExportSurface.cs    (revision 6363)
  4. +++ ExportSurface.cs    (working copy)
  5. @@ -24,12 +24,11 @@
  6.  
  7.          public override bool RunImp(Task task, AppEnv appEnv, bool withChildren)
  8.          {
  9. -            string tempDir = appEnv.TempDir + @"export-surface\";
  10. -            string cutinDir = tempDir + @"rrr_and_airfields_cutin\";
  11. -            string filterByPropertiesDir = tempDir + @"filter-by-properties-luas\";
  12. -            string airfieldSurfaceDir = tempDir + @"airfield-surface\";
  13. -            string airfieldSuperficialDir = tempDir + @"airfield-superficial\";
  14. -            string tempSurfaceDir = tempDir + @"airfield-temp\";
  15. +            string cutinDir = appEnv.SurfaceTempDir + @"rrr_and_airfields_cutin\";
  16. +            string filterByPropertiesDir = appEnv.SurfaceTempDir + @"filter-by-properties-luas\";
  17. +            string airfieldSurfaceDir = appEnv.SurfaceTempDir + @"airfield-surface\";
  18. +            string airfieldSuperficialDir = appEnv.SurfaceTempDir + @"airfield-superficial\";
  19. +            string tempSurfaceDir = appEnv.SurfaceTempDir + @"airfield-temp\";
  20.  
  21.              string terrainCfg = appEnv.vars["TERRAIN_CONFIG"].StringValue;
  22.              string rrrOutput = appEnv.vars["RRR_OUTPUT"].StringValue;
  23. @@ -39,8 +38,8 @@
  24.  
  25.              task.AddVariables(SettingsPanel.vars);
  26.  
  27. -            System.IO.Directory.CreateDirectory(tempDir);
  28. -            Tools.Path.CleanupDir(tempDir);
  29. +            System.IO.Directory.CreateDirectory(appEnv.SurfaceTempDir);
  30. +            Tools.Path.CleanupDir(appEnv.SurfaceTempDir);
  31.              System.IO.Directory.CreateDirectory(cutinDir);
  32.              System.IO.Directory.CreateDirectory(filterByPropertiesDir);
  33.              System.IO.Directory.CreateDirectory(airfieldSurfaceDir);
  34. @@ -48,10 +47,10 @@
  35.  
  36.              if (appEnv.terrainConfig.Lsa5)
  37.              {
  38. -                tempDir = appEnv.TempDir + @"export-lsa5\";
  39. +                string Lsa5TempDir = appEnv.TempDir + @"export-lsa5\";
  40.  
  41.                  // apply-surface-types & merge
  42. -                string mergedsurface = tempDir + @"merged_surface.ofsh";
  43. +                string mergedsurface = Lsa5TempDir + @"merged_surface.ofsh";
  44.                  {
  45.                      List<string> surfaceMeshes = new List<string>();
  46.  
  47. @@ -59,7 +58,7 @@
  48.                      foreach (var surface in surfaceL0_)
  49.                      {
  50.                          string surfaceFile = surface.FilenameNoExtension();
  51. -                        string surfaceFileRenamed = tempDir + surfaceFile + ".ofsh";
  52. +                        string surfaceFileRenamed = Lsa5TempDir + surfaceFile + ".ofsh";
  53.  
  54.                          command = new Command();
  55.                          command.EdtuCommand = "apply-surface-types";
  56. @@ -74,7 +73,7 @@
  57.                      foreach (var airfield in airfields)
  58.                      {
  59.                          string airfieldFile = airfield.FilenameNoExtension();
  60. -                        string airfieldFileRenamed = tempDir + airfieldFile + ".ofsh";
  61. +                        string airfieldFileRenamed = Lsa5TempDir + airfieldFile + ".ofsh";
  62.  
  63.                          command = new Command();
  64.                          command.EdtuCommand = "apply-surface-types";
  65. @@ -91,8 +90,8 @@
  66.  
  67.  
  68.                  // link-vector-data
  69. -                string mergedvectordata = tempDir + @"merged_vectordata.ofsh";
  70. -                string linkedvectordata = tempDir + @"merged_vectordata.lnkd";
  71. +                string mergedvectordata = Lsa5TempDir + @"merged_vectordata.ofsh";
  72. +                string linkedvectordata = Lsa5TempDir + @"merged_vectordata.lnkd";
  73.                  {
  74.                      string[] vectordata = PathsFromCategory(appEnv, Project.VECTOR_DATA_5_CATEGORY);
  75.                      command = MergeOffshoresCommand(vectordata, mergedvectordata);
  76. @@ -104,12 +103,12 @@
  77.                                   + linkedvectordata.Enclose() + " "
  78.                                   + "-staticmesh " + mergedsurface.Enclose() + " "
  79.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  80. -                    command.ErrorsFile = tempDir + @"link-vector-data_errors.ofsh"; ;
  81. +                    command.ErrorsFile = Lsa5TempDir + @"link-vector-data_errors.ofsh"; ;
  82.                      task.AddCommand(command);
  83.                  }
  84.  
  85.                  // build-lsa5
  86. -                string lsa5filename = tempDir + @"surface.lsa5";
  87. +                string lsa5filename = Lsa5TempDir + @"surface.lsa5";
  88.                  {
  89.                      command = new Command();
  90.                      command.EdtuCommand = "build-lsa5";
  91. @@ -117,7 +116,7 @@
  92.                                   + linkedvectordata.Enclose() + " "
  93.                                   + lsa5filename.Enclose() + " "
  94.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  95. -                    command.ErrorsFile = tempDir + @"build-lsa5_errors.ofsh"; ;
  96. +                    command.ErrorsFile = Lsa5TempDir + @"build-lsa5_errors.ofsh"; ;
  97.                      task.AddCommand(command);
  98.                  }
  99.  
  100. @@ -127,9 +126,9 @@
  101.                      command.Type = Command.CommandType.EDTU4;
  102.                      command.EdtuCommand = "export-vector-data";
  103.                      command.Args = linkedvectordata.Enclose() + " "
  104. -                                   + (tempDir + @"vectordata_view.ofsh").Enclose()
  105. +                                   + (Lsa5TempDir + @"vectordata_view.ofsh").Enclose()
  106.                                     + " -terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  107. -                    command.ErrorsFile = tempDir + @"export-vector-data_errors.ofsh";
  108. +                    command.ErrorsFile = Lsa5TempDir + @"export-vector-data_errors.ofsh";
  109.                      task.AddCommand(command);
  110.                  }
  111.  
  112. @@ -142,7 +141,7 @@
  113.                  command.Args = lsa5filename.Enclose() + " "
  114.                               + lsa4filename.Enclose() + " "
  115.                               + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  116. -                command.ErrorsFile = tempDir + @"lsa5-lsa4_errors.ofsh"; ;
  117. +                command.ErrorsFile = Lsa5TempDir + @"lsa5-lsa4_errors.ofsh"; ;
  118.                  task.AddCommand(command);
  119.  
  120.                  return true;
  121. @@ -152,11 +151,10 @@
  122.              {
  123.                  string seaMaterial = "Sea4.1";
  124.  
  125. -                tempDir = appEnv.TempDir + @"export-lsa4-with-vector-data-5\";
  126. -                System.IO.Directory.CreateDirectory(tempDir);
  127. -                Tools.Path.CleanupDir(tempDir);
  128. +                System.IO.Directory.CreateDirectory(appEnv.SurfaceTempDir);
  129. +                Tools.Path.CleanupDir(appEnv.SurfaceTempDir);
  130.                  // apply-surface-types & merge
  131. -                string mergedsurface = tempDir + @"merged-surface.ofsh";
  132. +                string mergedsurface = appEnv.SurfaceTempDir + @"merged-surface.ofsh";
  133.                  {
  134.                      List<string> surfaceMeshes = new List<string>();
  135.  
  136. @@ -164,8 +162,8 @@
  137.                      foreach (var surface in surfaceL0_)
  138.                          surfaceMeshes.Add(surface);
  139.  
  140. -                    string premergedsurface = tempDir + @"pre-merged-surface.ofsh";
  141. -                    string elevatingsurface = tempDir + @"elevated-surface.ofsh";
  142. +                    string premergedsurface = appEnv.SurfaceTempDir + @"pre-merged-surface.ofsh";
  143. +                    string elevatingsurface = appEnv.SurfaceTempDir + @"elevated-surface.ofsh";
  144.                      task.AddCommand(Operation.MergeOffshoresCommand(surfaceMeshes.ToArray(), premergedsurface));
  145.  
  146.                      // apply-surface-types
  147. @@ -172,7 +170,7 @@
  148.                      command = new Command();
  149.                      command.EdtuCommand = "apply-surface-types";
  150.                      command.Args = premergedsurface.Enclose() + " " + elevatingsurface.Enclose() + " -defaulttype surface";
  151. -                    command.ErrorsFile = tempDir + "apply-surface-types-errors.ofsh";
  152. +                    command.ErrorsFile = appEnv.SurfaceTempDir + "apply-surface-types-errors.ofsh";
  153.                      task.AddCommand(command);
  154.  
  155.                      // elevate-static-surface
  156. @@ -180,7 +178,7 @@
  157.                      command.EdtuCommand = "elevate-static-surface";
  158.                      command.Args = elevatingsurface.Enclose() + " " + mergedsurface.Enclose();
  159.                      command.Args += " -terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  160. -                    command.ErrorsFile = tempDir + "elevate-static-surface-errors.ofsh";
  161. +                    command.ErrorsFile = appEnv.SurfaceTempDir + "elevate-static-surface-errors.ofsh";
  162.                      task.AddCommand(command);
  163.  
  164.                  }
  165. @@ -192,15 +190,15 @@
  166.                  bool needBuildSurfaceL2 = surfaceL2.Length > 0;
  167.                  /////////////////////////////////////
  168.                  // L2
  169. -                var surfacefilenameL2 = tempDir + "surface-L2.ofsh";
  170. +                var surfacefilenameL2 = appEnv.SurfaceTempDir + "surface-L2.ofsh";
  171.                  {
  172. -                    var mergedfilenameL2 = tempDir + "merged-L2.ofsh";
  173. +                    var mergedfilenameL2 = appEnv.SurfaceTempDir + "merged-L2.ofsh";
  174.                      if (needBuildSurfaceL2)
  175.                      {
  176.                          command = MergeOffshoresCommand(surfaceL2, mergedfilenameL2);
  177.                          task.AddCommand(command);
  178.  
  179. -                        var buildedfilenameL2 = tempDir + "builded-L2.ofsh";
  180. +                        var buildedfilenameL2 = appEnv.SurfaceTempDir + "builded-L2.ofsh";
  181.                          command = new Command();
  182.                          command.EdtuCommand = "build-surface-lod2";
  183.                          command.Args = "-i " + mergedfilenameL2.Enclose() + " "
  184. @@ -210,7 +208,7 @@
  185.                                       + "-linked " + appEnv.VectorData5OutputLnkd.Enclose() + " "
  186.                                       + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose()
  187.                                       ;
  188. -                        command.ErrorsFile = tempDir + @"build-surface-lod2-errors.ofsh";
  189. +                        command.ErrorsFile = appEnv.SurfaceTempDir + @"build-surface-lod2-errors.ofsh";
  190.                          task.AddCommand(command);
  191.                          surfacefilenameL2 = buildedfilenameL2;
  192.                      }
  193. @@ -217,9 +215,9 @@
  194.                  }
  195.  
  196.                  // L1
  197. -                string surfaceL1 = tempDir + @"surface-L1.ofsh";
  198. +                string surfaceL1 = appEnv.SurfaceTempDir + @"surface-L1.ofsh";
  199.                  {
  200. -                    var srcL1 = tempDir + "src-L1.ofsh";
  201. +                    var srcL1 = appEnv.SurfaceTempDir + "src-L1.ofsh";
  202.                      
  203.                      var l1paths = PathsFromCategory(appEnv, appEnv.Project.SurfaceLod(1));
  204.  
  205. @@ -233,7 +231,7 @@
  206.                          command = new Command();
  207.                          command.EdtuCommand = "apply-surface-types";
  208.                          command.Args = srcL1.Enclose() + " " + srcL1.Enclose() + " -defaulttype surface";
  209. -                        command.ErrorsFile = tempDir + "apply-surface-types-errors.ofsh";
  210. +                        command.ErrorsFile = appEnv.SurfaceTempDir + "apply-surface-types-errors.ofsh";
  211.                          task.AddCommand(command);
  212.                      }
  213.                      else
  214. @@ -247,12 +245,12 @@
  215.                                   + "-seamaterial " + seaMaterial + " "
  216.                                   + "-linked " + appEnv.VectorData5OutputLnkd.Enclose() + " "
  217.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  218. -                    command.ErrorsFile = tempDir + @"build-surface-lod1-errors.ofsh";
  219. +                    command.ErrorsFile = appEnv.SurfaceTempDir + @"build-surface-lod1-errors.ofsh";
  220.                      task.AddCommand(command);
  221.                  }
  222.  
  223.                  // build-surface-by-vector-data-5
  224. -                string surfaceL0_1 = tempDir + @"surface-L0.ofsh";
  225. +                string surfaceL0_1 = appEnv.SurfaceL0Output;
  226.                  string outputReflectReceiver = appEnv.ReflectReceiverScene;
  227.                  {
  228.                      command = new Command();
  229. @@ -266,13 +264,13 @@
  230.                                   + "-seaUndeterminatedValid "
  231.                                   + "-reflectreceiver " + outputReflectReceiver.Enclose() + " "
  232.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  233. -                    command.ErrorsFile = tempDir + @"build-surface-by-vector-data-5-errors.ofsh";
  234. +                    command.ErrorsFile = appEnv.SurfaceTempDir + @"build-surface-by-vector-data-5-errors.ofsh";
  235.                      // command.IsCriticalCommand = true;
  236.                      task.AddCommand(command);
  237.                  }
  238.  
  239.                  // elevate-surface-lod1
  240. -                string surfaceL1Elevated = tempDir + @"surface-L1.ofsh";
  241. +                string surfaceL1Elevated = appEnv.SurfaceTempDir + @"surface-L1.ofsh";
  242.                  {
  243.                      command = new Command();
  244.                      command.EdtuCommand = "elevate-surface-lod1";
  245. @@ -279,11 +277,11 @@
  246.                      command.Args = surfaceL1.Enclose() + " "
  247.                                   + surfaceL1Elevated.Enclose() + " "
  248.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  249. -                    command.ErrorsFile = tempDir + @"elevate-surface-lod1-errors.ofsh";
  250. +                    command.ErrorsFile = appEnv.SurfaceTempDir + @"elevate-surface-lod1-errors.ofsh";
  251.                      //task.AddCommand(command);
  252.                  }
  253.  
  254. -                string cutL0filename = tempDir + @"cut-by-squares.ofsh";
  255. +                string cutL0filename = appEnv.SurfaceTempDir + @"cut-by-squares.ofsh";
  256.                  command = new Command();
  257.                  command.EdtuCommand = "cut-by-squares";
  258.                  command.Args = surfaceL0_1.Enclose() + " "
  259. @@ -290,10 +288,10 @@
  260.                               + cutL0filename.Enclose() + " "
  261.                               + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose() + " "
  262.                               + "-squaresize " + squareSizeL0 + " ";
  263. -                command.ErrorsFile = tempDir + "cut-by-squares-errors.ofsh";
  264. +                command.ErrorsFile = appEnv.SurfaceTempDir + "cut-by-squares-errors.ofsh";
  265.                  task.AddCommand(command);
  266.  
  267. -                string cutL1filename = tempDir + @"cut-by-squares-lod1.ofsh";
  268. +                string cutL1filename = appEnv.SurfaceTempDir + @"cut-by-squares-lod1.ofsh";
  269.                  command = new Command();
  270.                  command.EdtuCommand = "cut-by-squares";
  271.                  command.Args = surfaceL1.Enclose() + " "
  272. @@ -300,10 +298,10 @@
  273.                               + cutL1filename.Enclose() + " "
  274.                               + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose() + " "
  275.                               + "-squaresize " + squareSizeL1 + " ";
  276. -                command.ErrorsFile = tempDir + "cut-by-squares-errors.ofsh";
  277. +                command.ErrorsFile = appEnv.SurfaceTempDir + "cut-by-squares-errors.ofsh";
  278.                  task.AddCommand(command);
  279.  
  280. -                string cutL2filename = tempDir + @"cut-by-squares-lod2.ofsh";
  281. +                string cutL2filename = appEnv.SurfaceTempDir + @"cut-by-squares-lod2.ofsh";
  282.                  if (needBuildSurfaceL2)
  283.                  {
  284.                      command = new Command();
  285. @@ -312,7 +310,7 @@
  286.                                   + cutL2filename.Enclose() + " "
  287.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose() + " "
  288.                                   + "-squaresize " + squareSizeL2 + " ";
  289. -                    command.ErrorsFile = tempDir + "cut-by-squares-errors.ofsh";
  290. +                    command.ErrorsFile = appEnv.SurfaceTempDir + "cut-by-squares-errors.ofsh";
  291.                      task.AddCommand(command);
  292.                  }
  293.  
  294. @@ -327,7 +325,7 @@
  295.                               + "-domerge "
  296.                               + (appEnv.terrainConfig.SurfaceLodsBleding ? "-surface-lods-blending " : "")
  297.                               ;
  298. -                command.ErrorsFile = tempDir + "export-lsa4-errors.ofsh";
  299. +                command.ErrorsFile = appEnv.SurfaceTempDir + "export-lsa4-errors.ofsh";
  300.                  task.AddCommand(command);
  301.  
  302.                  return true;
  303. @@ -420,7 +418,7 @@
  304.              // * towns mesh
  305.              meshes.Add(rrrOutput);
  306.              meshes.Add(townOutput);
  307. -            string mergedMeshes = tempDir + @"merged_meshes.ofsh";
  308. +            string mergedMeshes = appEnv.SurfaceTempDir + @"merged_meshes.ofsh";
  309.              command = MergeOffshoresCommand(meshes.ToArray(), mergedMeshes);
  310.              task.AddCommand(command);
  311.  
  312. @@ -438,7 +436,7 @@
  313.                  command = new Command();
  314.                  command.EdtuCommand = "roughcutin_mesh";
  315.                  command.Args = args + " -ignoreonlay -ignorefreese";
  316. -                command.ErrorsFile = tempDir + @"errors_rrr_airfields_cutin_to_" + name;
  317. +                command.ErrorsFile = appEnv.SurfaceTempDir + @"errors_rrr_airfields_cutin_to_" + name;
  318.                  task.AddCommand(command);
  319.              }
  320.              foreach (var surface in surfaceL0)
  321. @@ -452,8 +450,8 @@
  322.              if (exportToLsa3)
  323.              {
  324.                  // for LSA3 only
  325. -                string surfaceDir = tempDir + @"surface";
  326. -                string lsa3cache = tempDir + @"lsa3cache";
  327. +                string surfaceDir = appEnv.SurfaceTempDir + @"surface";
  328. +                string lsa3cache = appEnv.SurfaceTempDir + @"lsa3cache";
  329.                  string lsa3file = appEnv.vars["LSA3_FILE"].StringValue;
  330.                  string onlaySup3file = appEnv.vars["ONLAYSUP3_FILE"].StringValue;
  331.  
  332. @@ -473,7 +471,7 @@
  333.                  {
  334.                      command = new Command();
  335.                      command.EdtuCommand = "cutbysquares";
  336. -                    command.ErrorsFile = tempDir + @"errors_cut_" + System.IO.Path.GetFileName(name);
  337. +                    command.ErrorsFile = appEnv.SurfaceTempDir + @"errors_cut_" + System.IO.Path.GetFileName(name);
  338.                      command.Args = Enclose(name) + " "
  339.                                   + Enclose(surfaceDir) + " "
  340.                                   + "10000 "
  341. @@ -491,7 +489,7 @@
  342.  
  343.                      command = new Command();
  344.                      command.EdtuCommand = "cutbysquares";
  345. -                    command.ErrorsFile = tempDir + @"errors_cut_L2_" + name;
  346. +                    command.ErrorsFile = appEnv.SurfaceTempDir + @"errors_cut_L2_" + name;
  347.                      command.Args = Enclose(surface) + " "
  348.                                   + Enclose(surfaceDir) + " "
  349.                                   + "20000 "
  350. @@ -503,7 +501,7 @@
  351.                  {
  352.                      command = new Command();
  353.                      command.EdtuCommand = "offshore-assemble-lsa3";
  354. -                    command.ErrorsFile = tempDir + @"errors_offshore-assemble-lsa3.ofsh";
  355. +                    command.ErrorsFile = appEnv.SurfaceTempDir + @"errors_offshore-assemble-lsa3.ofsh";
  356.                      command.Args = Enclose(surfaceDir) + " "
  357.                                   + Enclose(lsa3file)
  358.                                   + " -terrain " + Enclose(terrainCfg)
  359. @@ -514,15 +512,15 @@
  360.  
  361.                  // onlays
  362.                  {
  363. -                    string mergedOnlays = tempDir + @"merged_onlays.ofsh";
  364. +                    string mergedOnlays = appEnv.SurfaceTempDir + @"merged_onlays.ofsh";
  365.                      command = MergeOffshoresCommand(onlays.ToArray(), mergedOnlays);
  366.                      task.AddCommand(command);
  367.  
  368.                      // РџРѕ высоте lsa3
  369. -                    string mergedOnlaysOnLsa3 = tempDir + @"merged_onlays_lsa3.ofsh";
  370. +                    string mergedOnlaysOnLsa3 = appEnv.SurfaceTempDir + @"merged_onlays_lsa3.ofsh";
  371.                      command = new Command();
  372.                      command.EdtuCommand = "projectiontolsa3";
  373. -                    command.ErrorsFile = tempDir + @"errors_projectiontolsa3.ofsh";
  374. +                    command.ErrorsFile = appEnv.SurfaceTempDir + @"errors_projectiontolsa3.ofsh";
  375.                      command.Args = Enclose(mergedOnlays) + " "
  376.                                   + Enclose(mergedOnlaysOnLsa3)
  377.                                   + " -terrain " + Enclose(terrainCfg);
  378. @@ -531,7 +529,7 @@
  379.                      // Р­РєСЃРїРѕСЂС‚ sup3
  380.                      command = new Command();
  381.                      command.EdtuCommand = "offshore-sup3";
  382. -                    command.ErrorsFile = tempDir + @"errors_onlaystosup3.ofsh";
  383. +                    command.ErrorsFile = appEnv.SurfaceTempDir + @"errors_onlaystosup3.ofsh";
  384.                      command.Args = Enclose(mergedOnlaysOnLsa3) + " "
  385.                                   + Enclose(onlaySup3file)
  386.                                   + " -terrain " + Enclose(terrainCfg);
  387. @@ -544,13 +542,13 @@
  388.              {
  389.                  double weld = 0.1;
  390.  
  391. -                string errorsFile = tempDir + "surfaceL0_errors.ofsh";
  392. -                string errorsFileRocksArea = tempDir + "rocksArea_errors.ofsh";
  393. -                string errorsFileRocks = tempDir + "rocks_errors.ofsh";
  394. -                string errorsFileCut = tempDir + "cutL0_errors.ofsh";
  395. -                string errorsFileLSA4 = tempDir + "LSA4_errors.ofsh";
  396. -                string errorsFileMerge = tempDir + "merge_errors.ofsh";
  397. -                string errorsFileMergeRocks = tempDir + "mergeRocks_errors.ofsh";
  398. +                string errorsFile = appEnv.SurfaceTempDir + "surfaceL0_errors.ofsh";
  399. +                string errorsFileRocksArea = appEnv.SurfaceTempDir + "rocksArea_errors.ofsh";
  400. +                string errorsFileRocks = appEnv.SurfaceTempDir + "rocks_errors.ofsh";
  401. +                string errorsFileCut = appEnv.SurfaceTempDir + "cutL0_errors.ofsh";
  402. +                string errorsFileLSA4 = appEnv.SurfaceTempDir + "LSA4_errors.ofsh";
  403. +                string errorsFileMerge = appEnv.SurfaceTempDir + "merge_errors.ofsh";
  404. +                string errorsFileMergeRocks = appEnv.SurfaceTempDir + "mergeRocks_errors.ofsh";
  405.  
  406.                  // FAILED
  407.                  string terrainCfgDir =
  408. @@ -558,19 +556,19 @@
  409.                  string lsa4output = terrainCfgDir + @"Surface\"
  410.                                    + AppEnv.Instance.TerrainName + ".lsa4";
  411.  
  412. -                var mergedfilename = tempDir + "sourceL0.ofsh";
  413. +                var mergedfilename = appEnv.SurfaceTempDir + "sourceL0.ofsh";
  414.                  command = MergeOffshoresCommand(cutbysquares.ToArray(), mergedfilename);
  415.                  task.AddCommand(command);
  416.  
  417. -                var surfaceL0filename = tempDir + "surfaceL0.ofsh";
  418. -                var mergedL0filename = tempDir + "mergedL0.ofsh";
  419. -                var finalL0filename = tempDir + "finalL0.ofsh";
  420. -                var cutL0filename = tempDir + "cutL0.ofsh";
  421. +                var surfaceL0filename = appEnv.SurfaceL0Output;
  422. +                var mergedL0filename = appEnv.SurfaceTempDir + "mergedL0.ofsh";
  423. +                var finalL0filename = appEnv.SurfaceTempDir + "finalL0.ofsh";
  424. +                var cutL0filename = appEnv.SurfaceTempDir + "cutL0.ofsh";
  425.                  var splines = appEnv.TempDir + @"export-rrr\merged.ofsh";
  426.                  var meshDataFilename = appEnv.TempDir + @"export-towns\merged.ofsh";
  427. -                var cutRocksFilename = tempDir + "rockArea.ofsh";
  428. -                var rocksFilename = tempDir + "rocks.ofsh";
  429. -                var mergedRocksFilename = tempDir + "mergedRocks.ofsh";
  430. +                var cutRocksFilename = appEnv.SurfaceTempDir + "rockArea.ofsh";
  431. +                var rocksFilename = appEnv.SurfaceTempDir + "rocks.ofsh";
  432. +                var mergedRocksFilename = appEnv.SurfaceTempDir + "mergedRocks.ofsh";
  433.  
  434.                  command = new Command();
  435.                  command.EdtuCommand = "build-surface";
  436. @@ -592,10 +590,10 @@
  437.                  task.AddCommand(command);
  438.  
  439.                  // forests
  440. -                var outputMergedForests = tempDir + "extruded-merged-forests.ofsh";
  441. -                var outputMergedGroundsForests = tempDir + "extruded-merged-forests-grounds.ofsh";
  442. +                var outputMergedForests = appEnv.SurfaceTempDir + "extruded-merged-forests.ofsh";
  443. +                var outputMergedGroundsForests = appEnv.SurfaceTempDir + "extruded-merged-forests-grounds.ofsh";
  444.                  {
  445. -                    string scene_mergedfilename = tempDir + @"scene_merged.ofsh";
  446. +                    string scene_mergedfilename = appEnv.SurfaceTempDir + @"scene_merged.ofsh";
  447.                      List<string> scenes = new List<string>();
  448.                      scenes.Add(appEnv.vars["RRR_SCENE_OUTPUT"].StringValue);
  449.                      scenes.AddRange(PathsFromCategory(appEnv, Project.SCENES_CATEGORY));
  450. @@ -603,9 +601,9 @@
  451.                      command = MergeOffshoresCommand(scenes.ToArray(), scene_mergedfilename);
  452.                      task.AddCommand(command);
  453.  
  454. -                    string errorsFileMergeForests = tempDir + "mergeForests_errors.ofsh";
  455. -                    string errorsFileMergeForestsGrounds = tempDir + "mergeForestsGrounds_errors.ofsh";
  456. -                    var outputForests = tempDir + "extruded-forests.ofsh";
  457. +                    string errorsFileMergeForests = appEnv.SurfaceTempDir + "mergeForests_errors.ofsh";
  458. +                    string errorsFileMergeForestsGrounds = appEnv.SurfaceTempDir + "mergeForestsGrounds_errors.ofsh";
  459. +                    var outputForests = appEnv.SurfaceTempDir + "extruded-forests.ofsh";
  460.  
  461.                      command = new Command();
  462.                      command.EdtuCommand = "extrude-forests";
  463. @@ -615,8 +613,8 @@
  464.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose() + " "
  465.                                   + "-scene " + scene_mergedfilename.Enclose() + " "
  466.                                   + "-weld " + weld.ToString() + " "
  467. -                                 + "-grounds " + tempDir + "extrude-forests-grounds.ofsh";
  468. -                    command.ErrorsFile = tempDir + "extrude-forests-errors.ofsh";
  469. +                                 + "-grounds " + appEnv.SurfaceTempDir + "extrude-forests-grounds.ofsh";
  470. +                    command.ErrorsFile = appEnv.SurfaceTempDir + "extrude-forests-errors.ofsh";
  471.                      task.AddCommand(command);
  472.  
  473.                      command = new Command();
  474. @@ -629,7 +627,7 @@
  475.  
  476.                      command = new Command();
  477.                      command.EdtuCommand = "merge-by-material";
  478. -                    command.Args = tempDir + "extrude-forests-grounds.ofsh" + " "
  479. +                    command.Args = appEnv.SurfaceTempDir + "extrude-forests-grounds.ofsh" + " "
  480.                                   + outputMergedGroundsForests.Enclose() + " "
  481.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  482.                      command.ErrorsFile = errorsFileMergeForestsGrounds;
  483. @@ -636,7 +634,7 @@
  484.                      task.AddCommand(command);
  485.                  }
  486.                  // generate-sea
  487. -                var outputMergedSea = tempDir + "sea-merged.ofsh";
  488. +                var outputMergedSea = appEnv.SurfaceTempDir + "sea-merged.ofsh";
  489.                  {
  490.                      command = new Command();
  491.                      command.EdtuCommand = "generate-sea";
  492. @@ -645,11 +643,11 @@
  493.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose() + " "
  494.                                   + "-material Sea4.1 "
  495.                                   + "-reflectreceiver " + appEnv.ReflectReceiverScene.Enclose();
  496. -                    command.ErrorsFile = tempDir + "generate-sea-errors.ofsh";
  497. +                    command.ErrorsFile = appEnv.SurfaceTempDir + "generate-sea-errors.ofsh";
  498.                      task.AddCommand(command);
  499.                  }
  500.                  // generate-reflections
  501. -                var outputReflectons = tempDir + "reflections-merged.ofsh";
  502. +                var outputReflectons = appEnv.SurfaceTempDir + "reflections-merged.ofsh";
  503.                  {
  504.                      command = new Command();
  505.                      command.EdtuCommand = "generate-reflections";
  506. @@ -657,13 +655,13 @@
  507.                                   + outputReflectons.Enclose() + " "
  508.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose() + " "
  509.                                   + "-material Sea4.1";
  510. -                    command.ErrorsFile = tempDir + "generate-reflections-errors.ofsh";
  511. +                    command.ErrorsFile = appEnv.SurfaceTempDir + "generate-reflections-errors.ofsh";
  512.                      task.AddCommand(command);
  513.                  }
  514.                  // ground
  515. -                var outputMergedGrounds = tempDir + "grounds-merged.ofsh";
  516. +                var outputMergedGrounds = appEnv.SurfaceTempDir + "grounds-merged.ofsh";
  517.                  {
  518. -                    var outputGrounds = tempDir + "grounds.ofsh";
  519. +                    var outputGrounds = appEnv.SurfaceTempDir + "grounds.ofsh";
  520.  
  521.                      command = new Command();
  522.                      command.EdtuCommand = "fill-grounds";
  523. @@ -672,7 +670,7 @@
  524.                                   + "-meshdata " + meshDataFilename.Enclose() + " "
  525.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose() + " "
  526.                                   + "-weld " + weld.ToString();
  527. -                    command.ErrorsFile = tempDir + "fill-grounds-errors.ofsh";
  528. +                    command.ErrorsFile = appEnv.SurfaceTempDir + "fill-grounds-errors.ofsh";
  529.                      task.AddCommand(command);
  530.  
  531.                      command = new Command();
  532. @@ -680,7 +678,7 @@
  533.                      command.Args = outputGrounds.Enclose() + " "
  534.                                   + outputMergedGrounds.Enclose() + " "
  535.                                   + "-terrain " + AppEnv.Instance.terrainConfig.TerrainCfg.Enclose();
  536. -                    command.ErrorsFile = tempDir + "merge_grounds_errors.ofsh";
  537. +                    command.ErrorsFile = appEnv.SurfaceTempDir + "merge_grounds_errors.ofsh";
  538.                      task.AddCommand(command);
  539.                  }
  540.  
  541. @@ -749,8 +747,8 @@
  542.  
  543.                  /////////////////////////////////////
  544.                  // L2
  545. -                var mergedfilenameL2 = tempDir + "mergedL2.ofsh";
  546. -                var surfacefilenameL2 = tempDir + "surfaceL2.ofsh";
  547. +                var mergedfilenameL2 = appEnv.SurfaceTempDir + "mergedL2.ofsh";
  548. +                var surfacefilenameL2 = appEnv.SurfaceTempDir + "surfaceL2.ofsh";
  549.                  string[] surfaceL2 = PathsFromCategory(appEnv, appEnv.Project.SurfaceLod(2));
  550.                  command = MergeOffshoresCommand(surfaceL2, mergedfilenameL2);
  551.                  task.AddCommand(command);
  552. @@ -771,7 +769,7 @@
  553.                  // Р­РєСЃРїРѕСЂС‚ sup4
  554.                  command = new Command();
  555.                  command.EdtuCommand = "export-sup4";
  556. -                command.ErrorsFile = tempDir + @"SUP4_errors.ofsh";
  557. +                command.ErrorsFile = appEnv.SurfaceTempDir + @"SUP4_errors.ofsh";
  558.                  command.Args = Enclose(surfacefilenameL2) + " "
  559.                               + Enclose(appEnv.Sup4SurfaceLod) + " "
  560.                               + "-squaresize " + squareSizeL2.ToString() + " "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement