Exemplo n.º 1
0
        protected override void DeserializeFemaleStudModel(FemaleStudModel femaleStudModel, XElement element)
        {
            DeserializePartCullingModel(femaleStudModel, element);

            if (element.HasElement(nameof(FemaleStudModel.ReplacementMeshes), out XElement geomElem))
            {
                foreach (var elem in geomElem.Elements(ModelMeshReference.NODE_NAME))
                {
                    var mesh = new ModelMeshReference();
                    mesh.LoadFromXml(elem);
                    femaleStudModel.ReplacementMeshes.Add(mesh);
                }
            }
        }
Exemplo n.º 2
0
        public override SurfaceComponent DeserializeSurfaceComponent(XElement element)
        {
            SurfaceComponent component = null;
            var componentType          = element.ReadAttribute <ModelComponentType>("Type");

            switch (componentType)
            {
            case ModelComponentType.Part:
                component = new PartModel();
                DeserializePartModel(component as PartModel, element);
                break;

            case ModelComponentType.MaleStud:
                component = new MaleStudModel();
                DeserializeMaleStudModel(component as MaleStudModel, element);
                break;

            case ModelComponentType.FemaleStud:
                component = new FemaleStudModel();
                DeserializeFemaleStudModel(component as FemaleStudModel, element);
                break;

            case ModelComponentType.BrickTube:
                component = new BrickTubeModel();
                DeserializeBrickTubeModel(component as BrickTubeModel, element);
                break;
            }

            if (element.HasElement(nameof(SurfaceComponent.Meshes), out XElement geomElem))
            {
                foreach (var elem in geomElem.Elements(ModelMeshReference.NODE_NAME))
                {
                    var mesh = new ModelMeshReference();
                    mesh.LoadFromXml(elem);
                    component.Meshes.Add(mesh);
                }
            }

            return(component);
        }
Exemplo n.º 3
0
 protected abstract void DeserializeFemaleStudModel(FemaleStudModel femaleStudModel, XElement element);