// convert the 3D scatter plot into a array of Mesh3D object public ArrayList GetMeshes() { int nDotNo = GetDataNo(); if (nDotNo == 0) { return(null); } ArrayList meshs = new ArrayList(); int nVertIndex = 0; for (int i = 0; i < nDotNo; i++) { ScatterPlotItem plotItem = Get(i); int nType = plotItem.shape % Chart3D.SHAPE_NO; float w = plotItem.w; float h = plotItem.h; Mesh3D dot; m_vertices[i].nMinI = nVertIndex; switch (nType) { case (int)SHAPE.BAR: dot = new Bar3D(0, 0, 0, w, w, h); break; case (int)SHAPE.CONE: dot = new Cone3D(w, w, h, 7); break; case (int)SHAPE.CYLINDER: dot = new Cylinder3D(w, w, h, 7); break; case (int)SHAPE.ELLIPSE: dot = new Ellipse3D(w, w, h, 7); break; case (int)SHAPE.PYRAMID: dot = new Pyramid3D(w, w, h); break; default: dot = new Bar3D(0, 0, 0, w, w, h); break; } nVertIndex += dot.GetVertexNo(); m_vertices[i].nMaxI = nVertIndex - 1; TransformMatrix.Transform(dot, new Point3D(plotItem.x, plotItem.y, plotItem.z), plotItem.type, plotItem.rotmatrix); dot.SetColor(plotItem.color); meshs.Add(dot); } AddAxesMeshes(meshs); return(meshs); }
// convert the 3D scatter plot into a array of Mesh3D object public ArrayList GetMeshes() { int nDotNo = GetDataNo(); if (nDotNo == 0) return null; ArrayList meshs = new ArrayList(); int nVertIndex = 0; for (int i = 0; i < nDotNo; i++) { ScatterPlotItem plotItem = Get(i); int nType = plotItem.shape % Chart3D.SHAPE_NO; float w = plotItem.w; float h = plotItem.h; Mesh3D dot; m_vertices[i].nMinI = nVertIndex; switch (nType) { case (int)SHAPE.BAR: dot = new Bar3D(0, 0, 0, w, w, h); break; case (int)SHAPE.CONE: dot = new Cone3D(w, w, h, 7); break; case (int)SHAPE.CYLINDER: dot = new Cylinder3D(w, w, h, 7); break; case (int)SHAPE.ELLIPSE: dot = new Ellipse3D(w, w, h, 7); break; case (int)SHAPE.PYRAMID: dot = new Pyramid3D(w, w, h); break; default: dot = new Bar3D(0, 0, 0, w, w, h); break; } nVertIndex += dot.GetVertexNo(); m_vertices[i].nMaxI = nVertIndex - 1; TransformMatrix.Transform(dot, new Point3D(plotItem.x, plotItem.y, plotItem.z), 0, 0); dot.SetColor(plotItem.color); meshs.Add(dot); } AddAxesMeshes(meshs); return meshs; }
// convert the 3D scatter plot into a array of Mesh3D object public ArrayList GetMeshes() { var nDotNo = GetDataNo(); if (nDotNo == 0) { return(null); } var meshs = new ArrayList(); var nVertIndex = 0; for (var i = 0; i < nDotNo; i++) { var plotItem = Get(i); if (plotItem == null) { continue; } var nType = plotItem.shape % ShapeNo; var w = plotItem.w; var h = plotItem.h; Mesh3D dot; MVertices[i].nMinI = nVertIndex; switch (nType) { case (int)Shape.Bar: dot = new Bar3D(0, 0, 0, w, w, h); break; case (int)Shape.Cone: dot = new Cone3D(w, w, h, 7); break; case (int)Shape.Cylinder: dot = new Cylinder3D(w, w, h, 7); break; case (int)Shape.Ellipse: dot = new Ellipse3D(w, w, h, 7); break; case (int)Shape.Pyramid: dot = new Pyramid3D(w, w, h); break; default: dot = new Bar3D(0, 0, 0, w, w, h); break; } nVertIndex += dot.GetVertexNo(); MVertices[i].nMaxI = nVertIndex - 1; TransformMatrix.Transform(dot, new Point3D(plotItem.x, plotItem.y, plotItem.z), 0, 0); dot.SetColor(plotItem.color); meshs.Add(dot); } AddAxesMeshes(meshs); return(meshs); }