本文整理汇总了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);
}
示例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));
}
示例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".
}
示例4: WXUNUSED
void ExpandingToolBar::OnToggle(wxCommandEvent & WXUNUSED(event))
{
if (mIsExpanded)
Collapse();
else
Expand();
}
示例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".
}
示例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);
}
示例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;
}
示例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
}
示例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();
}
示例10: Collapse
void ExpandingToolBar::OnToggle(wxCommandEvent &evt)
{
if (mIsExpanded)
Collapse();
else
Expand();
}
示例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);
}
}
示例12: GetSelection
void DBTreeCtrl::OnExpand(wxCommandEvent &event)
{
wxTreeItemId sel_item = GetSelection();
if (IsExpanded(sel_item))
Collapse(sel_item);
else
Expand(sel_item);
}
示例13: ModalClose
static void
ModalClose(AG_Event *event)
{
AG_UCombo *com = AG_PTR(1);
if (com->panel != NULL)
Collapse(com);
}
示例14: ModalClose
static void
ModalClose(AG_Event *event)
{
AG_FileSelector *fs = AG_PTR(1);
if (fs->panel != NULL)
Collapse(fs);
}
示例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);
}