pcb 4.1.1
An interactive printed circuit board layout editor.

vertex.c File Reference

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

Go to the source code of this file.

Defines

#define edge_use_vertex(e, v)

Functions

static void vertex_destroy (GtsObject *object)
static void vertex_clone (GtsObject *clone, GtsObject *object)
static void vertex_class_init (GtsVertexClass *klass)
static void vertex_init (GtsVertex *vertex)
GtsVertexClassgts_vertex_class (void)
GtsVertexgts_vertex_new (GtsVertexClass *klass, gdouble x, gdouble y, gdouble z)
void gts_vertex_replace (GtsVertex *v, GtsVertex *with)
gboolean gts_vertex_is_unattached (GtsVertex *v)
GtsSegmentgts_vertices_are_connected (GtsVertex *v1, GtsVertex *v2)
GSList * gts_vertices_from_segments (GSList *segments)
GSList * gts_vertex_triangles (GtsVertex *v, GSList *list)
GSList * gts_vertex_faces (GtsVertex *v, GtsSurface *surface, GSList *list)
GSList * gts_vertex_neighbors (GtsVertex *v, GSList *list, GtsSurface *surface)
gboolean gts_vertex_is_boundary (GtsVertex *v, GtsSurface *surface)
GList * gts_vertices_merge (GList *vertices, gdouble epsilon, gboolean(*check)(GtsVertex *, GtsVertex *))
static GSList * edge_fan_list (GtsVertex *v, GtsSurface *surface, GtsFace *f, GtsEdge *e, GtsFace *first)
GSList * gts_vertex_fan_oriented (GtsVertex *v, GtsSurface *surface)
static GtsEdgereplace_vertex (GtsTriangle *t, GtsEdge *e1, GtsVertex *v, GtsVertex *with)
static void triangle_next (GtsEdge *e, GtsVertex *v, GtsVertex *with)
guint gts_vertex_is_contact (GtsVertex *v, gboolean sever)
static void vertex_normal_attributes (GtsVertex *v, GtsObject *e, GtsObject *t)
static void gts_vertex_normal_class_init (GtsVertexClass *klass)
GtsVertexClassgts_vertex_normal_class (void)
GtsVertexClassgts_color_vertex_class (void)

Variables

gboolean gts_allow_floating_vertices = FALSE

Define Documentation

#define edge_use_vertex (   e,
 
)
Value:
(GTS_SEGMENT(e)->v1 == v ||\
                               GTS_SEGMENT(e)->v2 == v)

Definition at line 563 of file vertex.c.

Referenced by replace_vertex().


Function Documentation

static GSList* edge_fan_list ( GtsVertex v,
GtsSurface surface,
GtsFace f,
GtsEdge e,
GtsFace first 
) [static]

Definition at line 440 of file vertex.c.

References gts_face_has_parent_surface(), GTS_IS_FACE, GTS_SEGMENT, GTS_TRIANGLE, neighbor(), and _GtsEdge::triangles.

Referenced by gts_vertex_fan_oriented().

Here is the call graph for this function:

GtsVertexClass* gts_color_vertex_class ( void  )

Definition at line 760 of file vertex.c.

References GTS_OBJECT_CLASS, gts_object_class_new(), and gts_vertex_class().

Here is the call graph for this function:

GSList* gts_vertex_faces ( GtsVertex v,
GtsSurface surface,
GSList *  list 
)

gts_vertex_faces: : a GtsVertex. : a GtsSurface or NULL. : a list of GtsFace.

Adds all the GtsFace belonging to (if not NULL) which share as a vertex and do not already belong to .

Returns: the new list of unique GtsFace belonging to which share as a vertex.

Definition at line 259 of file vertex.c.

References GTS_EDGE, GTS_FACE, gts_face_has_parent_surface(), GTS_IS_EDGE, GTS_IS_FACE, s, and _GtsVertex::segments.

Referenced by gts_vertex_gaussian_curvature(), gts_vertex_mean_curvature_normal(), and gts_vertex_principal_directions().

Here is the call graph for this function:

GSList* gts_vertex_fan_oriented ( GtsVertex v,
GtsSurface surface 
)

gts_vertex_fan_oriented: : a GtsVertex. : a GtsSurface.

Returns: a list of GtsEdge describing in counterclockwise order the boundary of the fan of summit , the faces of the fan belonging to .

Definition at line 495 of file vertex.c.

