コード例 #1
0
ファイル: QuestLog.cpp プロジェクト: Longer/flare
QuestLog::QuestLog(CampaignManager *_camp, MenuLog *_log) {
	camp = _camp;
	log = _log;
	
	quest_count = 0;
	loadAll();
}
コード例 #2
0
void MainWindow::on_actionLoadData_triggered()
{
    int ret = QMessageBox::warning(this, "Загрузка новых данных",
                          "Внимание! Текущая сохраненная конфигурация будет потеряна. Продолжить?",
                                   QMessageBox::Ok | QMessageBox::Cancel);
    if(ret == QMessageBox::Ok)
    {
        QString archive = QFileDialog::getOpenFileName(this, "Открытие архива базы данных", "",
                          "DB Compressed Files (*.dbc)");

        if (!archive.isEmpty())
        {
            decompressFiles(archive);
            loadAll();
            configuratorWidget->refreshPlatformBox();
            configuratorWidget->clearOtherSettings();
            this->setWindowModified(false);
        }
        else
        {
            qDebug() << "архив не выбран";
            ui->statusBar->showMessage("архив не выбран");
        }
    }
}
コード例 #3
0
ファイル: nav_mesh.cpp プロジェクト: astromaker/sandbox
bool nav_mesh::load(const char* file)
{
	mesh_ = loadAll(file);
	if (mesh_ == nullptr)
	{
		return false;
	}

	query_ = dtAllocNavMeshQuery();
	if (query_ == nullptr)
	{
		return false;
	}

	dtStatus status = query_->init(mesh_, 2048);
	if (dtStatusFailed(status))
	{
		return false;
	}

	filter_.setIncludeFlags(SAMPLE_POLYFLAGS_ALL ^ SAMPLE_POLYFLAGS_DISABLED);
	filter_.setExcludeFlags(0);

	filter_.setAreaCost(SAMPLE_POLYAREA_GROUND, 1.0f);
	filter_.setAreaCost(SAMPLE_POLYAREA_WATER, 10.0f);
	filter_.setAreaCost(SAMPLE_POLYAREA_ROAD, 1.0f);
	filter_.setAreaCost(SAMPLE_POLYAREA_DOOR, 1.0f);
	filter_.setAreaCost(SAMPLE_POLYAREA_GRASS, 2.0f);
	filter_.setAreaCost(SAMPLE_POLYAREA_JUMP, 1.5f);

	return true;
}
コード例 #4
0
void ConfCertDialog::applyDialog()
{
    std::cerr << "ConfCertDialog::applyDialog() called" << std::endl ;
    RsPeerDetails detail;
    if (!rsPeers->getPeerDetails(mId, detail))
    {
        if (!rsPeers->getGPGDetails(mId, detail)) {
            QMessageBox::information(this,
                                     tr("RetroShare"),
                                     tr("Error : cannot get peer details."));
            close();
            return;
        }
    }

    //check the GPG trustlvl
    if (ui.radioButton_trust_fully->isChecked() && detail.trustLvl != RS_TRUST_LVL_FULL) {
        //trust has changed to fully
        rsPeers->trustGPGCertificate(detail.id, RS_TRUST_LVL_FULL);
    } else if (ui.radioButton_trust_marginnaly->isChecked() && detail.trustLvl != RS_TRUST_LVL_MARGINAL) {
        rsPeers->trustGPGCertificate(detail.id, RS_TRUST_LVL_MARGINAL);
    } else if (ui.radioButton_trust_never->isChecked() && detail.trustLvl != RS_TRUST_LVL_NEVER) {
        rsPeers->trustGPGCertificate(detail.id, RS_TRUST_LVL_NEVER);
    }

    if (!detail.isOnlyGPGdetail) {
        /* check if the data is the same */
        bool localChanged = false;
        bool extChanged = false;
        bool dnsChanged = false;

        /* set local address */
        if ((detail.localAddr != ui.localAddress->text().toStdString()) || (detail.localPort != ui.localPort -> value()))
            localChanged = true;

        if ((detail.extAddr != ui.extAddress->text().toStdString()) || (detail.extPort != ui.extPort -> value()))
            extChanged = true;

        if ((detail.dyndns != ui.dynDNS->text().toStdString()))
            dnsChanged = true;

        /* now we can action the changes */
        if (localChanged)
            rsPeers->setLocalAddress(mId, ui.localAddress->text().toStdString(), ui.localPort->value());

        if (extChanged)
            rsPeers->setExtAddress(mId,ui.extAddress->text().toStdString(), ui.extPort->value());

        if (dnsChanged)
            rsPeers->setDynDNS(mId, ui.dynDNS->text().toStdString());

        if(localChanged || extChanged || dnsChanged)
            emit configChanged();
    }

	 setServiceFlags() ;

    loadAll();
    close();
}
コード例 #5
0
MainWindow::MainWindow(QWidget *parent, const int countOfComponents) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    arrayCount(countOfComponents)
{
    ui->setupUi(this);
    this->setWindowTitle("Конфигуратор ПК[*] - для заказчика");
    platformsList = new QList<Platform*>;
    arrayOfComponentsLists = new const QList<Component*>*[arrayCount];
    arrayOfComponentsLists = NULL;

    configuratorWidget = new ConfiguratorWidget(this);
    connect(this, SIGNAL(queryForConnectConfigurator(const QList<Platform*>*,
                                                     const QList<Component*>**,
                                                     double)),
            configuratorWidget, SLOT(connectConfigurator(const QList<Platform*>*,
                                                         const QList<Component*>**,
                                                         double)));
    connect(configuratorWidget, SIGNAL(configurationChanged()),
            this, SLOT(currentConfigurationChange()));
    setCentralWidget(configuratorWidget);

    loadAll();
    configuratorWidget->refreshPlatformBox();
    configuratorWidget->loadOtherSettings();

    this->setWindowModified(false);

    mainSettings = new QSettings(this);
    loadMainSettings();
}
コード例 #6
0
void ConfCertDialog::applyDialog()
{
    std::cerr << "ConfCertDialog::applyDialog() called" << std::endl ;
    RsPeerDetails detail;
    if (!rsPeers->getPeerDetails(peerId, detail))
    {
        if (!rsPeers->getGPGDetails(pgpId, detail)) {
            QMessageBox::information(this,
                                     tr("RetroShare"),
                                     tr("Error : cannot get peer details."));
            close();
            return;
        }
    }

        if(!detail.isHiddenNode)
        {
			/* check if the data is the same */
			bool localChanged = false;
			bool extChanged = false;
			bool dnsChanged = false;

			/* set local address */
			if ((detail.localAddr != ui.localAddress->text().toStdString()) || (detail.localPort != ui.localPort -> value()))
				localChanged = true;

			if ((detail.extAddr != ui.extAddress->text().toStdString()) || (detail.extPort != ui.extPort -> value()))
				extChanged = true;

			if ((detail.dyndns != ui.dynDNS->text().toStdString()))
				dnsChanged = true;

			/* now we can action the changes */
			if (localChanged)
				rsPeers->setLocalAddress(peerId, ui.localAddress->text().toStdString(), ui.localPort->value());

			if (extChanged)
				rsPeers->setExtAddress(peerId,ui.extAddress->text().toStdString(), ui.extPort->value());

			if (dnsChanged)
				rsPeers->setDynDNS(peerId, ui.dynDNS->text().toStdString());

			if(localChanged || extChanged || dnsChanged)
				emit configChanged();
        }
        else
        {
            if((detail.hiddenNodeAddress != ui.localAddress->text().toStdString()) || (detail.hiddenNodePort != ui.localPort->value()))
            {
				rsPeers->setHiddenNode(peerId,ui.localAddress->text().toStdString(), ui.localPort->value());
				emit configChanged();
			}
		}

	 setServiceFlags() ;

    loadAll();
    close();
}
コード例 #7
0
void ServerChoice::loadTeam()
{
    LoadWindow *w = new LoadWindow(this, QStringList(), team->name());
    w->setAttribute(Qt::WA_DeleteOnClose, true);
    w->show();

    connect(w, SIGNAL(teamLoaded(TeamHolder)), SLOT(loadAll(TeamHolder)));
}
コード例 #8
0
void ConfCertDialog::denyFriend()
{
    std::string gpg_id = rsPeers->getGPGId(mId);
    rsPeers->removeFriend(gpg_id);
    loadAll();

    emit configChanged();
}
コード例 #9
0
ファイル: carmenstream.hpp プロジェクト: branoholy/lsl
std::vector<PointCloudT> CARMENStream<PointCloudT>::loadAll(const std::string& filePath, std::size_t n)
{
	this->filePath = filePath;

	std::ifstream file(filePath);
	file.seekg(posg);

	return loadAll(file, n);
}
コード例 #10
0
ファイル: main.cpp プロジェクト: keyor/json2lua
int main(int argc, char **argv)
{
	auto db = DBMgr::getInstance();
	db->addFile(std::string(argv[1]));
	db->loadAll();

	//getchar();

	return 0;
}
コード例 #11
0
void MapObjectLoader::load(INIFile* mapFile, const std::string& name)
{
	if (!mapFile)
	{
		Log::line("Unable to allocate map objects, '" + name + "' file doesn't exist!", Log::DEBUG);
		return;
	}

	allocateMainData(mapFile, name);
	loadAll(mapFile, name);
}
コード例 #12
0
ファイル: ItemManager.cpp プロジェクト: mactec0/flare-engine
ItemManager::ItemManager()
	: color_normal(font->getColor("widget_normal"))
	, color_bonus(font->getColor("item_bonus"))
	, color_penalty(font->getColor("item_penalty"))
	, color_requirements_not_met(font->getColor("requirements_not_met"))
	, color_flavor(font->getColor("item_flavor")) {
	// NB: 20 is arbitrary picked number, but it looks like good start.
	items.reserve(20);
	item_sets.reserve(5);

	loadAll();
}
コード例 #13
0
void ConfCertDialog::makeFriend()
{
    std::string gpg_id = rsPeers->getGPGId(mId);
    if (ui.signGPGKeyCheckBox->isChecked()) {
        rsPeers->signGPGCertificate(gpg_id);
    } 
	
    rsPeers->addFriend(mId, gpg_id);
    loadAll();

    emit configChanged();
}
コード例 #14
0
MainWindow::MainWindow(QWidget *parent, const int countOfComponents) :
    QMainWindow(parent), ui(new Ui::MainWindow), arrayCount(countOfComponents)
{
    ui->setupUi(this);
    this->setWindowTitle("Конфигуратор ПК[*] - для поставщика");
    mainStackWidget = new QStackedWidget(this);

    platformsWidget = new PlatformsWidget(this);
    connect(this, SIGNAL(queryForLoadPlatforms(QList<Platform*>*)),
            platformsWidget, SLOT(loadPlatforms(QList<Platform*>*)));

    componentsWidget = new ComponentsWidget(this);
    connect(this, SIGNAL(queryForRefreshPlatformsList(const QList<Platform*>*)),
            componentsWidget, SLOT(refreshPlatformsList(const QList<Platform*>*)));
    //Temp
    connect(this, SIGNAL(queryForLoadComponents(QList<Component*>*, QList<Component*>*,
                                                QList<Component*>*, QList<Component*>*,
                                                QList<Component*>*, QList<Component*>*,
                                                QList<Component*>*, QList<Component*>*,
                                                QList<Component*>*, QList<Component*>*,
                                                QList<Component*>*, QList<Component*>*, double)),
            componentsWidget, SLOT(loadComponents(QList<Component*>*, QList<Component*>*,
                                                  QList<Component*>*, QList<Component*>*,
                                                  QList<Component*>*, QList<Component*>*,
                                                  QList<Component*>*, QList<Component*>*,
                                                  QList<Component*>*, QList<Component*>*,
                                                  QList<Component*>*, QList<Component*>*, double)));

    connect(platformsWidget, SIGNAL(removePlatformFromComponents(QString)),
            componentsWidget, SLOT(removePlatform(QString)));

    configuratorWidget = new ConfiguratorWidget(this, arrayCount);
    connect(this, SIGNAL(queryForConnectConfigurator(const QList<Platform*>*,
                                                     const QList<Component*>**,
                                                     const QDoubleSpinBox*)),
            configuratorWidget, SLOT(connectConfigurator(const QList<Platform*>*,
                                                         const QList<Component*>**,
                                                         const QDoubleSpinBox*)));

    connect(platformsWidget, SIGNAL(platformsChanged()), this, SLOT(platformsChanged()));
    connect(componentsWidget, SIGNAL(componentsChanged()), this, SLOT(componentsChanged()));

    mainStackWidget->addWidget(platformsWidget);
    mainStackWidget->addWidget(componentsWidget);
    mainStackWidget->addWidget(configuratorWidget);
    setCentralWidget(mainStackWidget);

    loadAll();

    mainSettings = new QSettings(this);
    loadMainSettings();
}
コード例 #15
0
ItemManager::ItemManager()
{
	// These values are a bit arbitrary, but they should be a good starting point.
	items.reserve(1000);
	item_sets.reserve(100);

	loadAll();

	// make sure we have at least 1 item
	if (items.empty()) {
		addUnknownItem(1);
	}
}
コード例 #16
0
void ConfCertDialog::signGPGKey()
{
    std::string gpg_id = rsPeers->getGPGId(mId);
    if (!rsPeers->signGPGCertificate(gpg_id)) {
                 QMessageBox::warning ( NULL,
                                tr("Signature Failure"),
                                tr("Maybe password is wrong"),
                                QMessageBox::Ok);
    }
    loadAll();

    emit configChanged();
}
コード例 #17
0
void MainWindow::importXml() {
    QString fileName = QFileDialog::getOpenFileName();
    try {
        loadAll(fileName);
    }
    catch (CalendarException e){
        QMessageBox* error = new QMessageBox(this);
        error->setText(e.getInfo());
        error->show();
    }
    refreshTasksModel();
    refreshIndependentTasksModel();
    refreshProjectsModel();
    refreshProjectsTreeModel();
    refreshCalendar();
}
コード例 #18
0
ファイル: PluginManager.cpp プロジェクト: rakuco/PDAL
void PluginManager::l_loadAll(PF_PluginType type)
{
    std::string driver_path("PDAL_DRIVER_PATH");
    std::string pluginDir = Utils::getenv(driver_path);

    // If we don't have a driver path, defaults are set.
    if (pluginDir.size() == 0)
    {
        std::ostringstream oss;
        oss << PDAL_PLUGIN_INSTALL_PATH <<
            ":/usr/local/lib:./lib:../lib:../bin";
        pluginDir = oss.str();
    }

    std::vector<std::string> pluginPathVec = Utils::split2(pluginDir, ':');

    for (const auto& pluginPath : pluginPathVec)
        loadAll(pluginPath, type);
}
コード例 #19
0
ファイル: PlaYUVerApp.cpp プロジェクト: pixlra/playuver
Void PlaYUVerApp::createActions()
{
  m_arrayActions.resize( TOTAL_ACT );

  // ------------ File ------------
  m_arrayActions[OPEN_ACT] = new QAction( QIcon( ":/images/open.png" ), tr( "&Open" ), this );
  m_arrayActions[OPEN_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogOpenButton ) );
  m_arrayActions[OPEN_ACT]->setShortcuts( QKeySequence::Open );
  m_arrayActions[OPEN_ACT]->setStatusTip( tr( "Open stream" ) );
  connect( m_arrayActions[OPEN_ACT], SIGNAL( triggered() ), this, SLOT( open() ) );

  m_arrayRecentFilesActions.resize( MAX_RECENT_FILES );
  for( Int i = 0; i < MAX_RECENT_FILES; i++ )
  {
    m_arrayRecentFilesActions[i] = new QAction( this );
    m_arrayRecentFilesActions[i]->setVisible( false );
    connect( m_arrayRecentFilesActions[i], SIGNAL( triggered() ), this, SLOT( openRecent() ) );
  }

  m_arrayActions[SAVE_ACT] = new QAction( QIcon( ":/images/save.png" ), tr( "&Save Frame" ), this );
  m_arrayActions[SAVE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogSaveButton ) );
  m_arrayActions[SAVE_ACT]->setShortcuts( QKeySequence::SaveAs );
  m_arrayActions[SAVE_ACT]->setStatusTip( tr( "Save current frame" ) );
  connect( m_arrayActions[SAVE_ACT], SIGNAL( triggered() ), this, SLOT( save() ) );

  m_arrayActions[FORMAT_ACT] = new QAction( tr( "&Format" ), this );
  m_arrayActions[FORMAT_ACT]->setIcon( QIcon::fromTheme( "transform-scale", QIcon( ":/images/configuredialog.png" ) ) );
  m_arrayActions[FORMAT_ACT]->setShortcut( Qt::CTRL + Qt::Key_F );
  m_arrayActions[FORMAT_ACT]->setStatusTip( tr( "Open format dialog" ) );
  connect( m_arrayActions[FORMAT_ACT], SIGNAL( triggered() ), this, SLOT( format() ) );

  m_arrayActions[RELOAD_ACT] = new QAction( tr( "&Reload" ), this );
  m_arrayActions[RELOAD_ACT]->setIcon( style()->standardIcon( QStyle::SP_BrowserReload ) );
  m_arrayActions[RELOAD_ACT]->setShortcut( Qt::CTRL + Qt::Key_R );
  m_arrayActions[RELOAD_ACT]->setShortcut( Qt::Key_F5 );
  m_arrayActions[RELOAD_ACT]->setStatusTip( tr( "Reload current sequence" ) );
  connect( m_arrayActions[RELOAD_ACT], SIGNAL( triggered() ), this, SLOT( reload() ) );

  m_arrayActions[RELOAD_ALL_ACT] = new QAction( tr( "Reload All" ), this );
  m_arrayActions[RELOAD_ALL_ACT]->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_R );
  m_arrayActions[RELOAD_ALL_ACT]->setStatusTip( tr( "Reload all sequences" ) );
  connect( m_arrayActions[RELOAD_ALL_ACT], SIGNAL( triggered() ), this, SLOT( reloadAll() ) );

  m_arrayActions[LOAD_ALL_ACT] = new QAction( tr( "Preload" ), this );
  m_arrayActions[LOAD_ALL_ACT]->setStatusTip( tr( "Load sequence into memory (caution)" ) );
  connect( m_arrayActions[LOAD_ALL_ACT], SIGNAL( triggered() ), this, SLOT( loadAll() ) );

  m_arrayActions[CLOSE_ACT] = new QAction( tr( "&Close" ), this );
  m_arrayActions[CLOSE_ACT]->setIcon( style()->standardIcon( QStyle::SP_DialogCloseButton ) );
  m_arrayActions[CLOSE_ACT]->setStatusTip( tr( "Close the active window" ) );
  connect( m_arrayActions[CLOSE_ACT], SIGNAL( triggered() ), m_pcWindowHandle, SLOT( removeActiveSubWindow() ) );

  m_arrayActions[CLOSEALL_ACT] = new QAction( tr( "Close &All" ), this );
  m_arrayActions[CLOSEALL_ACT]->setStatusTip( tr( "Close all the windows" ) );
  connect( m_arrayActions[CLOSEALL_ACT], SIGNAL( triggered() ), m_pcWindowHandle, SLOT( removeAllSubWindow() ) );

  m_arrayActions[EXIT_ACT] = new QAction( tr( "E&xit" ), this );
  m_arrayActions[EXIT_ACT]->setShortcuts( QKeySequence::Quit );
  m_arrayActions[EXIT_ACT]->setStatusTip( tr( "Exit the application" ) );
  connect( m_arrayActions[EXIT_ACT], SIGNAL( triggered() ), qApp, SLOT( closeAllWindows() ) );

  // ------------ View ------------
  mapperZoom = new QSignalMapper( this );
  connect( mapperZoom, SIGNAL( mapped(int) ), this, SLOT( scaleFrame(int) ) );

  m_arrayActions[ZOOM_IN_ACT] = new QAction( tr( "Zoom &In (+25%)" ), this );
  m_arrayActions[ZOOM_IN_ACT]->setIcon( QIcon::fromTheme( "zoom-in", QIcon( ":/images/zoomin.png" ) ) );
  m_arrayActions[ZOOM_IN_ACT]->setShortcut( tr( "Ctrl++" ) );
  m_arrayActions[ZOOM_IN_ACT]->setStatusTip( tr( "Scale the image up by 25%" ) );
  connect( m_arrayActions[ZOOM_IN_ACT], SIGNAL( triggered() ), mapperZoom, SLOT( map() ) );
  mapperZoom->setMapping( m_arrayActions[ZOOM_IN_ACT], 125 );

  m_arrayActions[ZOOM_OUT_ACT] = new QAction( tr( "Zoom &Out (-25%)" ), this );
  m_arrayActions[ZOOM_OUT_ACT]->setIcon( QIcon::fromTheme( "zoom-out", QIcon( ":/images/zoomout.png" ) ) );
  m_arrayActions[ZOOM_OUT_ACT]->setShortcut( tr( "Ctrl+-" ) );
  m_arrayActions[ZOOM_OUT_ACT]->setStatusTip( tr( "Scale the image down by 25%" ) );
  connect( m_arrayActions[ZOOM_OUT_ACT], SIGNAL( triggered() ), mapperZoom, SLOT( map() ) );
  mapperZoom->setMapping( m_arrayActions[ZOOM_OUT_ACT], 80 );

  m_arrayActions[ZOOM_NORMAL_ACT] = new QAction( tr( "&Normal Size" ), this );
  m_arrayActions[ZOOM_NORMAL_ACT]->setIcon( QIcon::fromTheme( "zoom-original", QIcon( ":/images/zoomtonormal.png" ) ) );
  m_arrayActions[ZOOM_NORMAL_ACT]->setShortcut( tr( "Ctrl+N" ) );
  m_arrayActions[ZOOM_NORMAL_ACT]->setStatusTip( tr( "Show the image at its original size" ) );
  connect( m_arrayActions[ZOOM_NORMAL_ACT], SIGNAL( triggered() ), this, SLOT( normalSize() ) );

  m_arrayActions[ZOOM_FIT_ACT] = new QAction( tr( "Zoom to &Fit" ), this );
  m_arrayActions[ZOOM_FIT_ACT]->setIcon( QIcon::fromTheme( "zoom-fit-best", QIcon( ":/images/fittowindow.png" ) ) );
  m_arrayActions[ZOOM_FIT_ACT]->setStatusTip( tr( "Zoom in or out to fit on the window." ) );
  connect( m_arrayActions[ZOOM_FIT_ACT], SIGNAL( triggered() ), this, SLOT( zoomToFit() ) );

  m_arrayActions[ZOOM_FIT_ALL_ACT] = new QAction( tr( "Zoom to Fit All" ), this );
//m_arrayActions[ZOOM_FIT_ALL_ACT]->setIcon( QIcon::fromTheme( "zoom-fit-best", QIcon( ":/images/fittowindow.png" ) ) );
  m_arrayActions[ZOOM_FIT_ALL_ACT]->setStatusTip( tr( "Apply zoom to fit to all windows" ) );
  connect( m_arrayActions[ZOOM_FIT_ALL_ACT], SIGNAL( triggered() ), this, SLOT( zoomToFitAll() ) );

  m_appModuleVideo->createActions();
  m_appModuleQuality->createActions();
  m_appModuleExtensions->createActions();
  m_pcWindowHandle->createActions();

// ------------ About ------------

#ifdef USE_FERVOR
  m_arrayActions[UPDATE_ACT] = new QAction( tr( "&Update" ), this );
  m_arrayActions[UPDATE_ACT]->setStatusTip( tr( "Check for updates" ) );
  connect( m_arrayActions[UPDATE_ACT], SIGNAL( triggered() ), FvUpdater::sharedUpdater(), SLOT( CheckForUpdatesNotSilent() ) );
#endif

  m_arrayActions[ABOUT_ACT] = new QAction( tr( "&About" ), this );
  m_arrayActions[ABOUT_ACT]->setStatusTip( tr( "Show the application's About box" ) );
  connect( m_arrayActions[ABOUT_ACT], SIGNAL( triggered() ), this, SLOT( about() ) );

  m_arrayActions[ABOUTQT_ACT] = new QAction( tr( "About &Qt" ), this );
  m_arrayActions[ABOUTQT_ACT]->setIcon( QIcon( ":images/qt.png" ) );
  m_arrayActions[ABOUTQT_ACT]->setStatusTip( tr( "Show the Qt library's About box" ) );
  connect( m_arrayActions[ABOUTQT_ACT], SIGNAL( triggered() ), qApp, SLOT( aboutQt() ) );
}
コード例 #20
0
void MainWindow::on_actionLoad_triggered()
{
    loadAll();
}
コード例 #21
0
void Sample_TempObstacles::handleSettings()
{
    Sample::handleCommonSettings();

    if (imguiCheck("Keep Itermediate Results", m_keepInterResults))
        m_keepInterResults = !m_keepInterResults;

    imguiLabel("Tiling");
    imguiSlider("TileSize", &m_tileSize, 16.0f, 128.0f, 8.0f);

    int gridSize = 1;
    if (m_geom)
    {
        const float* bmin = m_geom->getNavMeshBoundsMin();
        const float* bmax = m_geom->getNavMeshBoundsMax();
        char text[64];
        int gw = 0, gh = 0;
        rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh);
        const int ts = (int)m_tileSize;
        const int tw = (gw + ts-1) / ts;
        const int th = (gh + ts-1) / ts;
        snprintf(text, 64, "Tiles  %d x %d", tw, th);
        imguiValue(text);

        // Max tiles and max polys affect how the tile IDs are caculated.
        // There are 22 bits available for identifying a tile and a polygon.
        int tileBits = rcMin((int)dtIlog2(dtNextPow2(tw*th*EXPECTED_LAYERS_PER_TILE)), 14);
        if (tileBits > 14) tileBits = 14;
        int polyBits = 22 - tileBits;
        m_maxTiles = 1 << tileBits;
        m_maxPolysPerTile = 1 << polyBits;
        snprintf(text, 64, "Max Tiles  %d", m_maxTiles);
        imguiValue(text);
        snprintf(text, 64, "Max Polys  %d", m_maxPolysPerTile);
        imguiValue(text);
        gridSize = tw*th;
    }
    else
    {
        m_maxTiles = 0;
        m_maxPolysPerTile = 0;
    }

    imguiSeparator();

    imguiLabel("Tile Cache");
    char msg[64];

    const float compressionRatio = (float)m_cacheCompressedSize / (float)(m_cacheRawSize+1);

    snprintf(msg, 64, "Layers  %d", m_cacheLayerCount);
    imguiValue(msg);
    snprintf(msg, 64, "Layers (per tile)  %.1f", (float)m_cacheLayerCount/(float)gridSize);
    imguiValue(msg);

    snprintf(msg, 64, "Memory  %.1f kB / %.1f kB (%.1f%%)", m_cacheCompressedSize/1024.0f, m_cacheRawSize/1024.0f, compressionRatio*100.0f);
    imguiValue(msg);
    snprintf(msg, 64, "Navmesh Build Time  %.1f ms", m_cacheBuildTimeMs);
    imguiValue(msg);
    snprintf(msg, 64, "Build Peak Mem Usage  %.1f kB", m_cacheBuildMemUsage/1024.0f);
    imguiValue(msg);

    imguiSeparator();

    imguiIndent();
    imguiIndent();

    if (imguiButton("Save"))
    {
        saveAll("all_tiles_tilecache.bin");
    }

    if (imguiButton("Load"))
    {
        dtFreeNavMesh(m_navMesh);
        dtFreeTileCache(m_tileCache);
        loadAll("all_tiles_tilecache.bin");
        m_navQuery->init(m_navMesh, 2048);
    }

    imguiUnindent();
    imguiUnindent();

    imguiSeparator();
}
コード例 #22
0
void Sample_TileMesh::handleSettings()
{
	Sample::handleCommonSettings();

	if (imguiCheck("Keep Itermediate Results", m_keepInterResults))
		m_keepInterResults = !m_keepInterResults;

	if (imguiCheck("Build All Tiles", m_buildAll))
		m_buildAll = !m_buildAll;
	
	imguiLabel("Tiling");
	imguiSlider("TileSize", &m_tileSize, 16.0f, 1024.0f, 16.0f);
	
	if (m_geom)
	{
		const float* bmin = m_geom->getMeshBoundsMin();
		const float* bmax = m_geom->getMeshBoundsMax();
		char text[64];
		int gw = 0, gh = 0;
		rcCalcGridSize(bmin, bmax, m_cellSize, &gw, &gh);
		const int ts = (int)m_tileSize;
		const int tw = (gw + ts-1) / ts;
		const int th = (gh + ts-1) / ts;
		snprintf(text, 64, "Tiles  %d x %d", tw, th);
		imguiValue(text);

		// Max tiles and max polys affect how the tile IDs are caculated.
		// There are 22 bits available for identifying a tile and a polygon.
		int tileBits = rcMin((int)ilog2(nextPow2(tw*th)), 14);
		if (tileBits > 14) tileBits = 14;
		int polyBits = 22 - tileBits;
		m_maxTiles = 1 << tileBits;
		m_maxPolysPerTile = 1 << polyBits;
		snprintf(text, 64, "Max Tiles  %d", m_maxTiles);
		imguiValue(text);
		snprintf(text, 64, "Max Polys  %d", m_maxPolysPerTile);
		imguiValue(text);
	}
	else
	{
		m_maxTiles = 0;
		m_maxPolysPerTile = 0;
	}
	
	imguiSeparator();
	
	imguiIndent();
	imguiIndent();
	
	if (imguiButton("Save"))
	{
		saveAll("all_tiles_navmesh.bin", m_navMesh);
	}

	if (imguiButton("Load"))
	{
		dtFreeNavMesh(m_navMesh);
		m_navMesh = loadAll("all_tiles_navmesh.bin");
		m_navQuery->init(m_navMesh, 2048);
	}

	imguiUnindent();
	imguiUnindent();
	
	char msg[64];
	snprintf(msg, 64, "Build Time: %.1fms", m_totalBuildTimeMs);
	imguiLabel(msg);
	
	imguiSeparator();
	
	imguiSeparator();
	
}
コード例 #23
0
ファイル: MTemp.cpp プロジェクト: danilom93/WB32
bool AFramework::MTempMaster::run(){
    
    AString currentCmd;
    AString str;
    AString sensAdd;
    uint8 temp = 0;
    
    if(!m_flag){
        
        return false;
    }
    if(joinNetwork()){
            
            /* joinNetwork da direttamente l'output                             */
        if(!loadAll()){
            
            msg("Errore\nCaricamento", 0);
            while(1);
        }
        
            //cerco per due volte i sensori vicini
            readTemp(str);
            for(uint8 i = 0; i < _MTEMP_ROOM_VEC_SIZE; i++){

                str.clear();
                str = m_rooms[i].sensorAddress();
                sensAdd = "Ricerco\nSensore ";
                sensAdd += m_rooms[i].sensorAddress();
                msg(sensAdd);
                temp = 0;
                temp = readTemp(str);
                m_rooms[i].setTemperature(temp);
                if(temp != 0){
                    sensAdd.clear();
                    sensAdd += "Sensore ";
                    sensAdd += m_rooms[i].sensorAddress();
                    sensAdd += "\nTrovato";
                    msg(sensAdd);
                }else{
                    sensAdd.clear();
                    sensAdd += "Sensore ";
                    sensAdd += m_rooms[i].sensorAddress();
                    sensAdd += "\nNon trovato";
                    msg(sensAdd);
                }
            }
            
            msg("In ascolto...", 0);
            m_wifi->prepareForReceive();
            PortA.write(bit7, Hi);
            System::delay(1000);
            PortA.write(bit7, Lo);
            ATime time = System::aliveTime();
            time.addMinutes(1);
            while(1){
                
                if(m_wifi->waitForData(currentCmd, 0)){
                    
                    PortA.write(bit7, Hi);
                    commandExec(currentCmd);
                    PortA.write(bit7, Lo);
                    currentCmd.clear();
                }else{
                    if(System::aliveTime() <= time){
                        
                        programsManager(false);
                    }else{
                        
                        programsManager(true);
                        time.addMinutes(1);
                    }
                }
            }
    }else{
        /*  joinNetwork da direttamente l'output                                */
        while(1);
    }
}
コード例 #24
0
CartLoader::CartLoader() : _d( new Impl )
{
   loadAll();
}
コード例 #25
0
void CLNAResultSubwidget::slotScaled()
{
  loadAll(mLNAMethod);
}
コード例 #26
0
ファイル: carmenstream.hpp プロジェクト: branoholy/lsl
std::vector<PointCloudT> CARMENStream<PointCloudT>::loadAll(std::size_t n)
{
	return loadAll(this->filePath, n);
}
コード例 #27
0
 QObjectList loadAll() {
     NodeObjectMap map;
     return loadAll(map);
 }
