#include "config.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "libgeda_priv.h"
Go to the source code of this file.
Data Structures |
struct | _RSVGParsePathCtx |
Defines |
#define | NUM_BEZIER_SEGMENTS 100 |
Typedefs |
typedef struct _RSVGParsePathCtx | RSVGParsePathCtx |
Functions |
PATH * | s_path_new (void) |
PATH * | s_path_new_from (PATH_SECTION *sections) |
void | s_path_free (PATH *path) |
void | s_path_moveto (PATH *path, double x, double y) |
void | s_path_lineto (PATH *path, double x, double y) |
void | s_path_curveto (PATH *path, double x1, double y1, double x2, double y2, double x3, double y3) |
void | s_path_art_finish (PATH *path) |
static void | s_path_arc_segment (RSVGParsePathCtx *ctx, double xc, double yc, double th0, double th1, double rx, double ry, double x_axis_rotation) |
static void | s_path_arc (RSVGParsePathCtx *ctx, double rx, double ry, double x_axis_rotation, int large_arc_flag, int sweep_flag, double x, double y) |
static void | s_path_parse_default_xy (RSVGParsePathCtx *ctx, int n_params) |
static void | s_path_parse_do_cmd (RSVGParsePathCtx *ctx, gboolean final) |
static void | s_path_parse_data (RSVGParsePathCtx *ctx, const char *data) |
PATH * | s_path_parse (const char *path_str) |
char * | s_path_string_from_path (const PATH *path) |
int | s_path_to_polygon (PATH *path, GArray *points) |
| Converts a path to a polygon.
|
double | s_path_shortest_distance (PATH *path, int x, int y, int solid) |
| Calculates the distance between the given point and the closest point on the given path segment.
|
Define Documentation
#define NUM_BEZIER_SEGMENTS 100 |
Typedef Documentation
Function Documentation
PATH* s_path_new |
( |
void |
| ) |
|
void s_path_free |
( |
PATH * |
path | ) |
|
void s_path_moveto |
( |
PATH * |
path, |
|
|
double |
x, |
|
|
double |
y |
|
) |
| |
void s_path_lineto |
( |
PATH * |
path, |
|
|
double |
x, |
|
|
double |
y |
|
) |
| |
void s_path_curveto |
( |
PATH * |
path, |
|
|
double |
x1, |
|
|
double |
y1, |
|
|
double |
x2, |
|
|
double |
y2, |
|
|
double |
x3, |
|
|
double |
y3 |
|
) |
| |
void s_path_art_finish |
( |
PATH * |
path | ) |
|
static void s_path_arc_segment |
( |
RSVGParsePathCtx * |
ctx, |
|
|
double |
xc, |
|
|
double |
yc, |
|
|
double |
th0, |
|
|
double |
th1, |
|
|
double |
rx, |
|
|
double |
ry, |
|
|
double |
x_axis_rotation |
|
) |
| [static] |
static void s_path_arc |
( |
RSVGParsePathCtx * |
ctx, |
|
|
double |
rx, |
|
|
double |
ry, |
|
|
double |
x_axis_rotation, |
|
|
int |
large_arc_flag, |
|
|
int |
sweep_flag, |
|
|
double |
x, |
|
|
double |
y |
|
) |
| [static] |
static void s_path_parse_default_xy |
( |
RSVGParsePathCtx * |
ctx, |
|
|
int |
n_params |
|
) |
| [static] |
static void s_path_parse_do_cmd |
( |
RSVGParsePathCtx * |
ctx, |
|
|
gboolean |
final |
|
) |
| [static] |
static void s_path_parse_data |
( |
RSVGParsePathCtx * |
ctx, |
|
|
const char * |
data |
|
) |
| [static] |
PATH* s_path_parse |
( |
const char * |
path_str | ) |
|
char* s_path_string_from_path |
( |
const PATH * |
path | ) |
|
int s_path_to_polygon |
( |
PATH * |
path, |
|
|
GArray * |
points |
|
) |
| |
- Parameters:
-
path | [in] The path to convert to a polygon. This parameter must not be NULL. |
points | [out] An array of the polygon's vertices. This parameter must not be NULL. |
- Returns:
- TRUE if the path is closed, FALSE if it is open.
Definition at line 708 of file s_path.c.
double s_path_shortest_distance |
( |
PATH * |
path, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
solid |
|
) |
| |
- Parameters:
-
[in] | path | The path. |
[in] | x | The x coordinate of the given point. |
[in] | y | The y coordinate of the given point. |
[in] | solid | TRUE if the path should be treated as solid, FALSE if the path should be treated as hollow. |
- Returns:
- The shortest distance from the path to the point. With a solid shape, this function returns a distance of zero for interior points. With an invalid parameter, this function returns G_MAXDOUBLE.
Definition at line 768 of file s_path.c.