gschem

o_path.c File Reference

#include <config.h>
#include <stdio.h>
#include <math.h>
#include <cairo.h>
#include "gschem.h"
Include dependency graph for o_path.c:

Go to the source code of this file.

Defines

#define NUM_BEZIER_SEGMENTS   100

Typedefs

typedef void(* FILL_FUNC )(GSCHEM_TOPLEVEL *w_current, COLOR *color, PATH *path, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2)

Functions

static void hint_coordinates (int x, int y, double *fx, double *fy, int width)
static void path_path (GSCHEM_TOPLEVEL *w_current, OBJECT *object)
static PATH * path_copy_modify (PATH *path, int dx, int dy, int new_x, int new_y, int whichone)
static void o_path_fill_hollow (GSCHEM_TOPLEVEL *w_current, COLOR *color, PATH *path, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2)
 Placeholder filling function.
static void o_path_fill_fill (GSCHEM_TOPLEVEL *w_current, COLOR *color, PATH *path, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2)
 Fill inside of path with a solid pattern.
static void o_path_fill_hatch (GSCHEM_TOPLEVEL *w_current, COLOR *color, PATH *path, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2)
 Fill inside of path with single line pattern.
static void o_path_fill_mesh (GSCHEM_TOPLEVEL *w_current, COLOR *color, PATH *path, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2)
 Fill inside of path with mesh pattern.
void o_path_draw (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 Draw a path on screen.
void o_path_invalidate_rubber (GSCHEM_TOPLEVEL *w_current)
void o_path_draw_place (GSCHEM_TOPLEVEL *w_current, int dx, int dy, OBJECT *o_current)
 Draw a path object after applying translation.
void o_path_start (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 Start process to input a new path.
void o_path_end (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 End the input of a path.
void o_path_motion (GSCHEM_TOPLEVEL *w_current, int w_x, int w_y)
 Draw temporary path while dragging end.
void o_path_draw_rubber (GSCHEM_TOPLEVEL *w_current)
 Draw path from GSCHEM_TOPLEVEL object.
static void draw_control_lines (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 Draw lines between curve segment end-point and their control point.
void o_path_draw_grips (GSCHEM_TOPLEVEL *w_current, OBJECT *o_current)
 Draw grip marks on path.

Define Documentation

#define NUM_BEZIER_SEGMENTS   100

Definition at line 32 of file o_path.c.


Typedef Documentation

typedef void(* FILL_FUNC)(GSCHEM_TOPLEVEL *w_current, COLOR *color, PATH *path, gint fill_width, gint angle1, gint pitch1, gint angle2, gint pitch2)

Definition at line 35 of file o_path.c.


Function Documentation

static void hint_coordinates ( int  x,
int  y,
double *  fx,
double *  fy,
int  width 
) [static]

Definition at line 41 of file o_path.c.

static void path_path ( GSCHEM_TOPLEVEL w_current,
OBJECT *  object 
) [static]

Definition at line 49 of file o_path.c.

Here is the call graph for this function:

static PATH* path_copy_modify ( PATH *  path,
int  dx,
int  dy,
int  new_x,
int  new_y,
int  whichone 
) [static]

Definition at line 106 of file o_path.c.

static void o_path_fill_hollow ( GSCHEM_TOPLEVEL w_current,
COLOR *  color,
PATH *  path,
gint  fill_width,
gint  angle1,
gint  pitch1,
gint  angle2,
gint  pitch2 
) [static]
Function Description
This function does nothing. It has the same prototype as all the filling functions. It prevent from making a difference between filling in function o_path_draw().
Parameters:
[in]w_currentSchematic top level
[in]colorBox fill color.
[in]pathThe PATH object to draw
[in]fill_widthPATH pattern fill width.
[in]angle11st angle for pattern.
[in]pitch11st pitch for pattern.
[in]angle22nd angle for pattern.
[in]pitch22nd pitch for pattern.

Definition at line 172 of file o_path.c.

static void o_path_fill_fill ( GSCHEM_TOPLEVEL w_current,
COLOR *  color,
PATH *  path,
gint  fill_width,
gint  angle1,
gint  pitch1,
gint  angle2,
gint  pitch2 
) [static]
Function Description
This function fills the inside of the path with a solid pattern. Parameters angle1, pitch1 and angle2, pitch2 and fill_width are unused here but kept for compatibility with other path filling functions.
Parameters:
[in]w_currentSchematic top level
[in]colorBox fill color.
[in]pathThe PATH object to draw
[in]fill_widthPATH pattern fill width.
[in]angle1(unused)
[in]pitch1(unused)
[in]angle2(unused)
[in]pitch2(unused)

Definition at line 197 of file o_path.c.

static void o_path_fill_hatch ( GSCHEM_TOPLEVEL w_current,
COLOR *  color,
PATH *  path,
gint  fill_width,
gint  angle1,
gint  pitch1,
gint  angle2,
gint  pitch2 
) [static]
Function Description
This function fills the inside of the path with a pattern made of lines. The lines are drawn inside the path with an angle angle1 from the horizontal. The distance between two of these lines is given by pitch1 and their width by fill_width. Parameters angle2 and pitch2 are unused here but kept for compatbility with other path filling functions.
Parameters:
[in]w_currentSchematic top level
[in]colorBox fill color.
[in]pathThe PATH object to draw
[in]fill_widthPATH pattern fill width.
[in]angle11st angle for pattern.
[in]pitch11st pitch for pattern.
[in]angle2(unused)
[in]pitch2(unused)

Definition at line 224 of file o_path.c.

Here is the call graph for this function:

static void o_path_fill_mesh ( GSCHEM_TOPLEVEL w_current,
COLOR *  color,
PATH *  path,
gint  fill_width,
gint  angle1,
gint  pitch1,
gint  angle2,
gint  pitch2 
) [static]
Function Description
This function fills the inside of the path with a pattern made of two sets of parallel lines in two directions. The first set is drawn inside the path with an angle angle1 from the horizontal. The distance between two of these lines is given by pitch1. The second set is drawn inside the path with an angle angle2 from the horizontal. The distance between two of these lines is given by pitch2.
Parameters:
[in]w_currentSchematic top level
[in]colorBox fill color.
[in]pathThe PATH object to draw
[in]fill_widthPATH pattern fill width.
[in]angle11st angle for pattern.
[in]pitch11st pitch for pattern.
[in]angle22nd angle for pattern.
[in]pitch22nd pitch for pattern.

Definition at line 269 of file o_path.c.

Here is the call graph for this function:

void o_path_draw ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current 
)
Function Description
This function is used to draw a path on screen. The path is described in the object which is referred by o_current. The path is displayed according to the current state, described in the GSCHEM_TOPLEVEL object pointed by w_current.
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentThe path OBJECT to draw.

Definition at line 292 of file o_path.c.

Here is the call graph for this function:

void o_path_invalidate_rubber ( GSCHEM_TOPLEVEL w_current)
Todo:
Finish function documentation
Function Description

Definition at line 374 of file o_path.c.

Here is the call graph for this function:

void o_path_draw_place ( GSCHEM_TOPLEVEL w_current,
int  dx,
int  dy,
OBJECT *  o_current 
)
Function Description
This function is used to draw the path object described by *o_current after applying a translation on the two directions of dx and dy in world units.
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]dxDelta x coordinate for path.
[in]dyDelta y coordinate for path.
[in]o_currentLine OBJECT to draw.

Definition at line 442 of file o_path.c.

Here is the call graph for this function:

void o_path_start ( GSCHEM_TOPLEVEL w_current,
int  w_x,
int  w_y 
)
Function Description
This function starts the process of interactively adding a path to the current sheet.

During all the process, the path is internally represented by the two ends of the path as (w_current->first_wx,w_current->first_wy) and (w_current->second_wx,w_current->second_wy).

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]w_xCurrent x coordinate of pointer in world units.
[in]w_yCurrent y coordinate of pointer in world units.

Definition at line 474 of file o_path.c.

void o_path_end ( GSCHEM_TOPLEVEL w_current,
int  w_x,
int  w_y 
)
Function Description
This function ends the process of interactively adding a path to the current sheet.

It first erases the last temporary path displayed, calculates the corresponding world coordinates of the two ends of the path and finally adds a new initialized path object to the list of object of the current sheet.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]w_x(unused)
[in]w_y(unused)

