void db::getAllPhotos(QList<photo*>* pl,QList<face*>* faceList){ bool a=false; QSqlQuery query(database); // "SELECT DISTINCT F.Fid,I.Iid,F.x,F.y,F.width,F.height,F.tw,F.th,I.path,P.name FROM Faces F,HasFaces H,Images I,Person P WHERE F.Fid=H.Fid AND P.Pid=H.Pid AND H.Iid=I.Iid AND I.Iid IN (SELECT I1.Iid FROM Images I1,HasFaces H1,Faces F1,Person P1 WHERE F1.Fid=H1.Fid AND P1.Pid=H1.Pid AND H1.Iid=I1.Iid AND P1.name=:personName)"); query.prepare("SELECT DISTINCT F.Fid,I.Iid,F.x,F.y,F.width,F.height,F.tw,F.th,I.path,P.name,F.feature FROM Faces F,HasFaces H,Images I,Person P WHERE F.Fid=H.Fid AND P.Pid=H.Pid AND H.Iid=I.Iid AND I.Iid IN (SELECT I1.Iid FROM Images I1,HasFaces H1,Faces F1,Person P1 WHERE F1.Fid=H1.Fid AND P1.Pid=H1.Pid AND H1.Iid=I1.Iid )"); // query.bindValue(":personName", personName); a=query.exec(); QList<face*> fl; QList<int> imageIdList; QList<QString> pathList; while(query.next()){ int faceId = query.value(0).toInt(); int imageId = query.value(1).toInt(); double x=query.value(2).toDouble(); double y=query.value(3).toDouble(); double width=query.value(4).toDouble(); double height=query.value(5).toDouble(); double tw=query.value(6).toDouble(); double th=query.value(7).toDouble(); QString path = query.value(8).toString(); QString name = query.value(9).toString(); QString featStr = query.value(10).toString(); if(!imageIdList.contains(imageId)){ imageIdList.append(imageId); pathList.append(path); } double* flist = returnFacialFeatures(featStr); face* f = new face(faceId,QStringToString(path),x,y,width,height,tw,th,flist,QStringToString(name)); f->setPhotoID(imageId); fl.append(f); faceList->append(f); } // QList<photo*>* pl = new QList<photo*>(); for(int i = 0; i<imageIdList.size();i++){ QList<face*> *pfl = new QList<face*>(); for(int j = 0; j<fl.size();j++){ if(fl[j]->getPhotoId() == imageIdList[i]){ pfl->append(fl[j]); fl.removeAt(j); j--; } } photo* np = new photo(pathList[i],pfl); np->setID(imageIdList[i]); pl->append(np); } }
void DialogData::on_buttonBox_accepted() { mFileDEM = QStringToString(ui->lineEdit_DEM->text()); mFileSlope = QStringToString(ui->lineEdit_slope->text()); mFileAspect = QStringToString(ui->lineEdit_aspect->text()); mFileFuel = QStringToString(ui->lineEdit_fuel->text()); mWindSpeed = ui->doubleSpinBox_windspeed->value(); mWindDirection = ui->doubleSpinBox_windDirect->value(); m1Moisture = ui->spinBox_1hM->value(); m10Moisture = ui->spinBox_10hM->value(); m100Moisture = ui->spinBox_100hM->value(); mHerbMoisture = ui->spinBox_herb->value(); mWoodMoisture = ui->spinBox_wood->value(); }
LaunchyPaths::LaunchyPaths(QSettings* settings) { const QString applicationDirPath = QCoreApplication::applicationDirPath(); m_launchyPath = QStringToString(applicationDirPath); QString iconsPath = applicationDirPath + QDir::separator() + QString("plugins") + QDir::separator() + QString("icons"); m_iconsPath = QStringToString(iconsPath); if (settings) { const QString configFile = settings->fileName(); QFileInfo configFileInfo(configFile); m_configPath = QStringToString(configFileInfo.absolutePath()); } else { m_configPath = L""; } }
photo* db::getImage(int imageId){ QSqlQuery query(database); query.prepare("SELECT DISTINCT Fid,Pid FROM HasFaces WHERE Iid = :imageId "); query.bindValue(":imageId", imageId); bool k=query.exec(); QList<face*>* fl = new QList<face*>(); QString imagePath = getImagePath(imageId); string path = QStringToString(imagePath); while(query.next()){ int faceId = query.value(0).toInt(); int personId = query.value(1).toInt(); face* f = getFace(faceId); f->setLabel(QStringToString(getPersonName(personId))); f->setPhotoID(imageId); f->setPath(path); fl->append(f); } photo* p = new photo(imagePath,fl); p->setID(imageId); return p; }
QList<photo*>* db::getUnlabeledPhotos(){ bool a=false; QSqlQuery query(database); query.prepare("SELECT DISTINCT Iid FROM HasFaces WHERE Pid = 1 "); a=query.exec(); // QList<int> photoId; QList<photo*>* pl = new QList<photo*>(); while(query.next()){ int imageId=query.value(0).toInt(); // photoId.append(imageId); QList<face*>* fl = new QList<face*>(); QSqlQuery query4(database); query4.prepare("SELECT DISTINCT path FROM Images WHERE Iid = :imageId "); query4.bindValue(":imageId", imageId); bool k4 = query4.exec(); query4.next(); QString imagePath(query4.value(0).toString()); QSqlQuery query2(database); query2.prepare("SELECT DISTINCT Fid,Pid FROM HasFaces WHERE Iid = :imageId "); query2.bindValue(":imageId", imageId); bool k=query2.exec(); while(query2.next()){ int faceId = query2.value(0).toInt(); int personId = query2.value(1).toInt(); QSqlQuery query3(database); query3.prepare("SELECT * FROM Faces WHERE Fid = :FId "); query3.bindValue(":FId", faceId); bool k3=query3.exec(); //facelist olcak while(query3.next()){ double x=query3.value(1).toDouble(); double y=query3.value(2).toDouble(); double width=query3.value(3).toDouble(); double height=query3.value(4).toDouble(); double tw=query3.value(5).toDouble(); double th=query3.value(6).toDouble(); QString featureListStr = query3.value(7).toString(); QSqlQuery query5(database); query5.prepare("SELECT name FROM Person WHERE Pid = :PId "); query5.bindValue(":PId", personId); bool k5=query5.exec(); query5.next(); QString lbl(query5.value(0).toString()); double* featureList = returnFacialFeatures(featureListStr); face* f = new face(faceId,QStringToString(imagePath),x,y,width,height,tw,th,featureList,QStringToString(lbl)); f->setPhotoID(imageId); fl->append(f); } } photo* p = new photo(imagePath,fl); p->setID(imageId); pl->append(p); } return pl; }
String *netWorker::get_StatusString() { return QStringToString(workerObject->statusString()); }
// デバッグ文字列を送信する void Terminal::transmitDebug(const QString &str){ std::string text = QStringToString(str); //Trace("Tx '%s'", text.c_str()); text.append("\n"); m_ds.TxDebug(text); }
System::String^ InputData::getText() { return QStringToString( m_inputData.getText() ); }