Esempio n. 1
0
void SCENEGRAPH::unlinkNode( const SGNODE* aNode, bool isChild )
{
    if( NULL == aNode )
        return;

    switch( aNode->GetNodeType() )
    {
        case S3D::SGTYPE_TRANSFORM:
            UNLINK_NODE( S3D::SGTYPE_TRANSFORM, SCENEGRAPH, aNode, m_Transforms, m_RTransforms, isChild );
            break;

        case S3D::SGTYPE_SHAPE:
            UNLINK_NODE( S3D::SGTYPE_SHAPE, SGSHAPE, aNode, m_Shape, m_RShape, isChild );
            break;

        default:
            break;
    }

    #ifdef DEBUG
    do {
        std::ostringstream ostr;
        ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
        ostr << " * [BUG] unlinkNode() did not find its target";
        wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
    } while( 0 );
    #endif

    return;
}
Esempio n. 2
0
File: glbl.c Progetto: slewsys/ed
/*
 * next_global_node: Pop node from top of global queue; return line
 *   node pointer.
 */
static ed_line_node_t *
next_global_node (ed_buffer_t *ed)
{
  ed_global_node_t *ap = ed->core->global_head->q_forw;
  ed_line_node_t *lp = ap->lp;

  if (ap != ed->core->global_head)
    {
      spl1 ();
      UNLINK_NODE (ap);
      free (ap);
      spl0 ();
    }
  return lp;
}
Esempio n. 3
0
File: glbl.c Progetto: slewsys/ed
/* delete_global_nodes: Delete range of global nodes, excluding end. */
void
delete_global_nodes (const ed_line_node_t *begin, const ed_line_node_t *end,
                     ed_buffer_t *ed)
{
  ed_line_node_t *first = (ed_line_node_t *) begin;
  ed_line_node_t *last = (ed_line_node_t *) end;
  ed_global_node_t *from, *to, *next;

  /* Assert: get_line_node_address (first) <= get_line_node_address (last) */

  SEEK_GLOBAL_LINE (from, ed->core->global_head, first, last);

  if (first != last)
    SEEK_GLOBAL_LINE (to, from->q_forw, last, ed->core->line_head);

  /* Assert: spl1 () */

  for (; from != ed->core->global_head && from->lp != last; from = next)
    {
      next = from->q_forw;
      UNLINK_NODE (from);
      free (from);
    }
}