//------------------------------------------- BOOL CExpandDialog::expand(BOOL bExpand) { BOOL bShouldExpand; // if the current state matches the flag passed into this // routine, then there is no need to do anything. Note that // the virtual functions OnDialogExpanding and OnDialogExpanded // are not called. if (bExpand == m_bExpanded) return TRUE; // call the virtual function to see if it is OK to expand the dialog. bShouldExpand = onDialogExpanding(m_bExpanded); // if OnDialogExpanding returns OK (TRUE), then call the appropriate // functions to expand the dialog. if (bShouldExpand) { expandBox(bExpand); // call the notification for the post-expand onDialogExpanded(m_bExpanded); } return(m_bExpanded == bExpand); }
void treeInit(cellptr * root, bodyptr bodies, int nbody, real * rootSize) { bodyptr p; (*rootSize) = 1.0; /* Count the root size */ (*rootSize) = expandBox(*root, *rootSize, bodies, nbody); (*root) = treeCreateCell(); /* Foreach bodies */ int i = 0; for (p = bodies; p < bodies + nbody; p++) { /* Insert into tree */ treeInsert(root, *rootSize, p); } calculateCenterOfMass(*root); makeThread((nodeptr) * root, NULL); }