libgeda

s_path.c File Reference

#include "config.h"
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "libgeda_priv.h"
Include dependency graph for s_path.c:

Go to the source code of this file.

Data Structures

struct  _RSVGParsePathCtx

Defines

#define NUM_BEZIER_SEGMENTS   100

Typedefs

typedef struct _RSVGParsePathCtx RSVGParsePathCtx

Functions

PATHs_path_new (void)
PATHs_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)
PATHs_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

Definition at line 44 of file s_path.c.


Typedef Documentation

Definition at line 185 of file s_path.c.


Function Documentation

PATH* s_path_new ( void  )

Definition at line 47 of file s_path.c.

PATH* s_path_new_from ( PATH_SECTION sections)

Definition at line 60 of file s_path.c.

Here is the call graph for this function:

void s_path_free ( PATH path)

Definition at line 82 of file s_path.c.

void s_path_moveto ( PATH path,
double  x,
double  y 
)

Definition at line 91 of file s_path.c.

void s_path_lineto ( PATH path,
double  x,
double  y 
)

Definition at line 121 of file s_path.c.

void s_path_curveto ( PATH path,
double  x1,
double  y1,
double  x2,
double  y2,
double  x3,
double  y3 
)

Definition at line 139 of file s_path.c.

void s_path_art_finish ( PATH path)

Definition at line 162 of file s_path.c.

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]

Definition at line 199 of file s_path.c.

Here is the call graph for this function:

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]

Definition at line 244 of file s_path.c.

Here is the call graph for this function:

static void s_path_parse_default_xy ( RSVGParsePathCtx ctx,
int  n_params 
) [static]

Definition at line 313 of file s_path.c.

static void s_path_parse_do_cmd ( RSVGParsePathCtx ctx,
gboolean  final 
) [static]

Definition at line 335 of file s_path.c.

Here is the call graph for this function:

static void s_path_parse_data ( RSVGParsePathCtx ctx,
const char *  data 
) [static]

Definition at line 494 of file s_path.c.

Here is the call graph for this function:

PATH* s_path_parse ( const char *  path_str)

Definition at line 637 of file s_path.c.

Here is the call graph for this function:

char* s_path_string_from_path ( const PATH path)

Definition at line 658 of file s_path.c.

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.

Here is the call graph for this function:

double s_path_shortest_distance ( PATH path,
int  x,
int  y,
int  solid 
)
Parameters:
[in]pathThe path.
[in]xThe x coordinate of the given point.
[in]yThe y coordinate of the given point.
[in]solidTRUE 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.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines