public void plot_line_shadow() { try { GL.glPushMatrix(); // NEW: Prepare Dynamic Transform #region plot something GLU.glPointSize(10); GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(p_tags.x, p_tags.y, p_tags.z); GLU.glEnd(); #endregion plot something GL.glPopMatrix(); // NEW: Unapply Dynamic Transform GL.glFlush(); // Flush the GL Rendering Pipeline this.Invalidate(); } catch (Exception e) { return; } }
private void display() { util u1 = new util(); //po_tag if (p_tags != null) { GLU.glPointSize(5); GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(p_tags.x, p_tags.y, p_tags.z); GLU.glEnd(); Node <LINE> ln_tags = p_tags.ll.Head; while (ln_tags != null) { GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(ln_tags.Data.p1.x, ln_tags.Data.p1.y, ln_tags.Data.p1.z); GLU.glVertex3f(ln_tags.Data.p2.x, ln_tags.Data.p2.y, ln_tags.Data.p2.z); GLU.glEnd(); ln_tags = ln_tags.Next; } } Node <PO> nt = pl.Head; //StreamWriter sw = new StreamWriter("e:/e.txt",true); GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_LINE_LOOP); GLU.glVertex3f(0, 0, 0); GLU.glVertex3f(0, 2, 0); GLU.glVertex3f(2, 0, 0); GLU.glEnd(); GLU.glPointSize(3); GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(0, 0, 0); GLU.glVertex3f(0, 1, 0); GLU.glEnd(); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(0, 0, 0); GLU.glVertex3f(1, 0, 0); GLU.glEnd(); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(0, 0, 0); GLU.glVertex3f(0, 0, 1); GLU.glEnd(); while (nt != null) { GLU.glPointSize(3); GLU.glColor3f(0.0f, 1.0f, 1.0f); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(nt.Data.x, nt.Data.y, nt.Data.z); GLU.glEnd(); //sw.WriteLine("({0},{1},{2})", nt.Data.x, nt.Data.y, nt.Data.z); nt = nt.Next; } Node <LINE> ln = ll.Head; while (ln != null) { GLU.glColor3f(0.0f, 1.0f, 1.0f); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(ln.Data.p1.x, ln.Data.p1.y, ln.Data.p1.z); GLU.glVertex3f(ln.Data.p2.x, ln.Data.p2.y, ln.Data.p2.z); GLU.glEnd(); ln = ln.Next; } if (s_tag != null) { GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_LINE_LOOP); GLU.glVertex3f(s_tag.p1.x, s_tag.p1.y, s_tag.p1.z); GLU.glVertex3f(s_tag.p2.x, s_tag.p2.y, s_tag.p2.z); GLU.glVertex3f(s_tag.p3.x, s_tag.p3.y, s_tag.p3.z); GLU.glEnd(); } Node <SURFACE> sn = sl_tag.Head; while (sn != null) { GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_LINE_LOOP); GLU.glVertex3f(sn.Data.p1.x, sn.Data.p1.y, sn.Data.p1.z); GLU.glVertex3f(sn.Data.p2.x, sn.Data.p2.y, sn.Data.p2.z); GLU.glVertex3f(sn.Data.p3.x, sn.Data.p3.y, sn.Data.p3.z); GLU.glEnd(); sn = sn.Next; } if (l_tag != null) { GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(l_tag.p1.x, l_tag.p1.y, l_tag.p1.z); GLU.glVertex3f(l_tag.p2.x, l_tag.p2.y, l_tag.p2.z); GLU.glEnd(); } }
private void display() { util u1 = new util(); #region yuandian GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glPointSize(10); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(0, 0, 0); GLU.glEnd(); //GLU.glPointSize(3); //GLU.glColor3f(1.0f, 0.0f, 0.0f); //GLU.glBegin(GLU.GL_LINES); //GLU.glVertex3f(0, 0, 0); //GLU.glVertex3f(0, 1, 0); //GLU.glEnd(); //GLU.glBegin(GLU.GL_LINES); //GLU.glVertex3f(0, 0, 0); //GLU.glVertex3f(1, 0, 0); //GLU.glEnd(); //GLU.glBegin(GLU.GL_LINES); //GLU.glVertex3f(0, 0, 0); //GLU.glVertex3f(0, 0, 1); //GLU.glEnd(); #endregion yuandian #region po_tags if (p_tags != null) { if (p_tags.key == 1) { GLU.glPointSize(10); GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(p_tags.x, p_tags.y, p_tags.z); GLU.glEnd(); } else { GLU.glPointSize(10); GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(p_tags.x, p_tags.y, p_tags.z); GLU.glEnd(); } } #endregion p_tags #region pl Node <PO> nt = pl.Head; while (nt != null && SHOW_ORDINARY_POINT) { if (nt.Data.key == 5) { GLU.glPointSize(5); GLU.glColor3f(0.0f, 0.0f, 1.0f); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(nt.Data.x, nt.Data.y, nt.Data.z); GLU.glEnd(); } else { GLU.glPointSize(3); GLU.glColor3f(0.0f, 1.0f, 1.0f); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(nt.Data.x, nt.Data.y, nt.Data.z); GLU.glEnd(); } nt = nt.Next; } nt = pl_tag.Head; while (nt != null && SHOW_EDIT_MODEL) { GLU.glPointSize(6); GLU.glColor3f(0.0f, 0.4f, 1.0f); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(nt.Data.x, nt.Data.y, nt.Data.z); GLU.glEnd(); nt = nt.Next; } nt = model_special_pl.Head; while (nt != null && SHOW_EDIT_MODEL) { GLU.glPointSize(10); GLU.glColor3f(1.0f, 1.0f, 0.0f); GLU.glBegin(GLU.GL_POINTS); GLU.glVertex3f(nt.Data.x, nt.Data.y, nt.Data.z); GLU.glEnd(); nt = nt.Next; } #endregion pl #region ll Node <LINE> ln = ll.Head; while (ln != null && SHOW_ORDINARY_LL) { GLU.glColor3f(0.0f, 1.0f, 1.0f); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(ln.Data.p1.x, ln.Data.p1.y, ln.Data.p1.z); GLU.glVertex3f(ln.Data.p2.x, ln.Data.p2.y, ln.Data.p2.z); GLU.glEnd(); ln = ln.Next; } ln = ll_triangle.Head; while (ln != null && SHOW_TRIANGLE) { GLU.glColor3f(0.0f, 1.0f, 1.0f); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(ln.Data.p1.x, ln.Data.p1.y, ln.Data.p1.z); GLU.glVertex3f(ln.Data.p2.x, ln.Data.p2.y, ln.Data.p2.z); GLU.glEnd(); ln = ln.Next; } ln = model_boundary_ll.Head;//模型的边界 while (ln != null && SHOW_MODEL_BOUNDARY_CONTROL) { GLU.glColor3f(1.0f, 0.9f, 0.0f); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(ln.Data.p1.x, ln.Data.p1.y, ln.Data.p1.z); GLU.glVertex3f(ln.Data.p2.x, ln.Data.p2.y, ln.Data.p2.z); GLU.glEnd(); ln = ln.Next; } ln = ll_pebi.Head; while (ln != null && SHOW_PEBI) { if (ln.Data.Length() > 20) { GLU.glColor3f(1.0f, 1.0f, 0.0f); } else { GLU.glColor3f(1.0f, 0.0f, 0.0f); } GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(ln.Data.p1.x, ln.Data.p1.y, ln.Data.p1.z); GLU.glVertex3f(ln.Data.p2.x, ln.Data.p2.y, ln.Data.p2.z); GLU.glEnd(); ln = ln.Next; } ln = ll_tag.Head; while (ln != null && SHOW_EDIT_MODEL) { if (ln.Data.Length() > 20) { GLU.glColor3f(1.0f, 0.0f, 1.0f); } else { GLU.glColor3f(1.0f, 0.0f, 0.0f); } GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(ln.Data.p1.x, ln.Data.p1.y, ln.Data.p1.z); GLU.glVertex3f(ln.Data.p2.x, ln.Data.p2.y, ln.Data.p2.z); GLU.glEnd(); ln = ln.Next; } #endregion ll #region sl Node <SURFACE> sn = sl_tag.Head; while (sn != null) { GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_LINE_LOOP); GLU.glVertex3f(sn.Data.p1.x, sn.Data.p1.y, sn.Data.p1.z); GLU.glVertex3f(sn.Data.p2.x, sn.Data.p2.y, sn.Data.p2.z); GLU.glVertex3f(sn.Data.p3.x, sn.Data.p3.y, sn.Data.p3.z); GLU.glEnd(); sn = sn.Next; } if (l_tag != null) { GLU.glColor3f(1.0f, 0.0f, 0.0f); GLU.glBegin(GLU.GL_LINES); GLU.glVertex3f(l_tag.p1.x, l_tag.p1.y, l_tag.p1.z); GLU.glVertex3f(l_tag.p2.x, l_tag.p2.y, l_tag.p2.z); GLU.glEnd(); } #endregion sl }