gschem
|
#include <config.h>
#include <stdio.h>
#include <math.h>
#include "gschem.h"
Go to the source code of this file.
Typedefs | |
typedef void(* | FILL_FUNC )(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Functions | |
static void | o_circle_fill_hollow (GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Placeholder filling function. | |
static void | o_circle_fill_fill (GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Fill inside of circle with a solid pattern. | |
static void | o_circle_fill_hatch (GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Fill inside of circle with single line pattern. | |
static void | o_circle_fill_mesh (GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Fill inside of circle with mesh pattern. | |
void | o_circle_draw (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current) |
Draw a circle on the screen. | |
void | o_circle_invalidate_rubber (GSCHEM_TOPLEVEL *w_current) |
void | o_circle_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current) |
Draw a circle described by OBJECT with translation. | |
void | o_circle_start (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y) |
Start process to input a new circle. | |
void | o_circle_end (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y) |
End the input of a circle. | |
void | o_circle_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y) |
Draw temporary circle while dragging edge. | |
void | o_circle_draw_rubber (GSCHEM_TOPLEVEL *w_current) |
Draw circle from GSCHEM_TOPLEVEL object. | |
void | o_circle_draw_grips (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current) |
Draw grip marks on circle. |
typedef void(* FILL_FUNC)(GSCHEM_TOPLEVEL *w_current, COLOR *color, CIRCLE *circle, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2) |
Definition at line 31 of file o_circle.c.
static void o_circle_fill_hollow | ( | GSCHEM_TOPLEVEL * | w_current, |
COLOR * | color, | ||
CIRCLE * | circle, | ||
gint | fill_width, | ||
gint | angle1, | ||
gint | pitch1, | ||
gint | angle2, | ||
gint | pitch2 | ||
) | [static] |
The unit for width, pitch1 and pitch2 is pixel and unit for angle1 and angle2 is degree.
[in] | w_current | Schematic top level |
[in] | color | Circle fill color. |
[in] | circle | Circle to be drawn |
[in] | fill_width | |
[in] | angle1 | 1st angle for pattern. |
[in] | pitch1 | 1st pitch for pattern. |
[in] | angle2 | 2nd angle for pattern. |
[in] | pitch2 | 2nd pitch for pattern. |
Definition at line 56 of file o_circle.c.
static void o_circle_fill_fill | ( | GSCHEM_TOPLEVEL * | w_current, |
COLOR * | color, | ||
CIRCLE * | circle, | ||
gint | fill_width, | ||
gint | angle1, | ||
gint | pitch1, | ||
gint | angle2, | ||
gint | pitch2 | ||
) | [static] |
The circle is described by the coordinates of its center and its radius. Please not that it is not the way GDK take it. Translation is made afterward.
The unit for width, pitch1 and pitch2 is pixel and unit for angle1 and angle2 is degree.
[in] | w_current | Schematic top level |
[in] | color | Circle fill color. |
[in] | circle | Circle to be drawn |
[in] | fill_width | |
[in] | angle1 | (unused) |
[in] | pitch1 | (unused) |
[in] | angle2 | (unused) |
[in] | pitch2 | (unused) |
Definition at line 88 of file o_circle.c.
static void o_circle_fill_hatch | ( | GSCHEM_TOPLEVEL * | w_current, |
COLOR * | color, | ||
CIRCLE * | circle, | ||
gint | fill_width, | ||
gint | angle1, | ||
gint | pitch1, | ||
gint | angle2, | ||
gint | pitch2 | ||
) | [static] |
The circle is described by the coordinates of its center and its radius. Please not that it is not the way GDK take it. Translation is made afterward.
The unit for width, pitch1 and pitch2 is pixel and unit for angle1 and angle2 is degree.
The only attribute of line here is its width from the parameter width.
Negative or null values for pitch1 are not allowed as it leads to an endless loop.
[in] | w_current | Schematic top level |
[in] | color | Circle fill color. |
[in] | circle | Circle to be drawn |
[in] | fill_width | |
[in] | angle1 | 1st angle for pattern. |
[in] | pitch1 | 1st pitch for pattern. |
[in] | angle2 | (unused) |
[in] | pitch2 | (unused) |
Definition at line 128 of file o_circle.c.
static void o_circle_fill_mesh | ( | GSCHEM_TOPLEVEL * | w_current, |
COLOR * | color, | ||
CIRCLE * | circle, | ||
gint | fill_width, | ||
gint | angle1, | ||
gint | pitch1, | ||
gint | angle2, | ||
gint | pitch2 | ||
) | [static] |
The unit for width, pitch1 and pitch2 is pixel and unit for angle1 and angle2 is degree.
This function simply makes two successive calls to the function o_circle_fill_hatch() respectively with angle1, pitch1 and angle2, pitch2 for parameters.
[in] | w_current | Schematic top level |
[in] | color | Circle fill color. |
[in] | circle | Circle to be drawn |
[in] | fill_width | |
[in] | angle1 | 1st angle for pattern. |
[in] | pitch1 | 1st pitch for pattern. |
[in] | angle2 | 2nd angle for pattern. |
[in] | pitch2 | 2nd pitch for pattern. |
Definition at line 181 of file o_circle.c.
void o_circle_draw | ( | GSCHEM_TOPLEVEL * | w_current, |
OBJECT * | o_current | ||
) |
It first checks if the OBJECT pointed is valid or not. If not it returns and do not output anything. That should never happen though.
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | o_current | Circle OBJECT to draw. |
Definition at line 208 of file o_circle.c.
void o_circle_invalidate_rubber | ( | GSCHEM_TOPLEVEL * | w_current | ) |
Definition at line 319 of file o_circle.c.
void o_circle_draw_place | ( | GSCHEM_TOPLEVEL * | w_current, |
int | dx, | ||
int | dy, | ||
OBJECT * | o_current | ||
) |
The circle is displayed with the color of the object.
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | dx | Delta x coordinate for circle. |
[in] | dy | Delta y coordinate for circle. |
[in] | o_current | Circle OBJECT to draw. |
Definition at line 346 of file o_circle.c.
void o_circle_start | ( | GSCHEM_TOPLEVEL * | w_current, |
int | w_x, | ||
int | w_y | ||
) |
The first step of the circle input is to set the center of the arc. This center is kept in (w_current->first_wx,w_current->first_wy).
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | w_x | Current x coordinate of pointer in world units. |
[in] | w_y | Current y coordinate of pointer in world units. |
Definition at line 374 of file o_circle.c.
void o_circle_end | ( | GSCHEM_TOPLEVEL * | w_current, |
int | w_x, | ||
int | w_y | ||
) |
The center has previously been input and saved as (w_current->first_wx,w_current->first_wy).
The temporary circle drawn during the input of the radius is erased. A new object is allocated, initialized and linked in the object list. This new object is finally drawn.
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | w_x | (unused) |
[in] | w_y | (unused) |
Definition at line 407 of file o_circle.c.
void o_circle_motion | ( | GSCHEM_TOPLEVEL * | w_current, |
int | w_x, | ||
int | w_y | ||
) |
The previous temporary circle is erased, the radius is then computed and updated and finally a new temporary circle is drawn.
The arc is internally described by :
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | w_x | Current x coordinate of pointer in world units. |
[in] | w_y | Current y coordinate of pointer in world units. |
Definition at line 459 of file o_circle.c.
void o_circle_draw_rubber | ( | GSCHEM_TOPLEVEL * | w_current | ) |
It draws a horizontal radius segment on the right half of the circle and the circle with the selection color.
[in] | w_current | The GSCHEM_TOPLEVEL object. |
Definition at line 494 of file o_circle.c.
void o_circle_draw_grips | ( | GSCHEM_TOPLEVEL * | w_current, |
OBJECT * | o_current | ||
) |
[in] | w_current | The GSCHEM_TOPLEVEL object. |
[in] | o_current | Circle OBJECT to draw grip points on. |
Definition at line 518 of file o_circle.c.