您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Collapse函数代码示例

51自学网 2021-06-01 20:12:13
  C++
这篇教程C++ Collapse函数代码示例写得很实用,希望能帮到您。

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

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

示例1: Expand

static voidExpand(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,


示例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,


示例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,


示例4: WXUNUSED

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


示例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,


示例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,


示例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,


示例8: DesEncrypt

static voidDesEncrypt( 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,


示例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,


示例10: Collapse

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


示例11: Expand

static voidExpand(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,


示例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,


示例13: ModalClose

static voidModalClose(AG_Event *event){	AG_UCombo *com = AG_PTR(1);	if (com->panel != NULL)		Collapse(com);}
开发者ID:adsr,项目名称:agar,代码行数:8,


示例14: ModalClose

static voidModalClose(AG_Event *event){    AG_FileSelector *fs = AG_PTR(1);    if (fs->panel != NULL)        Collapse(fs);}
开发者ID:varialus,项目名称:agar,代码行数:8,


示例15: FileChosen

static voidFileChosen(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,


示例16: Collapse

BOOL CDropListBox::Expand(PLIST_ITEM pItem, UINT nCode){	if(pItem == NULL)	{		return FALSE;	}	BOOL bResult = FALSE;	if(nCode == LBE_COLLAPSE)	{		bResult = Collapse(pItem);	}	else if(nCode == LBE_EXPAND)	{		bResult = Expand(pItem);	}	else if(nCode == LBE_TOGGLE)	{		if(pItem->state & ACBIS_COLLAPSED)		{			bResult = Expand(pItem);		}		else		{			bResult = Collapse(pItem);		}	}	if(bResult)	{		SCROLLINFO info;		info.cbSize = sizeof(SCROLLINFO);		if( m_pDropWnd->GetScrollBarPtr()->GetScrollInfo( &info, SIF_ALL|SIF_DISABLENOSCROLL ) )		{			info.nPage = GetBottomIndex() - GetTopIndex();			info.nMax = GetCount()-1;			info.nMin = 0;			m_pDropWnd->GetScrollBarPtr()->SetScrollInfo( &info );		}	}	return bResult;}
开发者ID:killbug2004,项目名称:cosps,代码行数:42,


示例17: Collapse

void pawsTreeNode::CollapseAll(){    pawsTreeNode* child;    Collapse();    child = firstChild;    while(child != NULL)    {        child->CollapseAll();        child = child->GetNextSibling();    }}
开发者ID:Mixone-FinallyHere,项目名称:planeshift,代码行数:12,


示例18: Collapse

	void CustomDropDown::OnItemSelected()	{		auto pressedState = state["pressed"];		if (pressedState)			*pressedState = false;		Collapse();		onSelectedPos(mItemsList->GetSelectedItemPos());		onSelectedItem(mItemsList->GetSelectedItem());		OnSelectionChanged();	}
开发者ID:zenkovich,项目名称:o2,代码行数:12,


示例19: GenerateNormals

/*=================idSurface_Patch::SubdivideExplicit=================*/void idSurface_Patch::SubdivideExplicit( int horzSubdivisions, int vertSubdivisions, bool genNormals, bool removeLinear ) {	int i, j, k, l;	idDrawVert sample[3][3];	int outWidth = ((width - 1) / 2 * horzSubdivisions) + 1;	int outHeight = ((height - 1) / 2 * vertSubdivisions) + 1;	idDrawVert *dv = new idDrawVert[ outWidth * outHeight ];	// generate normals for the control mesh	if ( genNormals ) {		GenerateNormals();	}	int baseCol = 0;	for ( i = 0; i + 2 < width; i += 2 ) {		int baseRow = 0;		for ( j = 0; j + 2 < height; j += 2 ) {			for ( k = 0; k < 3; k++ ) {				for ( l = 0; l < 3; l++ ) {					sample[k][l] = verts[ ((j + l) * width) + i + k ];				}			}			SampleSinglePatch( sample, baseCol, baseRow, outWidth, horzSubdivisions, vertSubdivisions, dv );			baseRow += vertSubdivisions;		}		baseCol += horzSubdivisions;	}	verts.SetNum( outWidth * outHeight );	for ( i = 0; i < outWidth * outHeight; i++ ) {		verts[i] = dv[i];	}	delete[] dv;	width = maxWidth = outWidth;	height = maxHeight = outHeight;	expanded = false;	if ( removeLinear ) {		Expand();		RemoveLinearColumnsRows();		Collapse();	}	// normalize all the lerped normals	if ( genNormals ) {		for ( i = 0; i < width * height; i++ ) {			verts[i].normal.Normalize();		}	}	GenerateIndexes();}
开发者ID:AliKalkandelen,项目名称:quake4,代码行数:57,


示例20: Expand

//-----------------------------------------------------------------------------//!//-----------------------------------------------------------------------------void tEditExpandSideBar::ToggleExpanded(){    bool animate = true;    if( !ExpandedView() )    {             Expand( animate );    }    else    {        Collapse( animate );    }}
开发者ID:dulton,项目名称:53_hero,代码行数:16,


示例21: switch

void ctlTree::NavigateTree(int keyCode){	switch(keyCode)	{		case WXK_LEFT:			{				//If tree item has children and is expanded, collapse it, otherwise select it's parent if has one				wxTreeItemId currItem = GetSelection();				if (ItemHasChildren(currItem) && IsExpanded(currItem))				{					Collapse(currItem);				}				else				{					wxTreeItemId parent = GetItemParent(currItem);					if (parent.IsOk())					{						SelectItem(currItem, false);						SelectItem(parent, true);					}				}			}			break;		case WXK_RIGHT:			{				//If tree item do not have any children ignore it,				//otherwise  expand it if not expanded, and select first child if already expanded				wxTreeItemId currItem = GetSelection();				if(ItemHasChildren(currItem))				{					if (!IsExpanded(currItem))					{						Expand(currItem);					}					else					{						wxCookieType cookie;						wxTreeItemId firstChild = GetFirstChild(currItem, cookie);						SelectItem(currItem, false);						SelectItem(firstChild, true);					}				}			}			break;		default:			wxASSERT_MSG(false, _("Currently handles only right and left arrow key, other keys are working"));			break;	}}
开发者ID:AnnaSkawinska,项目名称:pgadmin3,代码行数:51,


示例22: Collapse

void wxGenericCollapsiblePane::OnButton(wxCommandEvent& event){    if ( event.GetEventObject() != m_pButton )    {        event.Skip();        return;    }    Collapse(!IsCollapsed());    // this change was generated by the user - send the event    wxCollapsiblePaneEvent ev(this, GetId(), IsCollapsed());    GetEventHandler()->ProcessEvent(ev);}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:14,


示例23: Collapse

TiXmlElement* ConfigManager::AssertPath(wxString& path){    Collapse(path);    wxString illegal(_T(" -:./"/'$&()[]<>+#"));    size_t i = 0;    while ((i = path.find_first_of(illegal, i)) != wxString::npos)        path[i] = _T('_');    TiXmlElement *localPath = pathNode ? pathNode : root;    if (path.GetChar(0) == '/')  // absolute path    {        localPath = root;        path = path.Mid(1);    }    if (path.find(_T('/')) != wxString::npos) // need for path walking        to_lower(path);    wxString sub;    while (path.find(_T('/')) != wxString::npos)    {        sub = path.BeforeFirst(_T('/'));        path = path.AfterFirst(_T('/'));        if (localPath != root && sub.IsSameAs(CfgMgrConsts::dotDot))            localPath = localPath->Parent()->ToElement();        else if (sub.GetChar(0) < _T('a') || sub.GetChar(0) > _T('z'))        {            cbThrow(InvalidNameMessage(_T("subpath"), sub, localPath));        }        else        {            TiXmlElement* n = localPath->FirstChildElement(cbU2C(sub));            if (n)                localPath = n;            else                localPath = (TiXmlElement*) localPath->InsertEndChild(TiXmlElement(cbU2C(sub)));        }    }    to_upper(path);    if (!path.IsEmpty() && (path.GetChar(0) < _T('A') || path.GetChar(0) > _T('Z')))        cbThrow(InvalidNameMessage(_T("key"), path, localPath));    return localPath;}
开发者ID:alpha0010,项目名称:codeblocks_sf,代码行数:50,


示例24: GetNextChild

void wxTreeCtrlBase::CollapseAllChildren(const wxTreeItemId& item){    // first (recursively) collapse all the children    wxTreeItemIdValue cookie;    for ( wxTreeItemId idCurr = GetFirstChild(item, cookie);          idCurr.IsOk();          idCurr = GetNextChild(item, cookie) )    {        CollapseAllChildren(idCurr);    }    // then collapse this element too    Collapse(item);}
开发者ID:ACanadianKernel,项目名称:pcsx2,代码行数:14,


示例25: SelectedItem

static voidSelectedItem(AG_Event *event){	AG_Tlist *tl = AG_SELF();	AG_Combo *com = AG_PTR(1);	AG_TlistItem *ti;	AG_ObjectLock(tl);	if ((ti = AG_TlistSelectedItem(tl)) != NULL) {		AG_TextboxSetString(com->tbox, ti->text);		AG_PostEvent(NULL, com, "combo-selected", "%p", ti);	}	AG_ObjectUnlock(tl);	Collapse(com);}
开发者ID:adsr,项目名称:agar,代码行数:15,


示例26: MoveStart

bool MCParagraphCursor::Move(MCParagraphCursorMove p_movement, int4 p_delta){	if (p_delta == 0)		return true;	bool t_moved;	if (p_delta < 0)		t_moved = MoveStart(p_movement, p_delta);	else if (p_delta > 0)		t_moved = MoveFinish(p_movement, p_delta);	Collapse(p_delta);	return t_moved;}
开发者ID:Bjoernke,项目名称:livecode,代码行数:15,


示例27: UpdateSelfTransform

	void CustomDropDown::MoveAndCheckClipping(const Vec2F& delta, const RectF& clipArea)	{		RectF last = mBoundsWithChilds;		mBoundsWithChilds += delta;		mIsClipped = !mBoundsWithChilds.IsIntersects(clipArea);		if (!mIsClipped)			UpdateSelfTransform();		for (auto child : mChildWidgets)			child->MoveAndCheckClipping(delta, clipArea);		if (IsExpanded())			Collapse();	}
开发者ID:zenkovich,项目名称:o2,代码行数:16,


示例28: DesEncrypt

voidDesEncrypt(unsigned char *clear, unsigned char *key, unsigned char *cipher){    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(crypt_key);    Expand(clear, des_input);    encrypt(des_input, 0);    Collapse(des_input, cipher);}
开发者ID:houzhenggang,项目名称:mt7688_mips_ecos,代码行数:16,



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


C++ Collection_addItem函数代码示例
C++ CollCount函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。