libgeda
|
Functions for complex objects. More...
#include <config.h>
#include <stdio.h>
#include <math.h>
#include "libgeda_priv.h"
Go to the source code of this file.
Functions | |
int | world_get_single_object_bounds (TOPLEVEL *toplevel, OBJECT *o_current, int *rleft, int *rtop, int *rright, int *rbottom) |
Return the bounds of the given object. | |
int | world_get_object_glist_bounds (TOPLEVEL *toplevel, const GList *head, int *left, int *top, int *right, int *bottom) |
Return the bounds of the given GList of objects. | |
void | world_get_complex_bounds (TOPLEVEL *toplevel, OBJECT *complex, int *left, int *top, int *right, int *bottom) |
Queries the bounds of a complex object. | |
gboolean | o_complex_get_position (TOPLEVEL *toplevel, gint *x, gint *y, OBJECT *object) |
get the position of the complex base point | |
static int | o_complex_is_eligible_attribute (TOPLEVEL *toplevel, OBJECT *object) |
check whether an object is a attributes | |
int | o_complex_is_embedded (OBJECT *o_current) |
get the embedded state of an complex object | |
GList * | o_complex_get_promotable (TOPLEVEL *toplevel, OBJECT *object, int detach) |
Get attributes eligible for promotion from inside a complex. | |
GList * | o_complex_promote_attribs (TOPLEVEL *toplevel, OBJECT *object) |
Promote attributes from a complex OBJECT. | |
static void | o_complex_remove_promotable_attribs (TOPLEVEL *toplevel, OBJECT *object) |
Delete or hide promotable from the passed OBJECT. | |
static void | create_placeholder (TOPLEVEL *toplevel, OBJECT *new_node, int x, int y) |
OBJECT * | o_complex_new (TOPLEVEL *toplevel, char type, int color, int x, int y, int angle, int mirror, const CLibSymbol *clib, const gchar *basename, int selectable) |
OBJECT * | o_complex_new_embedded (TOPLEVEL *toplevel, char type, int color, int x, int y, int angle, int mirror, const gchar *basename, int selectable) |
create a new embedded object | |
void | o_complex_recalc (TOPLEVEL *toplevel, OBJECT *o_current) |
update the visual boundaries of the complex object | |
OBJECT * | o_complex_read (TOPLEVEL *toplevel, const char buf[], unsigned int release_ver, unsigned int fileformat_ver, GError **err) |
read a complex object from a char buffer | |
char * | o_complex_save (TOPLEVEL *toplevel, OBJECT *object) |
Create a string representation of the complex object. | |
void | o_complex_translate_world (TOPLEVEL *toplevel, int dx, int dy, OBJECT *object) |
move a complex object | |
OBJECT * | o_complex_copy (TOPLEVEL *toplevel, OBJECT *o_current) |
Create a copy of a COMPLEX object. | |
void | o_complex_rotate_world (TOPLEVEL *toplevel, int centerx, int centery, int angle, OBJECT *object) |
void | o_complex_mirror_world (TOPLEVEL *toplevel, int world_centerx, int world_centery, OBJECT *object) |
OBJECT * | o_complex_find_pin_by_attribute (OBJECT *object, char *name, char *wanted_value) |
Find a pin with a particular attribute. | |
void | o_complex_check_symversion (TOPLEVEL *toplevel, OBJECT *object) |
check the symversion of a complex object | |
double | o_complex_shortest_distance (OBJECT *object, int x, int y, int force_solid) |
Calculates the distance between the given point and the closest point on an object within the complex object. |
Complex objects are collections of primary objects.
Definition in file o_complex_basic.c.
int world_get_single_object_bounds | ( | TOPLEVEL * | toplevel, |
OBJECT * | o_current, | ||
int * | rleft, | ||
int * | rtop, | ||
int * | rright, | ||
int * | rbottom | ||
) |
[in] | toplevel | The toplevel structure. |
[in] | o_current | The object to look the bounds for. |
[out] | rleft | pointer to the left coordinate of the object. |
[out] | rtop | pointer to the top coordinate of the object. |
[out] | rright | pointer to the right coordinate of the object. |
[out] | rbottom | pointer to the bottom coordinate of the object. |
0 | No bound was found |
1 | Bound was found |
Definition at line 57 of file o_complex_basic.c.
int world_get_object_glist_bounds | ( | TOPLEVEL * | toplevel, |
const GList * | head, | ||
int * | left, | ||
int * | top, | ||
int * | right, | ||
int * | bottom | ||
) |
[in] | toplevel | The TOPLEVEL structure. |
[in] | head | The list of objects to look the bounds for. |
[out] | left | pointer to the left coordinate of the object. |
[out] | top | pointer to the top coordinate of the object. |
[out] | right | pointer to the right coordinate of the object. |
[out] | bottom | pointer to the bottom coordinate of the object. |
0 | No bounds were found |
1 | Bound was found |
Definition at line 113 of file o_complex_basic.c.
void world_get_complex_bounds | ( | TOPLEVEL * | toplevel, |
OBJECT * | complex, | ||
int * | left, | ||
int * | top, | ||
int * | right, | ||
int * | bottom | ||
) |
[in] | toplevel | The toplevel environment. |
[in] | complex | The complex object. |
[out] | left | The leftmost edge of the bounding box (in world units). |
[out] | top | The upper edge of the bounding box (in world units). |
[out] | right | The rightmost edge of the bounding box (in world units). |
[out] | bottom | The bottom edge of the bounding box (in screen units). |
Definition at line 165 of file o_complex_basic.c.
[in] | toplevel | The toplevel environment. |
[out] | x | pointer to the x-position |
[out] | y | pointer to the y-position |
[in] | object | The object to get the position. |
Definition at line 187 of file o_complex_basic.c.
[in] | toplevel | The TOPLEVEL object |
[in] | object | The attribute object to check |
Definition at line 205 of file o_complex_basic.c.
int o_complex_is_embedded | ( | OBJECT * | o_current | ) |
o_current | The object to check |
Definition at line 245 of file o_complex_basic.c.
If detach is TRUE, the function removes these attribute objects from the prim_objs of the complex. If detach is FALSE, the OBJECTs are left in place.
[in] | toplevel | The toplevel environment. |
[in] | object | The complex object being modified. |
[in] | detach | Should the attributes be detached? |
Definition at line 275 of file o_complex_basic.c.
Definition at line 319 of file o_complex_basic.c.
Deletion / hiding is dependant on the setting of toplevel->keep_invisible. If true, attributes eligible for promotion are kept in memory but flagged as invisible.
[in] | toplevel | The toplevel environment. |
[in] | object | The complex object being altered. |
Definition at line 374 of file o_complex_basic.c.
OBJECT* o_complex_new | ( | TOPLEVEL * | toplevel, |
char | type, | ||
int | color, | ||
int | x, | ||
int | y, | ||
int | angle, | ||
int | mirror, | ||
const CLibSymbol * | clib, | ||
const gchar * | basename, | ||
int | selectable | ||
) |
Definition at line 481 of file o_complex_basic.c.
OBJECT* o_complex_new_embedded | ( | TOPLEVEL * | toplevel, |
char | type, | ||
int | color, | ||
int | x, | ||
int | y, | ||
int | angle, | ||
int | mirror, | ||
const gchar * | basename, | ||
int | selectable | ||
) |
[in] | toplevel | The TOPLEVEL object |
[in] | type | The type of the object (usually OBJ_COMLEX) |
[in] | color | The color of the object |
[in] | x | The x location of the complex object |
[in] | y | The y location of the complex object |
[in] | angle | The rotation angle |
[in] | mirror | The mirror status |
[in] | basename | The basic name the embedded was created of |
[in] | selectable | whether the object can be selected with the mouse |
Definition at line 568 of file o_complex_basic.c.
[in] | toplevel | The TOPLEVEL object |
[in] | o_current | The OBJECT to update |
Definition at line 604 of file o_complex_basic.c.
OBJECT* o_complex_read | ( | TOPLEVEL * | toplevel, |
const char | buf[], | ||
unsigned int | release_ver, | ||
unsigned int | fileformat_ver, | ||
GError ** | err | ||
) |
[in] | toplevel | The TOPLEVEL object |
[in] | buf | a text buffer (usually a line of a schematic file) |
[in] | release_ver | The release number gEDA |
[in] | fileformat_ver | a integer value of the file format |
Definition at line 638 of file o_complex_basic.c.
[in] | toplevel | a TOPLEVEL structure |
[in] | object | a complex OBJECT |
Definition at line 718 of file o_complex_basic.c.
[in] | toplevel | The TOPLEVEL object |
[in] | dx | The x-distance to move the object |
[in] | dy | The y-distance to move the object |
[in] | object | The complex OBJECT to be moved |
Definition at line 753 of file o_complex_basic.c.
[in] | toplevel | The TOPLEVEL object |
[in] | o_current | The object that is copied |
Definition at line 776 of file o_complex_basic.c.
void o_complex_rotate_world | ( | TOPLEVEL * | toplevel, |
int | centerx, | ||
int | centery, | ||
int | angle, | ||
OBJECT * | object | ||
) |
Definition at line 829 of file o_complex_basic.c.
void o_complex_mirror_world | ( | TOPLEVEL * | toplevel, |
int | world_centerx, | ||
int | world_centery, | ||
OBJECT * | object | ||
) |
Definition at line 867 of file o_complex_basic.c.
[in] | object | complex OBJECT whos pins to search. |
[in] | name | the attribute name to search for. |
[in] | wanted_value | the attribute value to search for. |
Definition at line 914 of file o_complex_basic.c.
toplevel | The TOPLEVEL object |
object | The complex OBJECT |
Definition at line 956 of file o_complex_basic.c.
double o_complex_shortest_distance | ( | OBJECT * | object, |
int | x, | ||
int | y, | ||
int | force_solid | ||
) |
[in] | object | The complex OBJECT. |
[in] | x | The x coordinate of the given point. |
[in] | y | The y coordinate of the given point. |
[in] | force_solid | If true, force treating the object as solid. |
Definition at line 1141 of file o_complex_basic.c.