コード例 #28
0
ファイル: _diwos.cpp プロジェクト: zsimpson/plug_public
int main( int argc, char **argv ) {
	ZHashTable options;

//ZHashTable test;
//test.putS( "type", "Login" );
//zHashTablePack( test );

	// LOAD options
	zConfigLoadFile( "diwos.cfg", options );
	zCmdParseCommandLine( argc, argv, options );
		// cmdline may override .cfg files

	loadAll();

	int listenPort = options.getI("--port",59997);
	if( listenPort ) {
		trace( "Server listening on port: %d\n", listenPort );

		ZMsgZocket test;

		// OPEN the listening zocket
		ZMsgZocket *server = new ZMsgZocket( ZTmpStr("tcp://*:%d", listenPort), ZO_LISTENING );
		assert( server && server->isOpen() );
	}

	zMsgSetHandler( "default", ZMsgZocket::dispatch );

	int cmdLen = 0;
	char cmd[1024] = {0,};

	zconsoleCharMode();

	while( 1 ) {
		zMsgDispatch();

		ZMsgZocket::wait( 1000, 1 );
		ZMsgZocket::readList();
		update();

		if( zconsoleKbhit() ) {
			char c = zconsoleGetch();

			if( cmdLen < sizeof(cmd)-1 ) {
				if( c == '\r' || c == '\n' ) {
					cmdLen = 0;

					ZMsg *z = new ZMsg;
					z->putS( "type", "Command" );
					z->putS( "cmd", cmd );
					zMsgQueue( z );

					printf( "\n" );
				}
				else {
					cmd[cmdLen++] = c;
					cmd[cmdLen] = 0;
				}
			}
		}
	}

	return 0;
}
コード例 #29
0
void CMCAResultSubwidget::slotScaled()
{
  loadAll(mMCAMethod);
}