Revision: 58432 http://sourceforge.net/p/brlcad/code/58432 Author: bob1961 Date: 2013-11-05 20:46:32 +0000 (Tue, 05 Nov 2013) Log Message: ----------- Draw data arrows/axes using pixel size instead of mm.
Modified Paths: -------------- brlcad/trunk/src/libdm/axes.c brlcad/trunk/src/libtclcad/tclcad_obj.c Modified: brlcad/trunk/src/libdm/axes.c =================================================================== --- brlcad/trunk/src/libdm/axes.c 2013-11-05 19:59:36 UTC (rev 58431) +++ brlcad/trunk/src/libdm/axes.c 2013-11-05 20:46:32 UTC (rev 58432) @@ -39,7 +39,7 @@ void dm_draw_data_axes(struct dm *dmp, - fastf_t UNUSED(viewSize), /* in mm */ + fastf_t sf, struct ged_data_axes_state *gdasp) { int i, j; @@ -74,7 +74,7 @@ #endif points = (point_t *)bu_calloc(npoints, sizeof(point_t), "data axes points"); - halfAxesSize = gdasp->gdas_size * 0.5; + halfAxesSize = gdasp->gdas_size * 0.5 * sf; /* set linewidth */ DM_SET_LINE_ATTR(dmp, gdasp->gdas_line_width, 0); /* solid lines */ Modified: brlcad/trunk/src/libtclcad/tclcad_obj.c =================================================================== --- brlcad/trunk/src/libtclcad/tclcad_obj.c 2013-11-05 19:59:36 UTC (rev 58431) +++ brlcad/trunk/src/libtclcad/tclcad_obj.c 2013-11-05 20:46:32 UTC (rev 58432) @@ -13011,7 +13011,7 @@ } -HIDDEN void go_dm_draw_arrows(struct dm *dmp, struct ged_data_arrow_state *gdasp); +HIDDEN void go_dm_draw_arrows(struct dm *dmp, struct ged_data_arrow_state *gdasp, fastf_t sf); HIDDEN void go_dm_draw_labels(struct dm *dmp, struct ged_data_label_state *gdlsp, matp_t m2vmat); HIDDEN void go_dm_draw_lines(struct dm *dmp, struct ged_data_line_state *gdlsp); HIDDEN void go_dm_draw_polys(struct dm *dmp, ged_data_polygon_state *gdpsp, int mode); @@ -13023,7 +13023,7 @@ HIDDEN void -go_dm_draw_arrows(struct dm *dmp, struct ged_data_arrow_state *gdasp) +go_dm_draw_arrows(struct dm *dmp, struct ged_data_arrow_state *gdasp, fastf_t sf) { register int i; int saveLineWidth; @@ -13062,7 +13062,7 @@ VSUB2(BmA, B, A); VUNITIZE(BmA); - VSCALE(offset, BmA, -gdasp->gdas_tip_length); + VSCALE(offset, BmA, -gdasp->gdas_tip_length * sf); bn_vec_perp(perp1, BmA); VUNITIZE(perp1); @@ -13070,8 +13070,8 @@ VCROSS(perp2, BmA, perp1); VUNITIZE(perp2); - VSCALE(perp1, perp1, gdasp->gdas_tip_width); - VSCALE(perp2, perp2, gdasp->gdas_tip_width); + VSCALE(perp1, perp1, gdasp->gdas_tip_width * sf); + VSCALE(perp2, perp2, gdasp->gdas_tip_width * sf); VADD2(a_base, B, offset); VADD2(a_pt1, a_base, perp1); @@ -13425,21 +13425,22 @@ HIDDEN void go_draw_other(struct ged_obj *gop, struct ged_dm_view *gdvp) { + fastf_t sf = gdvp->gdv_view->gv_size * gop->go_gedp->ged_wdbp->dbip->dbi_local2base / gdvp->gdv_dmp->dm_width; if (gdvp->gdv_view->gv_data_arrows.gdas_draw) - go_dm_draw_arrows(gdvp->gdv_dmp, &gdvp->gdv_view->gv_data_arrows); + go_dm_draw_arrows(gdvp->gdv_dmp, &gdvp->gdv_view->gv_data_arrows, sf); if (gdvp->gdv_view->gv_sdata_arrows.gdas_draw) - go_dm_draw_arrows(gdvp->gdv_dmp, &gdvp->gdv_view->gv_sdata_arrows); + go_dm_draw_arrows(gdvp->gdv_dmp, &gdvp->gdv_view->gv_sdata_arrows, sf); if (gdvp->gdv_view->gv_data_axes.gdas_draw) dm_draw_data_axes(gdvp->gdv_dmp, - gdvp->gdv_view->gv_size, + sf, &gdvp->gdv_view->gv_data_axes); if (gdvp->gdv_view->gv_sdata_axes.gdas_draw) dm_draw_data_axes(gdvp->gdv_dmp, - gdvp->gdv_view->gv_size, + sf, &gdvp->gdv_view->gv_sdata_axes); if (gdvp->gdv_view->gv_data_lines.gdls_draw) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits