コード例 #1
0
ファイル: ObjectPoiStorage.cpp プロジェクト: lc525/cytrus
float ObjectPoiStorage::comparePOIs(Poi& p1, Poi& p2){
  float sum=0;
  float* descriptor1=p1.getDescriptor();
  float* descriptor2=p2.getDescriptor();
  for(int i=0; i < 64; i++)
    sum += pow(descriptor1[i] - descriptor2[i],2);

  return sqrt(sum);
}
コード例 #2
0
ファイル: ttwo.cpp プロジェクト: haibara502/Usaco
void zou(Poi & Q, int & v)
{
	Poi p = Q; p.jin(v);
	if (!p.out() && !p.zhang())
	{
		Q = p;
		return;
	}
	v = (v + 1) % 4;
}
コード例 #3
0
ファイル: mainwindow.cpp プロジェクト: hvanruys/EUMETCastView
MainWindow::~MainWindow()
{

    delete ui;
    delete timer;

    delete formtoolbox;
    delete formephem;
    delete formglobecyl;
    delete cylequidist;
    delete satlist;
    delete seglist;

    opts.Save();
    poi.Save();

    imageptrs->DeleteImagePtrs();

    // Deleting h5 files in program directory

    QDir workingdir(".");
    QStringList filters;
    filters << "*.h5" << "*.HDF" << "IMG_DK01*";
    workingdir.setNameFilters(filters);
    QFileInfoList fileinfolist;

    workingdir.setFilter(QDir::Files | QDir::NoSymLinks);
    workingdir.setSorting(QDir::Name);
    fileinfolist = workingdir.entryInfoList();
    for (int i = 0; i < fileinfolist.size(); ++i)
    {
        QFile h5file(fileinfolist.at(i).fileName());
        if(h5file.remove())
            qDebug() << QString("Deleting h5 and Himawari files : %1").arg(fileinfolist.at(i).fileName());
    }

    QDir workingdir1(".");
    filters.clear();
    filters << "S3A_OL_1_*";
    workingdir1.setNameFilters(filters);
    workingdir1.setFilter(QDir::Dirs | QDir::NoSymLinks);
    QStringList infolist = workingdir1.entryList();

    if(opts.remove_S3A_dirs)
    {
        for (int i = 0; i < infolist.size(); ++i)
        {
            QDir deletedir(infolist.at(i));
            bool gelukt = deletedir.removeRecursively();
            if(gelukt)
                qDebug() << "removing S3A dir : " << infolist.at(i);
        }
    }

    qDebug() << "================closing MainWindow================";
    loggingFile.close();

}
コード例 #4
0
ファイル: mainwindow.cpp プロジェクト: Sammalou/EUMETCastView
MainWindow::~MainWindow()
{

    delete ui;
    delete timer;

    delete formtoolbox;
    delete formephem;
    delete formglobecyl;
    delete cylequidist;
    delete satlist;
    delete seglist;

    opts.Save();
    poi.Save();

    imageptrs->DeleteImagePtrs();

    // Deleting h5 files in program directory

    QDir workingdir(".");
    QStringList filters;
    filters << "*.h5" << "*.HDF" << "IMG_DK01*";
    workingdir.setNameFilters(filters);
    QFileInfoList fileinfolist;

    workingdir.setFilter(QDir::Files | QDir::NoSymLinks);
    workingdir.setSorting(QDir::Name);
    fileinfolist = workingdir.entryInfoList();
    for (int i = 0; i < fileinfolist.size(); ++i)
    {
        QFile h5file(fileinfolist.at(i).fileName());
        if(h5file.remove())
            qDebug() << QString("Deleting h5 and Himawari files : %1").arg(fileinfolist.at(i).fileName());
    }

    qDebug() << "================closing MainWindow================";

}
コード例 #5
0
ファイル: main.cpp プロジェクト: hvanruys/EUMETCastView
int main(int argc, char *argv[])
{
    doLogging = false;
    loggingFile.setFileName("logging.txt");
    if (!loggingFile.open(QIODevice::WriteOnly | QIODevice::Text))
        return 0;

    qInstallMessageHandler(myMessageOutput);

    QApplication app(argc, argv);

    QStringList styles = QStyleFactory::keys();

    for (int i = 0; i < styles.size(); ++i)
             qInfo() << styles.at(i);

    app.setStyle(QStyleFactory::create("Fusion"));

    if (QCoreApplication::arguments().contains(QStringLiteral("--logging")) ||
        QCoreApplication::arguments().contains(QStringLiteral("-l")) )
        doLogging = true;

    opts.Initialize();
    poi.Initialize();

    imageptrs = new SegmentImage();
    gshhsdata = new gshhsData();

    QSurfaceFormat format;
    format.setDepthBufferSize(24);
    if (QCoreApplication::arguments().contains(QStringLiteral("--multisample")))
        format.setSamples(4);

    QSurfaceFormat::setDefaultFormat(format);

    app.setApplicationName("EUMETCastView");
    app.setApplicationVersion(APPVERSION);

//    "QTabWidget::tab:disabled { width: 0; height: 0; margin: 0; padding: 0; border: none; }"

    app.setStyleSheet(
    "QTabWidget::tab:default {border-color: navy;}"
    "QPushButton {"
        "border: 2px solid #8f8f91;"
        "border-radius: 6px;"
        "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
        "                           stop: 0 #f6f7fa, stop: 1 #dadbde);"
        "min-width: 80px;"
    "}"
    "QPushButton:pressed {"
        "background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
                                          "stop: 0 #dadbde, stop: 1 #f6f7fa);"
    "}"
    "QPushButton:checked {"
        "background-color: rgb(100, 220, 100);"
    "}"

    "QPushButton:flat {"
        "border: none; /* no border for a flat push button */"
    "}"
    "QPushButton:default {"
        "border-color: navy; /* make the default button prominent */"
    "}");


#ifndef QT_NO_OPENGL

    MainWindow mw;
    mw.setWindowIcon(QIcon(":/icons/icons/300px-Orthographic_projection_SW.png"));
    mw.setContentsMargins(0,0,0,0);

    mw.show();

#else
    QLabel note("OpenGL Support required");
    note.show();
#endif
    return app.exec();
}