void ComboTabBar::removeTab(int index) { if (validIndex(index)) { setUpdatesEnabled(false); localTabBar(index)->removeTab(toLocalIndex(index)); updatePinnedTabBarVisibility(); tabRemoved(index); setMinimumWidths(); setUpdatesEnabled(true); updateTabBars(); } }
QRect ComboTabBar::tabRect(int index) const { QRect rect; if (index != -1) { bool mainTabBar = index >= pinnedTabsCount(); rect = localTabBar(index)->tabRect(toLocalIndex(index)); if (mainTabBar) { rect.moveLeft(rect.x() + mapFromGlobal(m_mainTabBar->mapToGlobal(QPoint(0, 0))).x()); QRect widgetRect = m_mainTabBarWidget->scrollArea()->viewport()->rect(); widgetRect.moveLeft(widgetRect.x() + mapFromGlobal(m_mainTabBarWidget->scrollArea()->viewport()->mapToGlobal(QPoint(0, 0))).x()); rect = rect.intersected(widgetRect); } else { rect.moveLeft(rect.x() + mapFromGlobal(m_pinnedTabBar->mapToGlobal(QPoint(0, 0))).x()); QRect widgetRect = m_pinnedTabBarWidget->scrollArea()->viewport()->rect(); widgetRect.moveLeft(widgetRect.x() + mapFromGlobal(m_pinnedTabBarWidget->scrollArea()->viewport()->mapToGlobal(QPoint(0, 0))).x()); rect = rect.intersected(widgetRect); } } return rect; }
QWidget* ComboTabBar::tabButton(int index, QTabBar::ButtonPosition position) const { return localTabBar(index)->tabButton(toLocalIndex(index), position); }
void ComboTabBar::setTabButton(int index, QTabBar::ButtonPosition position, QWidget* widget) { localTabBar(index)->setTabButton(toLocalIndex(index), position, widget); }
QString ComboTabBar::tabToolTip(int index) const { return localTabBar(index)->tabToolTip(toLocalIndex(index)); }
void ComboTabBar::setTabToolTip(int index, const QString &tip) { localTabBar(index)->setTabToolTip(toLocalIndex(index), tip); }
void ComboTabBar::setTabText(int index, const QString &text) { localTabBar(index)->setTabText(toLocalIndex(index), text); }
void ComboTabBar::setCurrentIndex(int index) { return localTabBar(index)->setCurrentIndex(toLocalIndex(index)); }
void ComboTabBar::setTabTextColor(int index, const QColor &color) { localTabBar(index)->setTabTextColor(toLocalIndex(index), color); }
QColor ComboTabBar::tabTextColor(int index) const { return localTabBar(index)->tabTextColor(toLocalIndex(index)); }
void ComboTabBar::setTabEnabled(int index, bool enabled) { localTabBar(index)->setTabEnabled(toLocalIndex(index), enabled); }
bool ComboTabBar::isTabEnabled(int index) const { return localTabBar(index)->isTabEnabled(toLocalIndex(index)); }
void ComboTabBar::setTabButton(int index, QTabBar::ButtonPosition position, QWidget* widget) { if (widget) widget->setMinimumSize(closeButtonSize()); localTabBar(index)->setTabButton(toLocalIndex(index), position, widget); }
void LBNSInitFlagsIterator::iterate(){ IntScalarField & flags = _flowField.getFlags(); // // Left and right faces int k,j,i; for (int globalK = _lowerZ-1; globalK<=_upperZ+1; globalK++) for (int globalJ = _lowerY-1; globalJ <= _upperY+1; globalJ++) for(int globalI = _lowerX-1; globalI<=_upperX+1; globalI++){ if(toLocalIndex(globalI,globalJ,globalK,i,j,k)){ if( globalK>=_lowerZ&&globalK<=_upperZ && globalJ>=_lowerY&&globalJ<=_upperY&& globalI>=_lowerX&&globalI<=_upperX){ flags.getValue(i, j, k) = OBSTACLE_SELF; if( globalK>_lowerZ&&globalK<_upperZ && globalJ>_lowerY&&globalJ<_upperY&& globalI>_lowerX&&globalI<_upperX){ flags.getValue(i, j, k) += OBSTACLE_LEFT; flags.getValue(i, j, k) += OBSTACLE_RIGHT; flags.getValue(i, j, k) += OBSTACLE_TOP; flags.getValue(i, j, k) += OBSTACLE_BOTTOM; flags.getValue(i, j, k) += OBSTACLE_FRONT; flags.getValue(i, j, k) += OBSTACLE_BACK; }else{ if(globalI-1>=_lowerX) flags.getValue(i, j, k) += OBSTACLE_LEFT; if(globalI+1<=_upperX) flags.getValue(i, j, k) += OBSTACLE_RIGHT; if(globalJ-1>=_lowerY) flags.getValue(i, j, k) += OBSTACLE_BOTTOM; if(globalJ+1<=_upperY) flags.getValue(i, j, k) += OBSTACLE_TOP; if(globalK-1>=_lowerZ) flags.getValue(i, j, k) += OBSTACLE_FRONT; if(globalK+1<=_upperZ) flags.getValue(i, j, k) += OBSTACLE_BACK; } }else{ // if(globalI-1>=_lowerX) // flags.getValue(i, j, k) += OBSTACLE_LEFT; // if(globalI+1<=_upperX) // flags.getValue(i, j, k) += OBSTACLE_RIGHT; // if(globalJ-1>=_lowerY) // flags.getValue(i, j, k) += OBSTACLE_BOTTOM; // if(globalJ+1<=_upperY) // flags.getValue(i, j, k) += OBSTACLE_TOP; // if(globalK-1>=_lowerZ) // flags.getValue(i, j, k) += OBSTACLE_FRONT; // if(globalK+1<=_upperZ) // flags.getValue(i, j, k) += OBSTACLE_BACK; } } } // for (int k = _lowerZ-1; k<=_upperZ+1; k++) // for (int j = _lowerY-1; j <= _upperY+1; j++) // for(int i = _lowerX-1; i<=_upperX+1; i++){ // if(k>=_lowerZ&&k<=_upperZ && // j>=_lowerY&&j<=_upperY&& // i>=_lowerX&&i<=_upperX){ // flags.getValue(i, j, k) = OBSTACLE_SELF; // // if(k>_lowerZ&&k<_upperZ && // j>_lowerY&&j<_upperY&& // i>_lowerX&&i<_upperX){ // flags.getValue(i, j, k) += OBSTACLE_LEFT; // flags.getValue(i, j, k) += OBSTACLE_RIGHT; // flags.getValue(i, j, k) += OBSTACLE_TOP; // flags.getValue(i, j, k) += OBSTACLE_BOTTOM; // flags.getValue(i, j, k) += OBSTACLE_FRONT; // flags.getValue(i, j, k) += OBSTACLE_BACK; // }else{ // if(i-1>=_lowerX) // flags.getValue(i, j, k) += OBSTACLE_LEFT; // if(i+1<=_upperX) // flags.getValue(i, j, k) += OBSTACLE_RIGHT; // if(j-1>=_lowerY) // flags.getValue(i, j, k) += OBSTACLE_BOTTOM; // if(j+1<=_upperY) // flags.getValue(i, j, k) += OBSTACLE_TOP; // if(k-1>=_lowerZ) // flags.getValue(i, j, k) += OBSTACLE_FRONT; // if(k+1<=_upperZ) // flags.getValue(i, j, k) += OBSTACLE_BACK; // // } // }else{ // /*if(i-1>=_lowerX) // flags.getValue(i, j, k) += OBSTACLE_LEFT; // if(i+1<=_upperX) // flags.getValue(i, j, k) += OBSTACLE_RIGHT; // if(j-1>=_lowerY) // flags.getValue(i, j, k) += OBSTACLE_BOTTOM; // if(j+1<=_upperY) // flags.getValue(i, j, k) += OBSTACLE_TOP; // if(k-1>=_lowerZ) // flags.getValue(i, j, k) += OBSTACLE_FRONT; // if(k+1<=_upperZ) // flags.getValue(i, j, k) += OBSTACLE_BACK;*/ // } // } }