コード例 #1
0
ファイル: x_autonumber.c プロジェクト: rlutz/geda-gaf
/** @brief Removes the number from the element.
 *
 *  This function updates the text content of the \a o_current object.
 *
 *  @param autotext Pointer to the state structure
 *  @param o_current Pointer to the object from which to remove the number
 *
 */
void autonumber_remove_number(AUTONUMBER_TEXT * autotext, OBJECT *o_current)
{
  OBJECT *o_parent, *o_slot;
  gchar *slot_str;
  gchar *str = NULL;

  /* replace old text */
  str = g_strdup_printf("%s?", autotext->current_searchtext);
  o_text_set_string (autotext->w_current->toplevel, o_current, str);
  g_free (str);

  /* remove the slot attribute if slotting is active */
  if (autotext->slotting) {
    /* get the slot attribute */
    o_parent = o_current->attached_to;
    if (o_parent != NULL) {
      slot_str = s_slot_search_slot (o_parent, &o_slot);
      g_free (slot_str);
      /* Only attempt to remove non-inherited slot attributes */
      if (o_slot != NULL && !o_attrib_is_inherited (o_slot)) {
        /* delete the slot attribute */
        o_delete (autotext->w_current, o_slot);
      }
    }
  }

  gschem_toplevel_page_content_changed (autotext->w_current,
                                        autotext->w_current->toplevel->page_current);
}
コード例 #2
0
ファイル: GraphicMgr.cpp プロジェクト: whwayne/otokowantmiku
GraphicMgr::~GraphicMgr()
{
	if (m_pPipeline)
	{
		o_delete(m_pPipeline);
		m_pPipeline = NULL;
	}
	if (m_pRenderer)
	{
		o_delete(m_pRenderer);
		m_pRenderer = NULL;
	}
	if (m_pCullSystem)
	{
		o_delete(m_pCullSystem);
		m_pCullSystem = NULL;
	}
}
コード例 #3
0
ファイル: CullSystem.cpp プロジェクト: whwayne/otokowantmiku
void CullSystem::DestoryOctTree( TreeNode<VisCell>& node )
{
	if (node.GetChildren().size()==8)
	{
		for( int i = 0 ;i<8; i++ )
		{
			if ( node.GetChildren()[i] )
			{
				DestoryOctTree(*node.GetChildren()[i]);
				o_delete(node.GetChildren()[i]);
			}
		}
	}
}
コード例 #4
0
ファイル: o_move.c プロジェクト: vzh/geda-gaf
/*! \todo Finish function documentation!!!
 *  \brief
 *  \par Function Description
 *
 */
void o_move_end_rubberband (GschemToplevel *w_current,
                            int w_dx, int w_dy,
                            GList** objects)
{
  GList *s_iter, *s_iter_next;

  GschemPageView *page_view = gschem_toplevel_get_current_page_view (w_current);
  g_return_if_fail (page_view != NULL);

  PAGE *page = gschem_page_view_get_page (page_view);
  g_return_if_fail (page != NULL);

  for (s_iter = w_current->stretch_list;
       s_iter != NULL; s_iter = s_iter_next) {
    STRETCH *s_current = s_iter->data;
    OBJECT *object = s_current->object;
    int whichone = s_current->whichone;

    /* Store this now, since we may delete the current item */
    s_iter_next = g_list_next (s_iter);

    if (object->type == OBJ_NET ||
        object->type == OBJ_BUS) {

      /* remove the object's connections */
      s_conn_remove_object_connections (page->toplevel, object);

      object->line->x[whichone] += w_dx;
      object->line->y[whichone] += w_dy;

      if (o_move_zero_length (object)) {
        w_current->stretch_list =
          s_stretch_remove (w_current->stretch_list, object);
        o_delete (w_current, object);
        continue;
      }

      object->w_bounds_valid_for = NULL;
      s_conn_update_object (page, object);
      *objects = g_list_append (*objects, object);
    }
  }
}
コード例 #5
0
ファイル: order.c プロジェクト: kiwifb/libhomfly
/* make instructions for handling a single crossing */
static void o_one_make(word      *n,
                       dllink   **boundary,
                       word      *going_in,
                       crossing  *k,
                       word       which,
                       Instruct  *answer)
{
  word  i, done;

  /*  Move one crossing into the solved region */
  o_add(n, boundary, going_in, k, which, answer);

  /*  Join as many adjacent boundary pairs as possible */
  for (done = 0; !done;)
  {
    for (i = *n, done = 1; done && (--i >= 0);)
    {
      if (*n == 2) break;                        /* do not shrink to nothing */
      o_delete(n, boundary, going_in, answer, &done, i);
    }
  }
  answer->newn = *n;
}
コード例 #6
0
ファイル: Feel_Vision.cpp プロジェクト: 2asoft/xray
	void	Vision::feel_vision_update	(CObject* parent, Fvector& P, float dt, float vis_threshold)
	{
		// B-A = objects, that become visible
		if (!seen.empty()) 
		{
			xr_vector<CObject*>::iterator E		= std::remove(seen.begin(),seen.end(),parent);
			seen.resize			(E-seen.begin());

			{
				diff.resize	(_max(seen.size(),query.size()));
				xr_vector<CObject*>::iterator	E = std::set_difference(
					seen.begin(), seen.end(),
					query.begin(),query.end(),
					diff.begin() );
				diff.resize(E-diff.begin());
				for (u32 i=0; i<diff.size(); i++)
					o_new(diff[i]);
			}
		}

		// A-B = objects, that are invisible
		if (!query.empty()) 
		{
			diff.resize	(_max(seen.size(),query.size()));
			xr_vector<CObject*>::iterator	E = std::set_difference(
				query.begin(),query.end(),
				seen.begin(), seen.end(),
				diff.begin() );
			diff.resize(E-diff.begin());
			for (u32 i=0; i<diff.size(); i++)
				o_delete(diff[i]);
		}

		// Copy results and perform traces
		query				= seen;
		o_trace				(P,dt,vis_threshold);
	}
コード例 #7
0
void PolymorphicArrayClass::destroyBundle( serialization::Bundle* a_pBundle ) const
{
    o_delete(serialization::native::TBundle<util::PolymorphicArray>) a_pBundle;
}