GTS Library Reference Manual |
---|
#include <gts.h> #define GTS_SEGMENT_CLASS (klass) #define GTS_SEGMENT (obj) #define GTS_IS_SEGMENT (obj) GtsSegmentClass; GtsSegment; GtsSegmentClass* gts_segment_class (void); GtsSegment* gts_segment_new (GtsSegmentClass *klass, GtsVertex *v1, GtsVertex *v2); #define gts_segments_are_identical (s1, s2) GtsIntersect gts_segments_are_intersecting (GtsSegment *s1, GtsSegment *s2); GtsSegment* gts_segment_is_duplicate (GtsSegment *s);gboolean gts_segment_is_ok (GtsSegment *s); #define gts_segment_connect (s, e1, e2) #define gts_segments_touch (s1, s2)GSList * gts_segments_from_vertices (GSList *vertices); GtsVertex* gts_segment_midvertex (GtsSegment *s, GtsVertexClass *klass);
Segments are defined by their two GtsVertex. They are not oriented.
When destroying a GtsSegment, all the vertices not used by another edge are also destroyed. This default behaviour can be changed punctually by setting the global variable gts_allow_floating_vertices to TRUE. You must not forget to set this variable back to FALSE as all the algorithms of GTS assume the default behaviour.
#define GTS_SEGMENT_CLASS(klass)
Casts klass
to GtsSegmentClass.
klass : | a descendant of GtsSegmentClass. |
#define GTS_IS_SEGMENT(obj)
Evaluates to TRUE if obj
is a descendant of GtsSegment, FALSE otherwise.
obj : | a pointer to test. |
typedef struct { GtsObjectClass parent_class; } GtsSegmentClass;
The segment class. No virtual functions are assiocated.
typedef struct { GtsObject object; GtsVertex * v1; GtsVertex * v2; } GtsSegment;
The segment object.
GtsObject object ; | The parent object. |
GtsVertex *v1 ; | First endpoint of the segment. |
GtsVertex *v2 ; | Second endpoint of the segment. |
GtsSegment* gts_segment_new (GtsSegmentClass *klass, GtsVertex *v1, GtsVertex *v2);
klass : | |
v1 : | a GtsVertex. |
v2 : | another GtsVertex different from |
Returns : | a new GtsSegment linking |
#define gts_segments_are_identical(s1, s2)
Evaluates to TRUE if s1
and s2
link the same vertices, FALSE otherwise.
s1 : | a GtsSegment. |
s2 : | another GtsSegment. |
GtsIntersect gts_segments_are_intersecting (GtsSegment *s1, GtsSegment *s2);
s1 : | a GtsSegment. |
s2 : | a GtsSegment. |
Returns : | GTS_IN if |
GtsSegment* gts_segment_is_duplicate (GtsSegment *s);
s : | a GtsSegment. |
Returns : | the first GtsSegment different from |
gboolean gts_segment_is_ok (GtsSegment *s);
s : | a GtsSegment. |
Returns : | TRUE if |
#define gts_segment_connect(s, e1, e2)
Evaluates to TRUE if s
connects e1
with e2
, FALSE otherwise.
s : | a GtsSegment. |
e1 : | a GtsVertex. |
e2 : | another GtsVertex. |
GSList * gts_segments_from_vertices (GSList *vertices);
vertices : | a list of GtsVertex. |
Returns : | a list of unique GtsSegment which have one of their vertices in
|
GtsVertex* gts_segment_midvertex (GtsSegment *s, GtsVertexClass *klass);
s : | a GtsSegment. |
klass : | a GtsVertexClass to be used for the new vertex. |
Returns : | a new GtsVertex, midvertex of |
<<< Vertices | Edges >>> |