Esempio n. 1
0
/*! \brief create a new net object
 *  \par Function Description
 *  This function creates and returns a new net object.
 *  
 *  \param [in]     toplevel    The TOPLEVEL object.
 *  \param [in]     type        The OBJECT type (usually OBJ_NET)
 *  \param [in]     color       The color of the net
 *  \param [in]     x1          x-coord of the first point
 *  \param [in]     y1          y-coord of the first point
 *  \param [in]     x2          x-coord of the second point
 *  \param [in]     y2          y-coord of the second point
 *  \return A new net OBJECT
 */
OBJECT *o_net_new(TOPLEVEL *toplevel, char type,
		  int color, int x1, int y1, int x2, int y2)
{
  OBJECT *new_node;

  new_node = s_basic_new_object(type, "net");
  new_node->color = color;

  new_node->line = (LINE *) g_malloc(sizeof(LINE));
  /* check for null */

  new_node->line->x[0] = x1;
  new_node->line->y[0] = y1;
  new_node->line->x[1] = x2;
  new_node->line->y[1] = y2;
  new_node->line_width = NET_WIDTH;

  o_net_recalc (toplevel, new_node);

  new_node->draw_func = net_draw_func;
  new_node->sel_func = select_func;

  if (!toplevel->ADDING_SEL) {
    s_tile_add_object (toplevel, new_node);
    s_conn_update_object (toplevel, new_node);
  }

  return new_node;
}
Esempio n. 2
0
/*! \brief add an object to the tile ssytem
 *  \par Function Description
 *  This function takes dispatches the object to the correct
 *  function, depending on its type.
 *
 *  \param toplevel The TOPLEVEL structure
 *  \param object The line OBJECT to add
 */
void s_tile_add_object (TOPLEVEL *toplevel, OBJECT *object)
{
  GList *iter;

  switch (object->type) {
    case OBJ_NET:
    case OBJ_PIN:
    case OBJ_BUS:
      s_tile_add_line_object (toplevel, object);
      break;

  case OBJ_COMPLEX:
  case OBJ_PLACEHOLDER:
    for (iter = object->complex->prim_objs;
         iter != NULL;
         iter = g_list_next (iter)) {
      s_tile_add_object (toplevel, iter->data);
    }
  }
}
Esempio n. 3
0
/*! \brief update the tile informations of an object
 *  \par Function Description
 *  This function updates the tile informations of an object.
 *  This function can be used if an object has been moved on the page
 *  \param toplevel The TOPLEVEL structure
 *  \param object The OBJECT to update
 */
void s_tile_update_object(TOPLEVEL * toplevel, OBJECT * object)
{
  s_tile_remove_object (object);
  s_tile_add_object (toplevel, object);
}