Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //if no arguments are entered
            if (args.Length == 0)
            {
                printHelp();
            }
            for (int i = 0; i < args.Length; i++)
            {
                //wmc slant
                if (args[i] == "slant")
                {
                    //directory slant calc
                    if (args[i + 1] == "-dir")
                    {
                        if (args[i + 2] != "")
                        {
                            Corpus c = new Corpus(args[i + 2]);

                            if (args[i + 3] != "")
                            {
                                WordList wl = new WordList(args[i + 3]);
                                //not printing the value bc writeKslant will be called in determining kSlant
                                Slant.determineSlant(c, wl);
                            }
                        }
                    }
                    //file slant calc
                    else if (args[i + 1] == "-file")
                    {
                        //TO-DO
                    }
                }
                //wmc version
                else if (args[i] == "version")
                {
                    Console.WriteLine("wmc Version " + typeof(Program).Assembly.GetName().Version);
                }
            }

            //WORDLIST debug
            //WordList wordlist = new WordList(args[0]);
            //Console.Write(wordlist.ToString());

            //slant/Corpus debug
            //Corpus corpus = new Corpus(args[1]);
            //slant/Corpus/CorpusSegment debug
            //Console.WriteLine(corpus.CorpusSegments[0].filename + "\t" + corpus.CorpusSegments[0].contentM);

            //slant calc debug
            //Console.WriteLine(Slant.determineSlant(corpus, new WordList(args[2])));

            //only for debugging
            //Console.ReadKey();
        }
        /// <summary>
        /// Generates a RKN-container using the official dimensions
        /// </summary>
        /// <param name="id">The ID of the container</param>
        /// <returns>The newly generated container</returns>
        public static Container GenerateContainerRKN(int id)
        {
            // Create it
            Container container = new Container()
            {
                ID   = id,
                Mesh = new MeshCube()
                {
                    Length = 15.3,
                    Width  = 20.1,
                    Height = 16.3
                }
            };
            // Add slants
            Slant slant = new Slant()
            {
                Container = container,
                Position  = new MeshPoint()
                {
                    X = 0.0, Y = 15.6, Z = 0.0
                },
                NormalVector = new MeshPoint()
                {
                    X = 0.0, Y = 1.0, Z = -1.0
                }
            };

            slant.Seal();
            container.AddSlant(slant);
            // Add virtual piece
            VirtualPiece virtualPiece = new VirtualPiece()
            {
                Container        = container,
                FixedOrientation = 0,
                FixedPosition    = new MeshPoint()
                {
                    X = 1,
                    Y = 17.1,
                    Z = 11.0
                }
            };

            virtualPiece.AddComponent(0, 0, 0, 13.3, 3.0, 5.0);
            virtualPiece.Seal();
            container.AddVirtualPiece(virtualPiece);

            // Seal the container
            container.Seal();

            // Return it
            return(container);
        }
        /// <summary>
        /// Generates a AKW-container using the official dimensions
        /// </summary>
        /// <param name="id">The ID of the container</param>
        /// <returns>The newly generated container</returns>
        public static Container GenerateContainerAKW(int id)
        {
            // Create it
            Container container = new Container()
            {
                ID   = id,
                Mesh = new MeshCube()
                {
                    Length = 23.9,
                    Width  = 14.4,
                    Height = 11.1
                }
            };
            // Add slants
            Slant slant1 = new Slant()
            {
                Container = container,
                Position  = new MeshPoint()
                {
                    X = 4.65, Y = 0.0, Z = 0.0
                },
                NormalVector = new MeshPoint()
                {
                    X = -1.0, Y = 0.0, Z = -1.0
                }
            };

            slant1.Seal();
            container.AddSlant(slant1);
            Slant slant2 = new Slant()
            {
                Container = container,
                Position  = new MeshPoint()
                {
                    X = 19.25, Y = 0.0, Z = 0.0
                },
                NormalVector = new MeshPoint()
                {
                    X = 1.0, Y = 0.0, Z = -1.0
                }
            };

            slant2.Seal();
            container.AddSlant(slant2);

            // Seal the container
            container.Seal();

            // Return it
            return(container);
        }
        /// <summary>
        /// Generates a LD3-container using the official dimensions
        /// </summary>
        /// <param name="id">The ID of the container</param>
        /// <returns>The newly generated container</returns>
        public static Container GenerateContainerLD3(int id)
        {
            // Create it
            Container container = new Container()
            {
                ID   = id,
                Mesh = new MeshCube()
                {
                    Length = 15.3,
                    Width  = 20.1,
                    Height = 16.3
                }
            };
            // Add slants
            Slant slant = new Slant()
            {
                Container = container,
                Position  = new MeshPoint()
                {
                    X = 0.0, Y = 15.6, Z = 0.0
                },
                NormalVector = new MeshPoint()
                {
                    X = 0.0, Y = 1.0, Z = -1.0
                }
            };

            slant.Seal();
            container.AddSlant(slant);

            // Seal the container
            container.Seal();

            // Return it
            return(container);
        }
        /// <summary>
        /// Generates a AMJ-container using the official dimensions
        /// </summary>
        /// <param name="id">The ID of the container</param>
        /// <returns>The newly generated container</returns>
        public static Container GenerateContainerAMJ(int id)
        {
            // Create it
            Container container = new Container()
            {
                ID   = id,
                Mesh = new MeshCube()
                {
                    Length = 30.6,
                    Width  = 23.0,
                    Height = 24.0
                }
            };
            // Add slants
            Slant slant1 = new Slant()
            {
                Container = container,
                Position  = new MeshPoint()
                {
                    X = 0.0, Y = 15, Z = 24.0
                },
                NormalVector = new MeshPoint()
                {
                    X = 0.0, Y = 1.0, Z = 1.0
                }
            };

            slant1.Seal();
            container.AddSlant(slant1);
            //Slant slant2 = new Slant()
            //{
            //    Container = container,
            //    Position = new MeshPoint() { X = 0.0, Y = 15, Z = 24.0 },
            //    NormalVector = new MeshPoint() { X = 0.0, Y = 1.0, Z = 0.5 }
            //};
            //slant2.Seal();
            //container.AddSlant(slant2);
            //Slant slant3 = new Slant()
            //{
            //    Container = container,
            //    Position = new MeshPoint() { X = 0.0, Y = 15, Z = 24.0 },
            //    NormalVector = new MeshPoint() { X = 0.0, Y = 1.0, Z = 2.0 }
            //};
            //slant3.Seal();
            //container.AddSlant(slant3);

            // Add virtual pieces
            VirtualPiece virtualPiece1 = new VirtualPiece()
            {
                Container        = container,
                FixedOrientation = 0,
                FixedPosition    = new MeshPoint()
                {
                    X = 9.7,
                    Y = 1.0,
                    Z = 0.0
                }
            };

            virtualPiece1.AddComponent(0, 0, 0, 1.0, 7.0, 24.0);
            virtualPiece1.Seal();
            container.AddVirtualPiece(virtualPiece1);
            VirtualPiece virtualPiece2 = new VirtualPiece()
            {
                Container        = container,
                FixedOrientation = 0,
                FixedPosition    = new MeshPoint()
                {
                    X = 19.9,
                    Y = 1.0,
                    Z = 0.0
                }
            };

            virtualPiece2.AddComponent(0, 0, 0, 1.0, 7.0, 24.0);
            virtualPiece2.Seal();
            container.AddVirtualPiece(virtualPiece2);

            // Seal the container
            container.Seal();

            // Return it
            return(container);
        }
Exemplo n.º 6
0
 public string Serialize()
 {
     return(string.Format("{0},{1},{2},{3},{4},{5}|{6}|{7},{8}"
                          , Family, Slant.ToString(), Weight.ToString(), Scale, LineSpacing
                          , Color.RGBRed, Color.RGBGreen, Color.RGBBlue, Underline));
 }