Exemple #1
0
static void segment_destroy (GtsObject * object)
{
  GtsSegment * segment = GTS_SEGMENT (object);
  GtsVertex * v1 = segment->v1;
  GtsVertex * v2 = segment->v2;

  v1->segments = g_slist_remove (v1->segments, segment);
  if (!GTS_OBJECT_DESTROYED (v1) &&
      !gts_allow_floating_vertices && v1->segments == NULL)
    gts_object_destroy (GTS_OBJECT (v1));

  v2->segments = g_slist_remove (v2->segments, segment);
  if (!GTS_OBJECT_DESTROYED (v2) &&
      !gts_allow_floating_vertices && v2->segments == NULL)
    gts_object_destroy (GTS_OBJECT (v2));

  (* GTS_OBJECT_CLASS (gts_segment_class ())->parent_class->destroy) (object);
}
Exemple #2
0
static void triangle_destroy (GtsObject * object)
{
    GtsTriangle * triangle = GTS_TRIANGLE (object);
    GtsEdge * e1 = triangle->e1;
    GtsEdge * e2 = triangle->e2;
    GtsEdge * e3 = triangle->e3;

    e1->triangles = g_slist_remove (e1->triangles, triangle);
    if (!GTS_OBJECT_DESTROYED (e1) &&
            !gts_allow_floating_edges && e1->triangles == NULL)
        gts_object_destroy (GTS_OBJECT (e1));

    e2->triangles = g_slist_remove (e2->triangles, triangle);
    if (!GTS_OBJECT_DESTROYED (e2) &&
            !gts_allow_floating_edges && e2->triangles == NULL)
        gts_object_destroy (GTS_OBJECT (e2));

    e3->triangles = g_slist_remove (e3->triangles, triangle);
    if (!GTS_OBJECT_DESTROYED (e3) &&
            !gts_allow_floating_edges && e3->triangles == NULL)
        gts_object_destroy (GTS_OBJECT (e3));

    (* GTS_OBJECT_CLASS (gts_triangle_class ())->parent_class->destroy) (object);
}