public Mesh_PrimitiveMode(List <string> imageList)
        {
            UseFigure(imageList, "Indices");
            UseFigure(imageList, "Indices_Points");

            // There are no common properties in this model group that are reported in the readme.

            Model CreateModel(Action <List <Property>, Runtime.MeshPrimitive> setProperties)
            {
                var properties = new List <Property>();

                Runtime.MeshPrimitive meshPrimitive = MeshPrimitive.CreateSinglePlane(includeTextureCoords: false, includeIndices: false);

                // Apply the properties that are specific to this gltf.
                setProperties(properties, meshPrimitive);

                meshPrimitive.Material = new Runtime.Material
                {
                    MetallicRoughnessMaterial = new Runtime.PbrMetallicRoughness
                    {
                        MetallicFactor = 0
                    },
                };

                // Create the gltf object.
                return(new Model
                {
                    Properties = properties,
                    GLTF = CreateGLTF(() => new Runtime.Scene
                    {
                        Nodes = new List <Runtime.Node>
                        {
                            new Runtime.Node
                            {
                                Mesh = new Runtime.Mesh
                                {
                                    MeshPrimitives = new List <Runtime.MeshPrimitive>
                                    {
                                        meshPrimitive
                                    }
                                },
                            },
                        },
                    }),
                });
            }

            void SetModePoints(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                var pointPositions = new List <Vector3>();
                var cornerPoints   = new List <Vector3>
                {
                    new Vector3(0.5f, -0.5f, 0.0f),
                    new Vector3(-0.5f, -0.5f, 0.0f),
                    new Vector3(-0.5f, 0.5f, 0.0f),
                    new Vector3(0.5f, 0.3f, 0.0f),
                    new Vector3(0.5f, -0.5f, 0.0f)
                };

                for (var corner = 0; corner < 4; corner++)
                {
                    for (float x = 256; x > 0; x--)
                    {
                        Vector3 startPoint     = cornerPoints[corner];
                        Vector3 endPoint       = cornerPoints[corner + 1];
                        float   fractionOfLine = x / 256f;
                        pointPositions.Add(GetPointOnLine(startPoint, endPoint, fractionOfLine));
                    }
                }

                meshPrimitive.Mode      = ModeEnum.POINTS;
                meshPrimitive.Positions = pointPositions;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeLines(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions = new List <Vector3>
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(0.5f, 0.3f, 0.0f),
                        new Vector3(0.5f, 0.3f, 0.0f),
                        new Vector3(0.5f, -0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = ModeEnum.LINES;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeLineLoop(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions = new List <Vector3>
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.3f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = ModeEnum.LINE_LOOP;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeLineStrip(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions = new List <Vector3>
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.3f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, -0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = ModeEnum.LINE_STRIP;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeTriangleStrip(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions = new List <Vector3>
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = ModeEnum.TRIANGLE_STRIP;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeTriangleFan(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions = new List <Vector3>
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = ModeEnum.TRIANGLE_FAN;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeTriangles(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions = new List <Vector3>
                    {
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = ModeEnum.TRIANGLES;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetIndicesPoints(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                var pointsIndices = new List <int>();

                for (var x = 0; x < meshPrimitive.Positions.Count(); x++)
                {
                    pointsIndices.Add(x);
                }
                meshPrimitive.Indices = pointsIndices;
                properties.Add(new Property(PropertyName.IndicesValues, $"[0 - {meshPrimitive.Positions.Count() - 1}]"));
            }

            void SetIndicesLines(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions = GetSinglePlaneNonReversiblePositions();
                meshPrimitive.Indices   = new List <int>
                {
                    0, 3,
                    3, 2,
                    2, 1,
                    1, 0,
                };
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.ToReadmeString()));
            }

            void SetIndicesLineLoop(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions = GetSinglePlaneNonReversiblePositions();
                meshPrimitive.Indices   = new List <int>
                {
                    0, 3, 2, 1,
                };
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.ToReadmeString()));
            }

            void SetIndicesTriangleFan(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions = MeshPrimitive.GetSinglePlanePositions();
                meshPrimitive.Indices   = new List <int>
                {
                    0, 3, 2, 1,
                };
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.ToReadmeString()));
            }

            void SetIndicesLineStrip(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions = GetSinglePlaneNonReversiblePositions();
                meshPrimitive.Indices   = new List <int>
                {
                    0, 3, 2, 1, 0,
                };
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.ToReadmeString()));
            }

            void SetIndicesTriangleStrip(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions = MeshPrimitive.GetSinglePlanePositions();
                meshPrimitive.Indices   = new List <int>
                {
                    0, 3, 1, 2,
                };
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.ToReadmeString()));
            }

            void SetIndicesTriangles(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions = MeshPrimitive.GetSinglePlanePositions();
                meshPrimitive.Indices   = MeshPrimitive.GetSinglePlaneIndices();
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.ToReadmeString()));
            }

            void SetIndicesComponentTypeInt(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.IndexComponentType = IndexComponentTypeEnum.UNSIGNED_INT;
                properties.Add(new Property(PropertyName.IndicesComponentType, meshPrimitive.IndexComponentType.ToReadmeString()));
            }

            void SetIndicesComponentTypeByte(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.IndexComponentType = IndexComponentTypeEnum.UNSIGNED_BYTE;
                properties.Add(new Property(PropertyName.IndicesComponentType, meshPrimitive.IndexComponentType.ToReadmeString()));
            }

            void SetIndicesComponentTypeShort(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.IndexComponentType = IndexComponentTypeEnum.UNSIGNED_SHORT;
                properties.Add(new Property(PropertyName.IndicesComponentType, meshPrimitive.IndexComponentType.ToReadmeString()));
            }

            Models = new List <Model>
            {
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModePoints(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLines(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLineLoop(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLineStrip(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangleStrip(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangleFan(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangles(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModePoints(properties, meshPrimitive);
                    SetIndicesPoints(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLines(properties, meshPrimitive);
                    SetIndicesLines(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLineLoop(properties, meshPrimitive);
                    SetIndicesLineLoop(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLineStrip(properties, meshPrimitive);
                    SetIndicesLineStrip(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangleStrip(properties, meshPrimitive);
                    SetIndicesTriangleStrip(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangleFan(properties, meshPrimitive);
                    SetIndicesTriangleFan(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangles(properties, meshPrimitive);
                    SetIndicesTriangles(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangles(properties, meshPrimitive);
                    SetIndicesTriangles(properties, meshPrimitive);
                    SetIndicesComponentTypeByte(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangles(properties, meshPrimitive);
                    SetIndicesTriangles(properties, meshPrimitive);
                    SetIndicesComponentTypeShort(properties, meshPrimitive);
                }),
            };

            GenerateUsedPropertiesList();
        }
Exemplo n.º 2
0
        public Mesh_PrimitiveMode(List <string> imageList)
        {
            UseFigure(imageList, "Indices");
            UseFigure(imageList, "Indices_Points");

            // There are no common properties in this model group that are reported in the readme.

            Model CreateModel(Action <List <Property>, Runtime.MeshPrimitive> setProperties)
            {
                var properties = new List <Property>();

                Runtime.MeshPrimitive meshPrimitive = MeshPrimitive.CreateSinglePlane(includeTextureCoords: false, includeIndices: false);

                // Apply the properties that are specific to this gltf.
                setProperties(properties, meshPrimitive);

                meshPrimitive.Material = new Runtime.Material
                {
                    PbrMetallicRoughness = new PbrMetallicRoughness
                    {
                        MetallicFactor = 0
                    },
                };

                // Create the gltf object.
                return(new Model
                {
                    Properties = properties,
                    GLTF = CreateGLTF(() => new Scene
                    {
                        Nodes = new List <Node>
                        {
                            new Node
                            {
                                Mesh = new Runtime.Mesh
                                {
                                    MeshPrimitives = new List <Runtime.MeshPrimitive>
                                    {
                                        meshPrimitive
                                    }
                                },
                            },
                        },
                    }),
                });
            }

            void SetModePoints(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                var pointPositions = new List <Vector3>();
                var cornerPoints   = new[]
                {
                    new Vector3(0.5f, -0.5f, 0.0f),
                    new Vector3(-0.5f, -0.5f, 0.0f),
                    new Vector3(-0.5f, 0.5f, 0.0f),
                    new Vector3(0.5f, 0.3f, 0.0f),
                    new Vector3(0.5f, -0.5f, 0.0f)
                };

                for (var corner = 0; corner < 4; corner++)
                {
                    for (float x = 256; x > 0; x--)
                    {
                        Vector3 startPoint     = cornerPoints[corner];
                        Vector3 endPoint       = cornerPoints[corner + 1];
                        float   fractionOfLine = x / 256f;
                        pointPositions.Add(GetPointOnLine(startPoint, endPoint, fractionOfLine));
                    }
                }

                meshPrimitive.Mode      = MeshPrimitiveMode.Points;
                meshPrimitive.Positions = Data.Create(pointPositions);
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeLines(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions.Values = new[]
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(0.5f, 0.3f, 0.0f),
                        new Vector3(0.5f, 0.3f, 0.0f),
                        new Vector3(0.5f, -0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = MeshPrimitiveMode.Lines;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeLineLoop(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions.Values = new[]
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.3f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = MeshPrimitiveMode.LineLoop;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeLineStrip(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions.Values = new[]
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.3f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, -0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = MeshPrimitiveMode.LineStrip;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeTriangleStrip(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions.Values = new[]
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = MeshPrimitiveMode.TriangleStrip;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeTriangleFan(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions.Values = new[]
                    {
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = MeshPrimitiveMode.TriangleFan;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetModeTriangles(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                if (meshPrimitive.Indices == null)
                {
                    meshPrimitive.Positions.Values = new[]
                    {
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, -0.5f, 0.0f),
                        new Vector3(0.5f, 0.5f, 0.0f),
                        new Vector3(-0.5f, 0.5f, 0.0f),
                    };
                }
                meshPrimitive.Mode = MeshPrimitiveMode.Triangles;
                properties.Add(new Property(PropertyName.Mode, meshPrimitive.Mode.ToReadmeString()));
            }

            void SetIndicesPoints(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                var indices = new List <int>();
                var count   = meshPrimitive.Positions.Values.Count();

                for (int index = 0; index < count; index++)
                {
                    indices.Add(index);
                }
                meshPrimitive.Indices = Data.Create(indices);
                properties.Add(new Property(PropertyName.IndicesValues, $"[0 - {count - 1}]"));
            }

            void SetIndicesLines(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions.Values = GetSinglePlaneNonReversiblePositions();
                meshPrimitive.Indices          = Data.Create(new[]
                {
                    0, 3,
                    3, 2,
                    2, 1,
                    1, 0,
                });
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.Values.ToReadmeString()));
            }

            void SetIndicesLineLoop(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions.Values = GetSinglePlaneNonReversiblePositions();
                meshPrimitive.Indices          = Data.Create(new[] { 0, 3, 2, 1 });
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.Values.ToReadmeString()));
            }

            void SetIndicesTriangleFan(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions = Data.Create(MeshPrimitive.GetSinglePlanePositions());
                meshPrimitive.Indices   = Data.Create(new[] { 0, 3, 2, 1 });
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.Values.ToReadmeString()));
            }

            void SetIndicesLineStrip(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions.Values = GetSinglePlaneNonReversiblePositions();
                meshPrimitive.Indices          = Data.Create(new[] { 0, 3, 2, 1, 0 });
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.Values.ToReadmeString()));
            }

            void SetIndicesTriangleStrip(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions = Data.Create(MeshPrimitive.GetSinglePlanePositions());
                meshPrimitive.Indices   = Data.Create(new[] { 0, 3, 1, 2 });
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.Values.ToReadmeString()));
            }

            void SetIndicesTriangles(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Positions = Data.Create(MeshPrimitive.GetSinglePlanePositions());
                meshPrimitive.Indices   = Data.Create(MeshPrimitive.GetSinglePlaneIndices());
                properties.Add(new Property(PropertyName.IndicesValues, meshPrimitive.Indices.Values.ToReadmeString()));
            }

            void SetIndicesComponentTypeInt(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Indices.OutputType = DataType.UnsignedInt;
                properties.Add(new Property(PropertyName.IndicesComponentType, meshPrimitive.Indices.OutputType.ToReadmeString()));
            }

            void SetIndicesComponentTypeByte(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Indices.OutputType = DataType.UnsignedByte;
                properties.Add(new Property(PropertyName.IndicesComponentType, meshPrimitive.Indices.OutputType.ToReadmeString()));
            }

            void SetIndicesComponentTypeShort(List <Property> properties, Runtime.MeshPrimitive meshPrimitive)
            {
                meshPrimitive.Indices.OutputType = DataType.UnsignedShort;
                properties.Add(new Property(PropertyName.IndicesComponentType, meshPrimitive.Indices.OutputType.ToReadmeString()));
            }

            Models = new List <Model>
            {
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModePoints(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLines(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLineLoop(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLineStrip(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangleStrip(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangleFan(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangles(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModePoints(properties, meshPrimitive);
                    SetIndicesPoints(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLines(properties, meshPrimitive);
                    SetIndicesLines(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLineLoop(properties, meshPrimitive);
                    SetIndicesLineLoop(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeLineStrip(properties, meshPrimitive);
                    SetIndicesLineStrip(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangleStrip(properties, meshPrimitive);
                    SetIndicesTriangleStrip(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangleFan(properties, meshPrimitive);
                    SetIndicesTriangleFan(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangles(properties, meshPrimitive);
                    SetIndicesTriangles(properties, meshPrimitive);
                    SetIndicesComponentTypeInt(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangles(properties, meshPrimitive);
                    SetIndicesTriangles(properties, meshPrimitive);
                    SetIndicesComponentTypeByte(properties, meshPrimitive);
                }),
                CreateModel((properties, meshPrimitive) =>
                {
                    SetModeTriangles(properties, meshPrimitive);
                    SetIndicesTriangles(properties, meshPrimitive);
                    SetIndicesComponentTypeShort(properties, meshPrimitive);
                }),
            };

            GenerateUsedPropertiesList();
        }