int draw_outline(void) { int raster_size; row = col = top = 0; /* get started for read of first */ bottom = 1; /* line from raster map */ scan_length = read_next(); k = 0; raster_size = Rast_cell_size(map_type); while (read_next()) { /* read rest of file, one row at *//* a time */ n1 = Rast_row_to_northing((double)row - 1., &(PS.w)); n2 = Rast_row_to_northing((double)row, &(PS.w)); n3 = Rast_row_to_northing((double)row + 1., &(PS.w)); for (col = 0; col < scan_length - 1; col++) { e1 = Rast_col_to_easting((double)col - 1., &(PS.w)); e2 = Rast_col_to_easting((double)col, &(PS.w)); e3 = Rast_col_to_easting((double)col + 1., &(PS.w)); tl = G_incr_void_ptr(buffer[top], col * raster_size); /* top left in window */ tr = G_incr_void_ptr(buffer[top], (col + 1) * raster_size); /* top right in window */ bl = G_incr_void_ptr(buffer[bottom], col * raster_size); /* bottom left in window */ br = G_incr_void_ptr(buffer[bottom], (col + 1) * raster_size); /* bottom right in window */ draw_boundaries(); if (k == 3) k = 0; } row++; } return 0; } /* draw_outlines */
void Button::draw_focus() { STACKTRACE; if (!draw(bmp_focus)) { draw_default(); draw_boundaries(bmp_default); } }
void TriMeshView::draw_mesh() { // These are static so the memory isn't reallocated on every frame static vector<float> ndotv, kr; static vector<float> sctest_num, sctest_den, shtest_num; static vector<float> q1, Dt1q1; static vector<vec2> t1; compute_perview(ndotv, kr, sctest_num, sctest_den, shtest_num, q1, t1, Dt1q1, true); // compute_perview(ndotv, kr); // Enable antialiased lines glEnable(GL_POINT_SMOOTH); glEnable(GL_LINE_SMOOTH); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // 外部轮廓,仅使用ndotv,不做其它测试 if (isDrawSilhouette) draw_silhouette(ndotv); // The mesh itself, possibly colored and/or lit glDisable(GL_BLEND); draw_base_mesh(); glEnable(GL_BLEND); if(isDrawRVFaces) rv_fLines.drawFaces(triMesh, vec4(0.0f, 0.8f, 0.0f, 1.0f)); if(isDrawRVLines) rv_fLines.drawLines(); if(isDrawOCFaces) c_fLines.drawFaces(triMesh, vec4(0.7f, 0.5f, 0.5f, 1.0f)); if(isDrawOCLines) c_fLines.drawLines(); if(isDrawApparentRidges) draw_apparent_ridges(ndotv, q1, t1, Dt1q1, ar_thresh / sqr(feature_size)); if(isDrawOccludingContours) draw_occluding_contours(ndotv, kr); if(isDrawSuggestiveContours) draw_suggestive_contours(ndotv, kr, sctest_num, sctest_den); if(isDrawRidges) draw_ridges(ndotv, rv_thresh / feature_size); if(isDrawValleys) draw_valleys(ndotv, rv_thresh / feature_size); if(isDrawBoundaries) draw_boundaries(false); glDisable(GL_LINE_SMOOTH); glDisable(GL_POINT_SMOOTH); glDisable(GL_BLEND); glDepthMask(GL_TRUE); }