pcb 4.1.1
An interactive printed circuit board layout editor.
|
#include "global.h"
#include "hid.h"
#include "hid_draw.h"
#include "data.h"
#include "rotate.h"
#include "polygon.h"
#include "draw_helpers.h"
Go to the source code of this file.
Data Structures | |
struct | FloatPolyType |
Defines | |
#define | BOUNDS_INSIDE_CLIP_THRESHOLD 0.5 |
Functions | |
void | common_draw_pcb_line (hidGC gc, LineType *line) |
void | common_draw_pcb_arc (hidGC gc, ArcType *arc) |
static void | common_draw_pcb_text (hidGC gc, TextType *Text, Coord min_line_width) |
static void | fill_contour (hidGC gc, PLINE *pl) |
static void | thindraw_contour (hidGC gc, PLINE *pl) |
static void | fill_contour_cb (PLINE *pl, void *user_data) |
static void | fill_clipped_contour (hidGC gc, PLINE *pl, const BoxType *clip_box) |
static int | should_compute_no_holes (PolygonType *poly, const BoxType *clip_box) |
void | common_gui_draw_pcb_polygon (hidGC gc, PolygonType *polygon, const BoxType *clip_box) |
void | common_fill_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box) |
static int | thindraw_hole_cb (PLINE *pl, void *user_data) |
void | common_thindraw_pcb_polygon (hidGC gc, PolygonType *poly, const BoxType *clip_box) |
void | common_thindraw_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask) |
static void | common_get_pad_polygon (Coord x[4], Coord y[4], const PadType *l, int w) |
void | common_fill_pcb_pad (hidGC gc, PadType *pad, bool clear, bool mask) |
static void | draw_octagon_poly (hidGC gc, Coord X, Coord Y, Coord Thickness, bool thin_draw) |
void | common_fill_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool mask) |
void | common_thindraw_pcb_pv (hidGC fg_gc, hidGC bg_gc, PinType *pv, bool drawHole, bool mask) |
void | common_draw_helpers_init (HID_DRAW *graphics) |
#define BOUNDS_INSIDE_CLIP_THRESHOLD 0.5 |
Definition at line 226 of file draw_helpers.c.
Referenced by should_compute_no_holes().
void common_draw_helpers_init | ( | HID_DRAW * | graphics | ) |
Definition at line 691 of file draw_helpers.c.
References common_draw_pcb_arc(), common_draw_pcb_line(), common_draw_pcb_text(), common_fill_pcb_pad(), common_fill_pcb_polygon(), common_fill_pcb_pv(), common_thindraw_pcb_pad(), common_thindraw_pcb_polygon(), common_thindraw_pcb_pv(), hid_draw_st::draw_pcb_arc, hid_draw_st::draw_pcb_line, hid_draw_st::draw_pcb_polygon, hid_draw_st::draw_pcb_text, hid_draw_st::fill_pcb_pad, hid_draw_st::fill_pcb_polygon, hid_draw_st::fill_pcb_pv, hid_draw_st::thindraw_pcb_pad, hid_draw_st::thindraw_pcb_polygon, and hid_draw_st::thindraw_pcb_pv.
Referenced by hid_batch_init(), hid_eps_init(), hid_extents_init(), hid_gcode_init(), hid_gerber_init(), hid_gsvit_init(), hid_lesstif_init(), hid_nelma_init(), hid_png_init(), hid_ps_init(), and REGISTER_FLAGS().
Definition at line 25 of file draw_helpers.c.
References ArcType::Delta, hid_draw_st::draw_arc, hid_st::graphics, gui, ArcType::Height, PCB, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, ArcType::StartAngle, TEST_FLAG, ArcType::Thickness, Trace_Cap, ArcType::Width, ArcType::X, and ArcType::Y.
Referenced by common_draw_helpers_init(), and gsvit_draw_pcb_arc().
Definition at line 11 of file draw_helpers.c.
References hid_draw_st::draw_line, hid_st::graphics, gui, PCB, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, TEST_FLAG, and Trace_Cap.
Referenced by common_draw_helpers_init(), and gsvit_draw_pcb_line().
Definition at line 43 of file draw_helpers.c.
References FontType::DefaultSymbol, TextType::Direction, hid_draw_st::draw_pcb_line, hid_draw_st::fill_rect, PCBType::Font, hid_st::graphics, gui, line, n, PCB, RotateBoxLowLevel(), RotateLineLowLevel(), TextType::Scale, SCALE_TEXT, SWAP_SIGN_X, SWAP_SIGN_Y, Symbol, TEST_FLAG, TextType::TextString, TextType::X, x, BoxType::X1, BoxType::X2, TextType::Y, BoxType::Y1, and BoxType::Y2.
Referenced by common_draw_helpers_init().
Definition at line 482 of file draw_helpers.c.
References common_get_pad_polygon(), hid_draw_st::draw_line, hid_draw_st::fill_circle, hid_draw_st::fill_polygon, hid_draw_st::fill_rect, hid_st::graphics, gui, pad_st::Mask, Round_Cap, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, Square_Cap, TEST_FLAG, x, and y.
Referenced by common_draw_helpers_init(), and gsvit_fill_pcb_pad().
void common_fill_pcb_polygon | ( | hidGC | gc, |
PolygonType * | poly, | ||
const BoxType * | clip_box | ||
) |
Definition at line 283 of file draw_helpers.c.
References polygon_st::Clipped, ComputeNoHoles(), POLYAREA::f, fill_clipped_contour(), fill_contour(), fill_contour_cb(), PLINE::next, polygon_st::NoHoles, NoHolesPolygonDicer(), polygon_st::NoHolesValid, poly, should_compute_no_holes(), and TEST_FLAG.
Referenced by common_draw_helpers_init(), ghid_drawing_area_expose_cb(), and gsvit_fill_pcb_polygon().
Definition at line 596 of file draw_helpers.c.
References hid_draw_st::draw_arc, draw_octagon_poly(), pin_st::DrillingHole, hid_draw_st::fill_circle, hid_draw_st::fill_rect, hid_st::graphics, gui, pin_st::Mask, Round_Cap, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, TEST_FLAG, pin_st::Thickness, pin_st::X, and pin_st::Y.
Referenced by common_draw_helpers_init(), and gsvit_fill_pcb_pv().
Definition at line 429 of file draw_helpers.c.
Referenced by common_fill_pcb_pad().
void common_gui_draw_pcb_polygon | ( | hidGC | gc, |
PolygonType * | polygon, | ||
const BoxType * | clip_box | ||
) |
Definition at line 260 of file draw_helpers.c.
References polygon_st::Clipped, POLYAREA::f, hid_draw_st::fill_pcb_polygon, hid_st::graphics, gui, PCB, poly, TEST_FLAG, and hid_draw_st::thindraw_pcb_polygon.
Referenced by hid_lesstif_init(), and REGISTER_FLAGS().
Definition at line 359 of file draw_helpers.c.
References abs, hid_draw_st::draw_arc, hid_draw_st::draw_line, hid_st::graphics, gui, M_PI, pad_st::Mask, pixel_slop, Round_Cap, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, SGN, and TEST_FLAG.
Referenced by common_draw_helpers_init().
void common_thindraw_pcb_polygon | ( | hidGC | gc, |
PolygonType * | poly, | ||
const BoxType * | clip_box | ||
) |
Definition at line 334 of file draw_helpers.c.
References polygon_st::Clipped, POLYAREA::contours, POLYAREA::f, poly, PolygonHoles(), TEST_FLAG, thindraw_contour(), and thindraw_hole_cb().
Referenced by common_draw_helpers_init(), and ghid_thindraw_pcb_polygon().
Definition at line 635 of file draw_helpers.c.
References hid_draw_st::draw_arc, hid_draw_st::draw_line, draw_octagon_poly(), pin_st::DrillingHole, hid_st::graphics, gui, pin_st::Mask, Round_Cap, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, TEST_FLAG, pin_st::Thickness, pin_st::X, and pin_st::Y.
Referenced by common_draw_helpers_init().
static void draw_octagon_poly | ( | hidGC | gc, |
Coord | X, | ||
Coord | Y, | ||
Coord | Thickness, | ||
bool | thin_draw | ||
) | [static] |
Definition at line 544 of file draw_helpers.c.
References hid_draw_st::draw_line, hid_draw_st::fill_polygon, hid_st::graphics, gui, Round_Cap, hid_draw_st::set_line_cap, hid_draw_st::set_line_width, TAN_22_5_DEGREE_2, FloatPolyType::X, and FloatPolyType::Y.
Referenced by common_fill_pcb_pv(), and common_thindraw_pcb_pv().
Definition at line 194 of file draw_helpers.c.
References POLYAREA::contours, err_ok, POLYAREA::f, fill_contour(), PBO_ISECT, poly_Boolean_free(), poly_CopyContour(), poly_Create(), poly_Free(), poly_InclContour(), RectPoly(), x, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by common_fill_pcb_polygon().
Definition at line 123 of file draw_helpers.c.
References PLINE::Count, hid_draw_st::fill_polygon, hid_st::graphics, gui, PLINE::head, malloc(), n, VNODE::point, x, and y.
Referenced by common_fill_pcb_polygon(), fill_clipped_contour(), and fill_contour_cb().
static void fill_contour_cb | ( | PLINE * | pl, |
void * | user_data | ||
) | [static] |
Definition at line 184 of file draw_helpers.c.
References fill_contour(), and poly_FreeContours().
Referenced by common_fill_pcb_polygon().
static int should_compute_no_holes | ( | PolygonType * | poly, |
const BoxType * | clip_box | ||
) | [static] |
Definition at line 228 of file draw_helpers.c.
References BOUNDS_INSIDE_CLIP_THRESHOLD, MAX, MIN, BoxType::X1, BoxType::X2, BoxType::Y1, and BoxType::Y2.
Referenced by common_fill_pcb_polygon().
Definition at line 145 of file draw_helpers.c.
References PLINE::cx, PLINE::cy, hid_draw_st::draw_arc, hid_draw_st::draw_line, hid_st::graphics, gui, PLINE::head, PLINE::is_round, VNODE::next, VNODE::point, PLINE::radius, Round_Cap, hid_draw_st::set_line_cap, and hid_draw_st::set_line_width.
Referenced by common_thindraw_pcb_polygon(), and thindraw_hole_cb().
static int thindraw_hole_cb | ( | PLINE * | pl, |
void * | user_data | ||
) | [static] |
Definition at line 326 of file draw_helpers.c.
References thindraw_contour().
Referenced by common_thindraw_pcb_polygon().