当前位置: 首页>>代码示例>>C++>>正文


C++ Collapse函数代码示例

本文整理汇总了C++中Collapse函数的典型用法代码示例。如果您正苦于以下问题:C++ Collapse函数的具体用法?C++ Collapse怎么用?C++ Collapse使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Collapse函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Expand

static void
Expand(AG_Event *event)
{
	AG_UCombo *com = AG_PTR(1);
	AG_Driver *drv = WIDGET(com)->drv;
	int expand = AG_INT(2);
	AG_SizeReq rList;
	int x, y, w, h;
	Uint wView, hView;

	AG_ObjectLock(com);
	if (expand) {
		com->panel = AG_WindowNew(AG_WINDOW_POPUP|AG_WINDOW_MODAL|
		                          AG_WINDOW_NOTITLE);
		AG_ObjectSetName(com->panel, "_UComboPopup");
		AG_WindowSetPadding(com->panel, 0,0,0,0);
		AG_ObjectAttach(com->panel, com->list);
		if (WIDGET(com)->window != NULL)
			AG_WindowAttach(WIDGET(com)->window, com->panel);
	
		if (com->wSaved > 0) {
			w = com->wSaved;
			h = com->hSaved;
		} else {
			if (com->wPreList != -1 && com->hPreList != -1) {
				AG_TlistSizeHintPixels(com->list,
				    com->wPreList, com->hPreList);
			}
			AG_WidgetSizeReq(com->list, &rList);
			w = rList.w + com->panel->wBorderSide*2;
			h = rList.h + com->panel->wBorderBot;
		}
		x = WIDGET(com)->rView.x2 - w;
		y = WIDGET(com)->rView.y1;
		
		AG_GetDisplaySize(WIDGET(com)->drv, &wView, &hView);
		if (x+w > wView) { w = wView - x; }
		if (y+h > hView) { h = hView - y; }
		
		if (AGDRIVER_CLASS(drv)->wm == AG_WM_MULTIPLE &&
		    WIDGET(com)->window != NULL) {
			x += WIDGET(WIDGET(com)->window)->x;
			y += WIDGET(WIDGET(com)->window)->y;
		}
		if (x < 0) { x = 0; }
		if (y < 0) { y = 0; }
		if (w < 4 || h < 4) {
			Collapse(com);
			return;
		}
		AG_SetEvent(com->panel, "window-modal-close",
		    ModalClose, "%p", com);
		AG_WindowSetGeometry(com->panel, x,y, w,h);
		AG_WindowShow(com->panel);
	} else {
		Collapse(com);
	}
	AG_ObjectUnlock(com);
}
开发者ID:adsr,项目名称:agar,代码行数:59,代码来源:ucombo.c

示例2: GetFoldItem

/** Collapse the fold item at the given index
  * If the panel is already collapsed, nothing happens, and no
  * events are sent, regardless of the value of bSendEvent
  * \param iIndex : the index of the panel to fold
  * \param bSendEvent: if true, an event wxEVT_FOLDPANELEX is sent
  * \return true on success, false on failure (vetoed)
  */
bool wxFoldPanelEx::Collapse(size_t iIndex, bool bSendEvent)
{
    wxFoldItemEx *f;

    f = GetFoldItem(iIndex);
    return(Collapse(f, bSendEvent));
}
开发者ID:danselmi,项目名称:xpmeditor,代码行数:14,代码来源:foldpanelex.cpp

示例3: AddVertex

void Chopper::chop( Array< Vector3 > & vert, Array< Triangle > &tri, 
							Array< int > &map, Array< int > &permutation )
{
	AddVertex(vert);  // put input data into our data structures
	AddFaces(tri);

	ComputeAllEdgeCollapseCosts(); // cache all edge collapse costs

	permutation.allocate(s_Vertices.size());  // allocate space
	map.allocate(s_Vertices.size());          // allocate space

	// reduce the object down to nothing:
	while(s_Vertices.size() > 0) 
	{
		// get the next vertex to collapse
		Vertex *mn = MinimumCostEdge();
		// keep track of this vertex, i.e. the collapse ordering
		permutation[mn->id]=s_Vertices.size()-1;
		// keep track of vertex to which we collapse to
		map[s_Vertices.size()-1] = (mn->collapse)?mn->collapse->id:-1;
		// Collapse this edge
		Collapse(mn,mn->collapse);
	}
	// reorder the map list based on the collapse ordering
	for(int i=0;i<map.size();i++) {
		map[i] = (map[i]==-1)?0:permutation[map[i]];
	}
	// The caller of this function should reorder their vertices
	// according to the returned "permutation".
}
开发者ID:BlackYoup,项目名称:medusa,代码行数:30,代码来源:Chopper.cpp

示例4: WXUNUSED

void ExpandingToolBar::OnToggle(wxCommandEvent & WXUNUSED(event))
{
   if (mIsExpanded)
      Collapse();
   else
      Expand();
}
开发者ID:disinteger1,项目名称:audacity,代码行数:7,代码来源:ExpandingToolBar.cpp

示例5: ProgressiveMesh

void ProgressiveMesh(std::vector<float3> &vert, std::vector<tridata> &tri,
                     std::vector<int> &map, std::vector<int> &permutation)
{
	AddVertex(vert);  // put input data into our data structures
	AddFaces(tri);
	ComputeAllEdgeCollapseCosts(); // cache all edge collapse costs
	permutation.resize(vertices.size());  // allocate space
	map.resize(vertices.size());          // allocate space
	// reduce the object down to nothing:
	while (vertices.size() > 0) {
		// get the next vertex to collapse
		Vertex *mn = MinimumCostEdge();
		// keep track of this vertex, i.e. the collapse ordering
		permutation[mn->id] = vertices.size() - 1;
		// keep track of vertex to which we collapse to
		map[vertices.size() - 1] = (mn->collapse) ? mn->collapse->id : -1;
		// Collapse this edge
		Collapse(mn,mn->collapse);
	}
	// reorder the map Array based on the collapse ordering
	for (unsigned int i = 0; i<map.size(); i++) {
		map[i] = (map[i]==-1)?0:permutation[map[i]];
	}
	// The caller of this function should reorder their vertices
	// according to the returned "permutation".
}
开发者ID:340211173,项目名称:sandbox-1,代码行数:26,代码来源:progmesh.cpp

示例6: Collapse

void CXTPDockingPaneSidePanel::OnPinButtonClick()
{
	if (!m_hWnd)
		return;

	BOOL bPinning = m_bCollapsed;

	if (OnAction(bPinning ? xtpPaneActionPinning : xtpPaneActionUnpinning))
		return;

	if (!m_bCollapsed)
	{
		Collapse(TRUE);
	}
	else
	{
		if (m_nStepsCount != m_nSlideStep)
		{
			SetWindowPos(0, 0, 0, m_rcWindow.Width(), m_rcWindow.Height(), SWP_NOZORDER | SWP_NOMOVE);
		}
		m_bCollapsed = FALSE;
		m_bExpanded = FALSE;

		KillTimer(TID_CHECKACTIVE);
		KillTimer(TID_SLIDEOUT);

	}
	InvalidatePane(FALSE);

	OnAction(bPinning ? xtpPaneActionPinned : xtpPaneActionUnpinned);
}
开发者ID:lai3d,项目名称:ThisIsASoftRenderer,代码行数:31,代码来源:XTPDockingPaneSidePanel.cpp

示例7: Collapse

//------------------------------------------------------------------------
void CVehicleMovementWarrior::EnableThruster(SThruster *pThruster, bool enable)
{
	pThruster->enabled = enable;
	//if (!enable)
	//pThruster->hoverHeight = 0.2f;

	if(!pThruster->pHelper)
	{
		// disable exhaust
		// todo: add direct access to these
		for(std::vector<SExhaustStatus>::iterator it = m_paStats.exhaustStats.begin(); it != m_paStats.exhaustStats.end(); ++it)
		{
			if(it->pHelper == pThruster->pHelper)
			{
				it->enabled = (int)enable;
			}
		}
	}

	int nDamaged = m_thrustersDamaged + (enable ? -1 : 1);

	if(m_maxThrustersDamaged >= 0 && nDamaged >= m_maxThrustersDamaged && m_thrustersDamaged < m_maxThrustersDamaged)
	{
		Collapse();
	}

	m_thrustersDamaged = nDamaged;
}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:29,代码来源:VehicleMovementWarrior.cpp

示例8: DesEncrypt

static void
DesEncrypt( u_char *clear, /* IN  8 octets */
            u_char *key,   /* IN  7 octets */
            u_char *cipher /* OUT 8 octets */)
{
  u_char des_key[8];
  u_char crypt_key[66];
  u_char des_input[66];

  MakeKey(key, des_key);

  Expand(des_key, crypt_key);
  setkey((char*)crypt_key);

#if 0
  CHAPDEBUG(LOG_INFO, ("DesEncrypt: 8 octet input : %02X%02X%02X%02X%02X%02X%02X%02X\n",
             clear[0], clear[1], clear[2], clear[3], clear[4], clear[5], clear[6], clear[7]));
#endif

  Expand(clear, des_input);
  encrypt((char*)des_input, 0);
  Collapse(des_input, cipher);

#if 0
  CHAPDEBUG(LOG_INFO, ("DesEncrypt: 8 octet output: %02X%02X%02X%02X%02X%02X%02X%02X\n",
             cipher[0], cipher[1], cipher[2], cipher[3], cipher[4], cipher[5], cipher[6], cipher[7]));
#endif
}
开发者ID:KonstantinVoip,项目名称:mSdk,代码行数:28,代码来源:chpms.c

