Esempio n. 1
0
        //------------------------------------------------------------------------------
        public void SimpleModelData(string[] surfacedata5)
        {
            surfacedata5[0] = "Models " + _Models.Count;

            int cyl = 0, sph = 0, ple = 0, cne = 0;

            foreach (ModelBase m1 in _Models)
            {
                if (m1.type() == ModelCylinder.stype())
                {
                    cyl++;
                }
                else if (m1.type() == ModelSphere.stype())
                {
                    sph++;
                }
                else if (m1.type() == ModelCone.stype())
                {
                    cne++;
                }
                else if (m1.type() == ModelPlane.stype())
                {
                    ple++;
                }
            }

            surfacedata5[1] = ModelPlane.stype() + ":" + ple;
            surfacedata5[2] = ModelSphere.stype() + ":" + sph;
            surfacedata5[3] = ModelCylinder.stype() + ":" + cyl;
            surfacedata5[4] = ModelCone.stype() + ":" + cne;
        }
Esempio n. 2
0
        //------------------------------------------------------------------------------
        public void ModelData(out string[] surfacedata, ref int id)
        {
            ModelBase m = null;

            m = getModelID(id);
            if (m != null)
            {
                m.ModelData(out surfacedata);
                id = m.ID;
            }
            else
            {
                surfacedata    = new string[5];
                surfacedata[0] = "Models " + _Models.Count;

                int cyl = 0, sph = 0, ple = 0, cne = 0;
                foreach (ModelBase m1 in _Models)
                {
                    if (m1.type() == ModelCylinder.stype())
                    {
                        cyl++;
                    }
                    else if (m1.type() == ModelSphere.stype())
                    {
                        sph++;
                    }
                    else if (m1.type() == ModelCone.stype())
                    {
                        cne++;
                    }
                    else if (m1.type() == ModelPlane.stype())
                    {
                        ple++;
                    }
                }

                surfacedata[1] = ModelPlane.stype() + ":" + ple;
                surfacedata[2] = ModelSphere.stype() + ":" + sph;
                surfacedata[3] = ModelCylinder.stype() + ":" + cyl;
                surfacedata[4] = ModelCone.stype() + ":" + cne;
                id             = 0;
            }
        }