References edge_fan_list(), f, gts_face_has_parent_surface(), GTS_IS_EDGE, GTS_IS_FACE, GTS_TRIANGLE, gts_triangle_vertices_edges(), _GtsVertex::segments, and _GtsEdge::triangles.

Referenced by gts_delaunay_remove_vertex(), gts_vertex_gaussian_curvature(), and gts_vertex_mean_curvature_normal().

Here is the call graph for this function:

gboolean gts_vertex_is_boundary ( GtsVertex v,
GtsSurface surface 
)

gts_vertex_is_boundary: : a GtsVertex. : a GtsSurface or NULL.

Returns: TRUE if is used by a GtsEdge boundary of as determined by gts_edge_is_boundary(), FALSE otherwise.

Definition at line 331 of file vertex.c.

References FALSE, gts_edge_is_boundary(), GTS_IS_EDGE, _GtsVertex::segments, and TRUE.

Referenced by gts_edge_collapse_is_valid(), gts_vertex_gaussian_curvature(), and gts_vertex_mean_curvature_normal().

Here is the call graph for this function:

guint gts_vertex_is_contact ( GtsVertex v,
gboolean  sever 
)

gts_vertex_is_contact: : a GtsVertex. : if TRUE and if is a contact vertex between two or more sets of connected triangles replaces it with as many vertices, clones of .

Returns: the number of sets of connected triangles sharing as a contact vertex.

Definition at line 621 of file vertex.c.

References GTS_OBJECT, gts_object_clone(), GTS_VERTEX, gts_vertex_triangles(), replace_vertex(), and triangle_next().

Referenced by gts_psurface_new().

Here is the call graph for this function:

gboolean gts_vertex_is_unattached ( GtsVertex v)

gts_vertex_is_unattached: : a GtsVertex.

Returns: TRUE if is not the endpoint of any GtsSegment, FALSE otherwise.

Definition at line 149 of file vertex.c.

References FALSE, _GtsVertex::segments, and TRUE.

Referenced by cluster_destroy().

GSList* gts_vertex_neighbors ( GtsVertex v,
GSList *  list,
GtsSurface surface 
)

gts_vertex_neighbors: : a GtsVertex. : a list of GtsVertex. : a GtsSurface or NULL.

Adds to all the GtsVertex connected to by a GtsSegment and not already in . If is not NULL only the vertices connected to by an edge belonging to are considered.

Returns: the new list of unique GtsVertex.

Definition at line 300 of file vertex.c.

References GTS_EDGE, gts_edge_has_parent_surface(), GTS_IS_EDGE, s, _GtsVertex::segments, _GtsSegment::v1, and _GtsSegment::v2.

Referenced by check_adj_pushing_vertex(), delaunay_check(), edge_shape_cost(), and gts_volume_optimized_vertex().

Here is the call graph for this function:

GtsVertex* gts_vertex_new ( GtsVertexClass klass,
gdouble  x,
gdouble  y,
gdouble  z 
)

gts_vertex_new: : a GtsVertexClass. : the x-coordinate of the vertex to create. : the y-coordinate of the vertex to create. : the y-coordinate of the vertex to create.

Returns: a new GtsVertex with , and as coordinates.

Definition at line 100 of file vertex.c.

References GTS_OBJECT_CLASS, gts_object_new(), GTS_POINT, gts_point_set(), and GTS_VERTEX.

Referenced by create_board_edge(), foreach_vertex_copy(), generate_icosahedron(), get_vertex(), get_vertex_bcl(), gts_cluster_new(), gts_iso_slice_fill(), gts_iso_slice_fill_cartesian(), gts_segment_midvertex(), gts_triangle_enclosing(), gts_volume_optimized_vertex(), insert_centre_point(), insert_constraint_edge(), insert_vertex(), new_temp_toporoutervertex(), read_lines(), rect_with_attachments(), split_edge(), unit_sphere_arc_midvertex(), and vertex_intersect().

Here is the call graph for this function:

GtsVertexClass* gts_vertex_normal_class ( void  )

Definition at line 737 of file vertex.c.

References GTS_OBJECT_CLASS, gts_object_class_new(), gts_vertex_class(), and gts_vertex_normal_class_init().

Here is the call graph for this function:

static void gts_vertex_normal_class_init ( GtsVertexClass klass) [static]

Definition at line 732 of file vertex.c.

References _GtsVertexClass::intersection_attributes, and vertex_normal_attributes().

Referenced by gts_vertex_normal_class().

Here is the call graph for this function:

void gts_vertex_replace ( GtsVertex v,
GtsVertex with 
)