示例9: Freeze

void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item)
{
    Freeze();
    // first (recursively) collapse all the children
    wxTreeItemIdValue cookie;
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
#   pragma ivdep
#   pragma swp
#   pragma unroll
#   pragma prefetch
#   if 0
#       pragma simd noassert
#   endif
#endif /* VDM auto patch */
    for ( wxTreeItemId idCurr = GetFirstChild(item, cookie);
          idCurr.IsOk();
          idCurr = GetNextChild(item, cookie) )
    {
        CollapseAllChildren(idCurr);
    }

    // then collapse this element too unless it's the hidden root which can't
    // be collapsed
    if ( item != GetRootItem() || !HasFlag(wxTR_HIDE_ROOT) )
        Collapse(item);
    Thaw();
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:27,代码来源:treebase.cpp

示例10: Collapse

void ExpandingToolBar::OnToggle(wxCommandEvent &evt)
{
   if (mIsExpanded)
      Collapse();
   else
      Expand();
}
开发者ID:Kirushanr,项目名称:audacity,代码行数:7,代码来源:ExpandingToolBar.cpp

示例11: Expand

static void
Expand(AG_Event *event)
{
    AG_FileSelector *fs = AG_PTR(1);
    AG_Driver *drv = WIDGET(fs)->drv;
    int expand = AG_INT(2);
    AG_SizeReq rFileDlg;
    int x, y, w, h;
    Uint wView, hView;

    if (expand) {						/* Expand */
        fs->panel = AG_WindowNew(AG_WINDOW_MODAL|AG_WINDOW_NOTITLE);
        AG_WindowSetPadding(fs->panel, 0, 0, 0, 0);
        AG_ObjectAttach(fs->panel, fs->filedlg);

        if (fs->wSaved > 0) {
            w = fs->wSaved;
            h = fs->hSaved;
        } else {
            AG_WidgetSizeReq(fs->filedlg, &rFileDlg);
            w = rFileDlg.w + fs->panel->wBorderSide*2;
            h = rFileDlg.h + fs->panel->wBorderBot;
        }
        x = WIDGET(fs)->rView.x2 - w;
        y = WIDGET(fs)->rView.y1;

        if (AGDRIVER_SINGLE(drv) &&
                AG_GetDisplaySize(drv, &wView, &hView) == 0) {
            if (x+w > wView) {
                w = wView - x;
            }
            if (y+h > hView) {
                h = hView - y;
            }
        }
        if (w < 4 || h < 4) {
            Collapse(fs);
            return;
        }
        AG_SetEvent(fs->panel, "window-modal-close",
                    ModalClose, "%p", fs);
        AG_WindowSetGeometry(fs->panel, x, y, w, h);
        AG_WindowShow(fs->panel);
    } else {
        Collapse(fs);
    }
}
开发者ID:varialus,项目名称:agar,代码行数:47,代码来源:file_selector.c

示例12: GetSelection

void DBTreeCtrl::OnExpand(wxCommandEvent &event)
{
	wxTreeItemId sel_item = GetSelection();
	if (IsExpanded(sel_item))
		Collapse(sel_item);
	else
		Expand(sel_item);
}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:8,代码来源:DatabaseDlg.cpp

示例13: ModalClose

static void
ModalClose(AG_Event *event)
{
	AG_UCombo *com = AG_PTR(1);

	if (com->panel != NULL)
		Collapse(com);
}
开发者ID:adsr,项目名称:agar,代码行数:8,代码来源:ucombo.c

示例14: ModalClose

static void
ModalClose(AG_Event *event)
{
    AG_FileSelector *fs = AG_PTR(1);

    if (fs->panel != NULL)
        Collapse(fs);
}
开发者ID:varialus,项目名称:agar,代码行数:8,代码来源:file_selector.c

示例15: FileChosen

static void
FileChosen(AG_Event *event)
{
    AG_FileSelector *fs = AG_PTR(1);
    char *path = AG_STRING(2);

    AG_TextboxSetString(fs->tbox, path);
    AG_PostEvent(NULL, fs, "file-chosen", "%s", path);
    Collapse(fs);
}
开发者ID:varialus,项目名称:agar,代码行数:10,代码来源:file_selector.c


注:本文中的Collapse函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。