infoView::infoView(QWidget *parent) : QWidget(parent) { initComponent(); this->setLayout(mainLayout); this->setSizePolicy(QSizePolicy::Fixed,QSizePolicy::Preferred); }
bool CGameObject::init() { initComponent(); initStateMachine(); initCommander(); return true; }
/** * Initializes all components */ void ScriptingService::initComponents() { _scriptComponents.clear(); QList<Script> scripts = Script::fetchAll(); Q_FOREACH(Script script, scripts) { if (script.isEnabled()) { initComponent(script); } } }
IHM::IHM() //: _LinesL_b(sf::PrimitiveType::Lines, 256), _LinesR_b(sf::PrimitiveType::Lines, 256),_LinesL_h(sf::PrimitiveType::Lines, 256),_LinesR_h(sf::PrimitiveType::Lines, 256) { initComponent(); manager.loadMusicFromFolder("./playMe"); manager.getAllFiles(_files); _listfilesHolder->Remove( _listFiles ); _listFiles = sfg::Box::Create( sfg::Box::Orientation::VERTICAL,5.f ); for(std::vector<File>::iterator it = _files.begin() ; it != _files.end(); ++it) packFile(*it); _listfilesHolder->AddWithViewport( _listFiles ); }
void FormSegmentator::analyzeBitmap() { mCurrentDiagram = new Component(); for (int i = 0; i < mBitmap->size(); i ++) { for (int j = 0; j < mBitmap->at(i).size(); j++) { initComponent(i, j); if (!mCurrentDiagram->empty()) { mCurrentDiagram->analyze(); mAllComponents.push_back(*mCurrentDiagram); mCurrentDiagram = new Component(); } } } }
QRoseComponent::QRoseComponent() { initComponent(); attachToGroup(0); }
AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent) { initWindowState(); initComponent(); }
MessageBox::MessageBox(QWidget *parent, bool isYes, bool isNo, bool isCancel, bool isCheckBox, QString title, QString text, int msgType, QString checkText) : QDialog(parent) { initWindowStatus(); initComponent(isYes, isNo, isCancel, isCheckBox, title, text, msgType, checkText); }
void FormSegmentator::initComponent(int x, int y) //находит компоненту, начиная с точки (x, y) { if (mBitmap->at(x).at(y) >= 0) { return; } mCurrentDiagram->insertPos(SquarePos(x, y)); mBitmap->operator [](x)[y] = 1; int gridWidth = mBitmap->size(); int gridHeight = mBitmap->at(x).size(); int cornerX = -1; int cornerY = -1; for (int i = 0; i < 4; i ++) { int nextCornerX = - cornerY; int nextCornerY = cornerX; int x1 = x + cornerX; int y1 = y + cornerY; int x2 = x + nextCornerX; int y2 = y + nextCornerY; if (x1 >= 0 && y1 >= 0 && x2 >= 0 && y2 >= 0 && x1 < gridWidth && y1 < gridHeight && x2 < gridWidth && y2 < gridHeight && mBitmap->at(x1).at(y1) != 0 && mBitmap->at(x2).at(y2) != 0) { return; } cornerX = nextCornerX; cornerY = nextCornerY; } //do we really need this condition? // if ((y == 0 || mBitmap->at(x).at(y - 1) == 0) && // (y == gridHeight - 1 || mBitmap->at(x).at(y + 1) == 0) && // (x == 0 || mBitmap->at(x - 1).at(y) == 0) && // (x == gridWidth - 1 || mBitmap->at(x + 1).at(y) ==0)) // { // //TODO:: new method // for (int i = std::max(0, y - 1); // i <= std::min(gridHeight - 1, y + 1); i ++) // { // for (int j = std::max(0, x - 1); // j <= std::min(gridWidth - 1, x + 1); j ++) // { // initComponent(j, i); // } // } // return; // } int neighbourX = 0; int neighbourY = 1; for (int i = 0; i < 4; i ++) { int nextNeighbourX = - neighbourY; int nextNeighbourY = neighbourX; if (x + neighbourX >= 0 && y + neighbourY >= 0 && x + neighbourX < gridWidth && y + neighbourY < gridHeight && x + nextNeighbourX >= 0 && y + nextNeighbourY >= 0 && x + nextNeighbourX < gridWidth && y + nextNeighbourY < gridHeight && mBitmap->at(x + neighbourX)[y + neighbourY] != 0 && mBitmap->at(x + nextNeighbourX)[y + nextNeighbourY] != 0) { int x1 = x + neighbourX - neighbourY; int y1 = y + neighbourX + neighbourY; int x2 = x - neighbourX; int y2 = y - neighbourY; int x3 = x - neighbourX + neighbourY; int y3 = y - neighbourX - neighbourY; int x4 = x + neighbourY; int y4 = y - neighbourX; if ((x1 >= 0 && x1 < gridWidth && y1 >= 0 && y1 < gridHeight && mBitmap->at(x1)[y1] != 0) || (x2 >= 0 && x2 < gridWidth && y2 >= 0 && y2 < gridHeight && mBitmap->at(x2)[y2] != 0) || (x3 >= 0 && x3 < gridWidth && y3 >= 0 && y3 < gridHeight && mBitmap->at(x3)[y3] != 0) || (x4 >= 0 && x4 < gridWidth && y4 >= 0 && y4 < gridHeight && mBitmap->at(x4)[y4] != 0)) { return; } } neighbourX = nextNeighbourX; neighbourY = nextNeighbourY; } for (int i = std::max(0, y - 1); i <= std::min(gridHeight - 1, y + 1); i ++) { for (int j = std::max(0, x - 1); j <= std::min(gridWidth - 1, x + 1); j ++) { initComponent(j, i); } } }