Lines Matching defs:grid

24 # include <gtkmm/grid.h>
37 #include "display/canvas-grid.h"
236 // Legacy grid not in 'user units'
249 // Legacy grid not in 'user units'
262 // Legacy grid not in 'user units'
321 gridunit = unit_table.getUnit(value); // Display unit identifier in grid menu
359 _("_Origin X:"), _("X coordinate of grid origin"), "originx",
362 _("O_rigin Y:"), _("Y coordinate of grid origin"), "originy",
374 _("Minor grid line _color:"), _("Minor grid line color"), _("Color of the minor grid lines"),
379 _("Ma_jor grid line color:"), _("Major grid line color"),
380 _("Color of the major (highlighted) grid lines"),
384 _("_Major grid line every:"), "", _("lines"), "empspacing", _wr, repr, doc ) );
538 // gc = gridcoordinates (the coordinates calculated from the grids origin 'grid->ow'.
651 CanvasAxonomGridSnapper::CanvasAxonomGridSnapper(CanvasAxonomGrid *grid, SnapManager *sm, Geom::Coord const d) : LineSnapper(sm, d)
653 this->grid = grid;
676 if ( grid == NULL ) {
684 // Only snapping to visible grid lines
685 spacing_h = grid->spacing_ylines; // this is the spacing of the visible grid lines measured in screen pixels
686 spacing_v = grid->lyw; // vertical
695 // Snapping to any grid line, whether it's visible or not
696 spacing_h = grid->lengthy /(grid->tan_angle[X] + grid->tan_angle[Z]);
697 spacing_v = grid->lengthy;
701 // In an axonometric grid, any point will be surrounded by 6 grid lines:
702 // - 2 vertical grid lines, one left and one right from the point
703 // - 2 angled z grid lines, one above and one below the point
704 // - 2 angled x grid lines, one above and one below the point
706 // Calculate the x coordinate of the vertical grid lines
707 Geom::Coord x_max = Inkscape::Util::round_to_upper_multiple_plus(p[Geom::X], spacing_h, grid->origin[Geom::X]);
708 Geom::Coord x_min = Inkscape::Util::round_to_lower_multiple_plus(p[Geom::X], spacing_h, grid->origin[Geom::X]);
710 // Calculate the y coordinate of the intersection of the angled grid lines with the y-axis
711 double y_proj_along_z = p[Geom::Y] - grid->tan_angle[Z]*(p[Geom::X] - grid->origin[Geom::X]);
712 double y_proj_along_x = p[Geom::Y] + grid->tan_angle[X]*(p[Geom::X] - grid->origin[Geom::X]);
713 double y_proj_along_z_max = Inkscape::Util::round_to_upper_multiple_plus(y_proj_along_z, spacing_v, grid->origin[Geom::Y]);
714 double y_proj_along_z_min = Inkscape::Util::round_to_lower_multiple_plus(y_proj_along_z, spacing_v, grid->origin[Geom::Y]);
715 double y_proj_along_x_max = Inkscape::Util::round_to_upper_multiple_plus(y_proj_along_x, spacing_v, grid->origin[Geom::Y]);
716 double y_proj_along_x_min = Inkscape::Util::round_to_lower_multiple_plus(y_proj_along_x, spacing_v, grid->origin[Geom::Y]);
718 // Calculate the versor for the angled grid lines
719 Geom::Point vers_x = Geom::Point(1, -grid->tan_angle[X]);
720 Geom::Point vers_z = Geom::Point(1, grid->tan_angle[Z]);
722 // Calculate the normal for the angled grid lines
726 // The four angled grid lines form a parallelogram, enclosing the point
727 // One of the two vertical grid lines divides this parallelogram in two triangles
729 // only the three grid lines defining that triangle
731 // The vertical grid line is at the intersection of two angled grid lines.
755 use_left_half = (p[Geom::X] - grid->origin[Geom::X]) < inters_pt[Geom::X];
759 // Return the three grid lines which define the triangle that encloses our point
760 // If we didn't find an intersection above, all 6 grid lines will be returned
762 s.push_back(std::make_pair(norm_z, Geom::Point(grid->origin[Geom::X], y_proj_along_z_max)));
763 s.push_back(std::make_pair(norm_x, Geom::Point(grid->origin[Geom::X], y_proj_along_x_min)));
768 s.push_back(std::make_pair(norm_z, Geom::Point(grid->origin[Geom::X], y_proj_along_z_min)));
769 s.push_back(std::make_pair(norm_x, Geom::Point(grid->origin[Geom::X], y_proj_along_x_max)));