Exemplo n.º 1
0
        private void loadPointLabelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (currentGeometryObject == null)
            {
                MessageBox.Show("Please load a mesh");
                return;
            }
            string path = null;

            if (!FileSelect(out path))
            {
                return;
            }
            MarkedPoints.Clear();
            MarkedLines.Clear();

            StreamReader reader = new StreamReader(path);

            colorMap = new ColorMap(currentGeometryObject.Points);

            List <double> dataset = new List <double>();

            for (int i = 0; i < colorMap.Count; i++)
            {
                try
                {
                    string line = reader.ReadLine();
                    dataset.Add(double.Parse(line));
                }
                catch
                {
                    break;
                }
            }
            colorMap.SetDataArray(dataset);
            displayMode = DisplayMode.POINTCOLORMAP;
        }
Exemplo n.º 2
0
        internal void resetFaceNormalColorMap(int tid)
        {
            if (currentGeometryObject == null)
            {
                MessageBox.Show("Please load a mesh");
                return;
            }
            List <int> tids = new List <int>();

            tids.Add(tid);
            colorMap = new ColorMap(currentGeometryObject.Triangles, tids);

            Triangle tri  = currentGeometryObject.Triangles[tid];
            XYZ      P0   = XYZ.Mean(tri.P0.XYZ, tri.P1.XYZ, tri.P2.XYZ);
            XYZ      P1   = XYZ.Add(P0, tri.Normal().Scale(0.1));
            Line     line = new Line();

            line.Add(P0);
            line.Add(P1);
            MarkedLines.Clear();
            MarkedLines.Add(line);

            displayMode = DisplayMode.FACECOLORMAP;
        }