gts_vertex_replace: : a GtsVertex. : another GtsVertex.

Replaces vertex with vertex . and must be different. All the GtsSegment which have has one of their vertices are updated. The segments list of vertex is freed and ->segments is set to NULL.

Definition at line 121 of file vertex.c.

References s, _GtsVertex::segments, _GtsSegment::v1, and _GtsSegment::v2.

Referenced by edge_collapse(), and gts_vertices_merge().

GSList* gts_vertex_triangles ( GtsVertex v,
GSList *  list 
)

gts_vertex_triangles: : a GtsVertex. : a list of GtsTriangle.

Adds all the GtsTriangle which share as a vertex and do not already belong to .

Returns: the new list of unique GtsTriangle which share as a vertex.

Definition at line 224 of file vertex.c.

References GTS_EDGE, GTS_IS_EDGE, s, and _GtsVertex::segments.

Referenced by compute_candidate_points(), edge_volume_cost(), gts_delaunay_remove_vertex(), gts_edge_collapse_creates_fold(), gts_edge_is_contact(), gts_psurface_new(), gts_split_collapse(), gts_vertex_is_contact(), gts_volume_optimized_vertex(), remove_intersected_vertex(), and vertex_encroaches().

GSList* gts_vertices_from_segments ( GSList *  segments)

gts_vertices_from_segments: : a list of GtsSegment.

Returns: a list of GtsVertex, vertices of a GtsSegment in . Each element in the list is unique (no duplicates).

Definition at line 190 of file vertex.c.

References hash(), s, _GtsSegment::v1, and _GtsSegment::v2.

Here is the call graph for this function:

GList* gts_vertices_merge ( GList *  vertices,
gdouble  epsilon,
gboolean(*)(GtsVertex *, GtsVertex *)  check 
)

gts_vertices_merge: : a list of GtsVertex. : half the size of the bounding box to consider for each vertex. : function called for each pair of vertices about to be merged or NULL.

For each vertex v in look if there are any vertex of contained in a box centered on v of size 2*. If there are and if is not NULL and returns TRUE, replace them with v (using gts_vertex_replace()), destroy them and remove them from list. This is done efficiently using Kd-Trees.

Returns: the updated list of vertices.

Definition at line 363 of file vertex.c.

References check, FALSE, gts_allow_floating_vertices, gts_bbox_class(), gts_bbox_new(), gts_kdtree_destroy, gts_kdtree_new(), gts_kdtree_range(), GTS_OBJECT, gts_object_destroy(), GTS_POINT, gts_vertex_replace(), selected, TRUE, x, and y.

Here is the call graph for this function:

static GtsEdge* replace_vertex ( GtsTriangle t,
GtsEdge e1,
GtsVertex v,
GtsVertex with 
) [static]
static void triangle_next ( GtsEdge e,
GtsVertex v,
GtsVertex with 
) [static]

Definition at line 593 of file vertex.c.

References GTS_OBJECT, replace_vertex(), and _GtsEdge::triangles.

Referenced by gts_vertex_is_contact().

Here is the call graph for this function:

static void vertex_class_init ( GtsVertexClass klass) [static]

Definition at line 53 of file vertex.c.

References GTS_OBJECT_CLASS, _GtsVertexClass::intersection_attributes, vertex_clone(), and vertex_destroy().

Referenced by gts_vertex_class().

Here is the call graph for this function:

static void vertex_clone ( GtsObject clone,
GtsObject object 
) [static]

Definition at line 46 of file vertex.c.

References GTS_OBJECT_CLASS, GTS_VERTEX, and gts_vertex_class().

Referenced by vertex_class_init().

Here is the call graph for this function:

static void vertex_destroy ( GtsObject object) [static]

Definition at line 25 of file vertex.c.

References GTS_DESTROYED, GTS_OBJECT_CLASS, gts_object_destroy(), GTS_OBJECT_SET_FLAGS, GTS_VERTEX, gts_vertex_class(), and _GtsVertex::segments.

Referenced by vertex_class_init().

Here is the call graph for this function:

static void vertex_init ( GtsVertex vertex) [static]

Definition at line 60 of file vertex.c.

References _GtsVertex::segments.

Referenced by gts_vertex_class().

static void vertex_normal_attributes ( GtsVertex v,
GtsObject e,
GtsObject t 
) [static]

Variable Documentation

gboolean gts_allow_floating_vertices = FALSE

Definition at line 23 of file vertex.c.