ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/sm_del.c
(Generate patch)

Comparing ray/src/hd/sm_del.c (file contents):
Revision 3.9 by gwlarson, Tue Jan 5 16:52:37 1999 UTC vs.
Revision 3.10 by gwlarson, Sun Jan 10 10:27:46 1999 UTC

# Line 27 | Line 27 | int id;
27  
28    tri = SM_NTH_TRI(sm,id);
29    /* Add to the free_list */
30 <
30 >  smClear_tri_flags(sm,id);
31    T_NEXT_FREE(tri) = SM_FREE_TRIS(sm);
32    SM_FREE_TRIS(sm) = id;
33    T_VALID_FLAG(tri) = -1;
# Line 48 | Line 48 | int t_id;
48       point to tri id as being the first triangle pointer
49    */
50    SM_SAMPLE_TRIS(sm)--;
51 <  if(!SM_IS_NTH_T_BASE(sm,t_id))
52 <  {
51 >  if(SM_IS_NTH_T_NEW(sm,t_id))
52 >     smNew_tri_cnt--;
53  
54 #if 0
55    if(SM_IS_NTH_T_NEW(sm,t_id))
56      smNew_tri_cnt--;
57 #endif
58  }
54    smClear_tri_flags(sm,t_id);
55  
56    smFree_tri(sm,t_id);
# Line 72 | Line 67 | eNew_edge()
67    if(Ecnt >= Max_edges)
68      {
69        if(Max_edges > 10000)
70 <        error(CONSISTENCY,"Too many edges in vertex loop\n");
70 >      {
71 >        eputs("Too many edges in vertex loop\n");
72 >        return(-1);
73 >      }
74        Max_edges += 100;
75        if(!(Edges = (EDGE *)realloc(Edges,(Max_edges+1)*sizeof(EDGE))))
76          goto memerr;
# Line 104 | Line 102 | LIST **del_ptr;
102      tri = SM_NTH_TRI(sm,t_id);
103  
104      e = eNew_edge();
105 +
106      /* Get the  next vertex on the polygon boundary */
107      v_id = T_WHICH_V(tri,id);
108      b_id = (v_id + 1)%3;
# Line 123 | Line 122 | LIST **del_ptr;
122      while((t_next_id = T_NTH_NBR(t_next,b_id)) != t_id)
123      {
124        e = eNew_edge();
125 +      if(e== INVALID)
126 +        return(NULL);
127        t_next = SM_NTH_TRI(sm,t_next_id);
128        SET_E_NTH_VERT(e,0,v_next);
129        SET_E_NTH_TRI(e,0,INVALID);
# Line 468 | Line 469 | smRemoveVertex(sm,id)
469       */
470      del_list = NULL;
471      b_list = smVertexPolygon(sm,id,&del_list);
472 <
472 >    if(!b_list)
473 >    {
474 >      if(del_list)
475 >        free_list(del_list);
476 >      return(FALSE);
477 >    }
478      add_list = NULL;
479      /* Triangulate polygonal hole  */
480      if(!smTriangulate(sm,id,b_list,&add_list))
# Line 478 | Line 484 | smRemoveVertex(sm,id)
484      }
485      else
486      {
481 #ifdef DEBUG
482      b_list = del_list;
483      while(b_list)
484      {
485        t_id = LIST_DATA(b_list);
486        b_list = LIST_NEXT(b_list);
487        T_VALID_FLAG(SM_NTH_TRI(sm,t_id))=-1;
488      }
489 #endif
487        while(del_list)
488        {
489          t_id = pop_list(&del_list);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines