Exemplo n.º 1
0
 private static void DrawStartOids(OIDProject oIDProject, Scene scene, TTToolSettings set, string workdir, Bitmap maskPicture, Graphics graphic, bool highquality)
 {
     if (scene.StartOid != null && scene.StartOid.Polygons != null && scene.StartOid.Polygons.Count > 0)
     {
         set.CodeDim = new Size(1, 1);
         var res       = TTTool.CreateOidCodes(set, oIDProject.ProductID, workdir);
         var MaskImage = Bitmap.FromFile(res);
         DrawPolygons(maskPicture, graphic, scene.StartOid, MaskImage, highquality);
     }
 }
Exemplo n.º 2
0
 private static void DrawSeceneOids(OIDProject oIDProject, Scene scene, TTToolSettings set, string workdir, Bitmap maskPicture, Graphics graphic, bool highquality)
 {
     foreach (SceneOid sc in scene.SceneOids)
     {
         var ns = oIDProject.nodeSetups.Where(x => x.Name == sc.SetupName).FirstOrDefault();
         set.CodeDim = new Size(1, 1);
         var res       = TTTool.CreateOidCodes(set, (short)ns.OID, workdir);
         var MaskImage = Bitmap.FromFile(res);
         DrawPolygons(maskPicture, graphic, sc, MaskImage, highquality);
     }
 }
Exemplo n.º 3
0
        public string CreateGME()
        {
            var yaml = $"{Path.Combine(ProjectPath, Name)}_build.yaml";

            using (var fileStream = new FileStream(yaml, FileMode.Create, FileAccess.Write))
            {
                using (StreamWriter writer = new StreamWriter(fileStream))
                {
                    writer.WriteLine(CreateYaml());
                }
            }

            var gme = $"{Path.Combine(ProjectPath, Name)}.gme";

            TTTool.Assemble(yaml, gme);

            return(gme);
        }
Exemplo n.º 4
0
        private static void DrawAllOids(OIDProject oIDProject, Scene scene, TTToolSettings set, string workdir, Bitmap maskPicture, Graphics graphic, bool highquality)
        {
            var allOids = new List <SceneOid>();

            allOids.AddRange(scene.SceneOids);
            if (scene.StartOid != null && scene.StartOid.Polygons != null && scene.StartOid.Polygons.Count > 0)
            {
                allOids.Add(scene.StartOid);
            }

            foreach (SceneOid sc in allOids)
            {
                var ns = oIDProject.nodeSetups.Where(x => x.Name == sc.SetupName).FirstOrDefault();
                set.CodeDim = new Size(1, 1);
                var res       = TTTool.CreateOidCodes(set, (ushort)(ns != null ? ns.OID: oIDProject.ProductID), workdir);
                var MaskImage = Bitmap.FromFile(res);
                DrawPolygons(maskPicture, graphic, sc, MaskImage, highquality);
            }
        }