Definition at line 494 of file o_path.c.

void o_path_motion ( GSCHEM_TOPLEVEL w_current,
int  w_x,
int  w_y 
)
Function Description
This function manages the erase/update/draw process of temporary path when modifying one end of the path. The path is described by four *w_current variables : the first end of the path is (first_wx,first_wy), the second end is (second_wx,second_wy). The first end is constant. The second end is updated to the (w_x,w_y).
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]w_xCurrent x coordinate of pointer in world units.
[in]w_yCurrent y coordinate of pointer in world units.

Definition at line 513 of file o_path.c.

Here is the call graph for this function:

void o_path_draw_rubber ( GSCHEM_TOPLEVEL w_current)
Function Description
This function draws a path with an exclusive or function over the sheet. The color of the box is SELECT_COLOR. The path is described by the two points (w_current->first_wx, w_current->first_wy) and (w_current->second_wx,w_current->second_wy).
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.

Definition at line 535 of file o_path.c.

Here is the call graph for this function:

static void draw_control_lines ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current 
) [static]
Function Description
This function Draws lines between the end-points and respective control-points of curve segments in the path.
Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentThe path OBJECT.

Definition at line 563 of file o_path.c.

Here is the call graph for this function:

void o_path_draw_grips ( GSCHEM_TOPLEVEL w_current,
OBJECT *  o_current 
)
Function Description
This function draws the grips on the path object o_current.

A path has a grip at each end.

Parameters:
[in]w_currentThe GSCHEM_TOPLEVEL object.
[in]o_currentLine OBJECT to draw grip points on.

Definition at line 626 of file o_path.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines