pcb 4.1.1
An interactive printed circuit board layout editor.

oocs.c File Reference

#include <math.h>
#include "gts.h"
Include dependency graph for oocs.c:

Go to the source code of this file.

Functions

static void cluster_destroy (GtsObject *object)
static void cluster_add (GtsCluster *c, GtsPoint *p, gpointer data)
static void cluster_update (GtsCluster *c)
static void cluster_class_init (GtsClusterClass *klass)
static void cluster_init (GtsCluster *c)
GtsClusterClassgts_cluster_class (void)
GtsClustergts_cluster_new (GtsClusterClass *klass, GtsClusterId id, GtsVertexClass *vklass)
void gts_cluster_add (GtsCluster *c, GtsPoint *p, gpointer data)
void gts_cluster_update (GtsCluster *c)
static void destroy_cluster (GtsClusterId *id, GtsObject *cluster)
static void cluster_grid_destroy (GtsObject *object)
static void cluster_grid_class_init (GtsClusterGridClass *klass)
static gint cluster_id_equal (gconstpointer v1, gconstpointer v2)
static guint cluster_id_hash (gconstpointer key)
static void cluster_grid_init (GtsClusterGrid *cluster_grid)
GtsClusterGridClassgts_cluster_grid_class (void)
GtsClusterGridgts_cluster_grid_new (GtsClusterGridClass *klass, GtsClusterClass *cluster_class, GtsSurface *s, GtsBBox *bbox, gdouble delta)
static GtsClusterId cluster_index (GtsPoint *p, GtsBBox *bb, GtsVector n)
static GtsClustercluster_grid_add_point (GtsClusterGrid *cluster_grid, GtsPoint *p, gpointer data)
void gts_cluster_grid_add_triangle (GtsClusterGrid *cluster_grid, GtsPoint *p1, GtsPoint *p2, GtsPoint *p3, gpointer data)
static void update_cluster (gint *id, GtsCluster *cluster, GtsRange *stats)
GtsRange gts_cluster_grid_update (GtsClusterGrid *cluster_grid)

Function Documentation

static void cluster_add ( GtsCluster c,
GtsPoint p,
gpointer  data 
) [static]

Definition at line 34 of file oocs.c.

References GTS_POINT, _GtsCluster::n, _GtsCluster::v, _GtsPoint::x, _GtsPoint::y, and _GtsPoint::z.

Referenced by cluster_class_init().

static void cluster_class_init ( GtsClusterClass klass) [static]

Definition at line 65 of file oocs.c.

References _GtsClusterClass::add, cluster_add(), cluster_destroy(), cluster_update(), GTS_OBJECT_CLASS, and _GtsClusterClass::update.

Referenced by gts_cluster_class().

Here is the call graph for this function:

static void cluster_destroy ( GtsObject object) [static]

Definition at line 23 of file oocs.c.

References c, GTS_CLUSTER, gts_cluster_class(), GTS_OBJECT, GTS_OBJECT_CLASS, gts_object_destroy(), gts_vertex_is_unattached(), and _GtsCluster::v.

Referenced by cluster_class_init().

Here is the call graph for this function:

static GtsCluster* cluster_grid_add_point ( GtsClusterGrid cluster_grid,
GtsPoint p,
gpointer  data 
) [static]
static void cluster_grid_class_init ( GtsClusterGridClass klass) [static]

Definition at line 172 of file oocs.c.

References cluster_grid_destroy(), and GTS_OBJECT_CLASS.

Referenced by gts_cluster_grid_class().

Here is the call graph for this function:

static void cluster_grid_destroy ( GtsObject object) [static]

Definition at line 160 of file oocs.c.

References _GtsClusterGrid::clusters, destroy_cluster(), GTS_CLUSTER_GRID, gts_cluster_grid_class(), and GTS_OBJECT_CLASS.

Referenced by cluster_grid_class_init().

Here is the call graph for this function:

static void cluster_grid_init ( GtsClusterGrid cluster_grid) [static]
static gint cluster_id_equal ( gconstpointer  v1,
gconstpointer  v2 
) [static]

Definition at line 177 of file oocs.c.

References _GtsClusterId::x, _GtsClusterId::y, and _GtsClusterId::z.

Referenced by cluster_grid_init().

static guint cluster_id_hash ( gconstpointer  key) [static]

Definition at line 185 of file oocs.c.

References _GtsClusterId::x.

Referenced by cluster_grid_init().

static GtsClusterId cluster_index ( GtsPoint p,
GtsBBox bb,
GtsVector  n 
) [static]
static void cluster_init ( GtsCluster c) [static]

Definition at line 73 of file oocs.c.

References _GtsCluster::n, and _GtsCluster::v.

Referenced by gts_cluster_class().

static void cluster_update ( GtsCluster c) [static]

Definition at line 50 of file oocs.c.

References GTS_POINT, _GtsCluster::n, _GtsCluster::v, _GtsPoint::x, _GtsPoint::y, and _GtsPoint::z.

Referenced by cluster_class_init().

static void destroy_cluster ( GtsClusterId id,
GtsObject cluster 
) [static]

Definition at line 155 of file oocs.c.

References gts_object_destroy().

Referenced by cluster_grid_destroy().

Here is the call graph for this function:

void gts_cluster_add ( GtsCluster c,
GtsPoint p,
gpointer  data 
)

gts_cluster_add: : a GtsCluster. : a GtsPoint. : data to pass to the add() virtual method of GtsClusterClass.

Adds point to cluster .

Definition at line 133 of file oocs.c.

References GTS_CLUSTER_CLASS, and GTS_OBJECT.

Referenced by cluster_grid_add_point().

GtsClusterClass* gts_cluster_class ( void  )

gts_cluster_class:

Returns: the GtsClusterClass.

Definition at line 84 of file oocs.c.

References cluster_class_init(), cluster_init(), gts_object_class(), and gts_object_class_new().

Referenced by cluster_destroy(), and cluster_grid_init().

Here is the call graph for this function:

void gts_cluster_grid_add_triangle ( GtsClusterGrid cluster_grid,
GtsPoint p1,
GtsPoint p2,
GtsPoint p3,
gpointer  data 
)

gts_cluster_grid_add_triangle: : a GtsClusterGrid. : a GtsPoint. : a GtsPoint. : a GtsPoint. : user data to pass to the cluster add() method.

Adds the triangle defined by , and to the respective clusters of .

Definition at line 316 of file oocs.c.

References cluster_grid_add_point(), _GtsSurface::edge_class, _GtsSurface::face_class, FALSE, GTS_EDGE, gts_edge_new(), gts_face_new(), gts_surface_add_face(), gts_triangle_use_edges(), gts_vertices_are_connected(), _GtsClusterGrid::surface, TRUE, and _GtsCluster::v.

Here is the call graph for this function:

GtsClusterGridClass* gts_cluster_grid_class ( void  )

gts_cluster_grid_class:

Returns: the GtsClusterGridClass.

Definition at line 205 of file oocs.c.

References cluster_grid_class_init(), cluster_grid_init(), gts_object_class(), and gts_object_class_new().

Referenced by cluster_grid_destroy().

Here is the call graph for this function:

GtsClusterGrid* gts_cluster_grid_new ( GtsClusterGridClass klass,
GtsClusterClass cluster_class,
GtsSurface s,
GtsBBox bbox,
gdouble  delta 
)

gts_cluster_grid_new: : a GtsClusterGridClass. : the klass to be used for the vertex clusters. : the simplified surface. : bounding box of the surface to be simplified. : the size of one grid cell of the simplification grid.

Returns: a new GtsClusterGrid.

Definition at line 235 of file oocs.c.

References _GtsClusterGrid::bbox, _GtsClusterGrid::cluster_class, GTS_CLUSTER_GRID, GTS_OBJECT_CLASS, gts_object_new(), s, _GtsClusterGrid::size, _GtsClusterGrid::surface, _GtsBBox::x1, _GtsBBox::x2, _GtsBBox::y1, _GtsBBox::y2, _GtsBBox::z1, and _GtsBBox::z2.

Here is the call graph for this function:

GtsRange gts_cluster_grid_update ( GtsClusterGrid cluster_grid)

gts_cluster_grid_update: : a GtsClusterGrid.

Updates the representative vertices of all the clusters of .

Returns: a GtsRange describing the statistics for the number of vertices added to each cluster of .

Definition at line 375 of file oocs.c.

References _GtsClusterGrid::clusters, gts_range_init(), gts_range_update(), and update_cluster().

Here is the call graph for this function:

GtsCluster* gts_cluster_new ( GtsClusterClass klass,
GtsClusterId  id,
GtsVertexClass vklass 
)

gts_cluster_new: : a GtsClusterClass. : the id of the new cluster. : a GtsVertexClass for the representative vertex of the cluster.

Returns: a new GtsCluster.

Definition at line 112 of file oocs.c.

References c, GTS_CLUSTER, GTS_OBJECT_CLASS, gts_object_new(), gts_vertex_new(), _GtsCluster::id, and _GtsCluster::v.

Referenced by cluster_grid_add_point().

Here is the call graph for this function:

void gts_cluster_update ( GtsCluster c)

gts_cluster_update: : a GtsCluster.

Updates the position of the vertex representative of all the vertices added to .

Definition at line 148 of file oocs.c.

References GTS_CLUSTER_CLASS, and GTS_OBJECT.

Referenced by update_cluster().

static void update_cluster ( gint *  id,
GtsCluster cluster,
GtsRange stats 
) [static]

Definition at line 360 of file oocs.c.

References gts_cluster_update(), gts_range_add_value(), and _GtsCluster::n.

Referenced by gts_cluster_grid_update().

Here is the call graph for this function: