Exemple #1
0
        public void DisplayAllClusters(bool compute = true, bool updateKeys = true)
        {
            var modelGroup = new Model3DGroup();

            if (compute)
            {
                BatchDesign.GenerateLoadsClustering();
            }
            List <List <MWPoint3D> > clusters = BatchDesign.Clusters;

            List <Color> colors = GetColors();

            for (int i = 0; i < clusters.Count; i++)
            {
                var pointMesh = new MeshBuilder(false, true);
                foreach (var p in clusters[i])
                {
                    Point3D center = new Point3D(10 * p.X / batchDesign.MaxMx, 10 * p.Y / batchDesign.MaxMy, 10 * p.Z / batchDesign.MaxP);
                    pointMesh.AddSphere(center, radius: 0.05, thetaDiv: 8, phiDiv: 4);
                }
                var mesh0 = new GeometryModel3D(pointMesh.ToMesh(), MaterialHelper.CreateMaterial(colors[i]));
                mesh0.BackMaterial = mesh0.Material;
                modelGroup.Children.Add(mesh0);
            }

            LoadsCloud = modelGroup;
            DisplayAllColumnsClusters(updateKeys);
        }