<commit_before>/* 
 * Copyright (c) 2013 Opposite Renderer
 * For the full copyright and license information, please view the LICENSE.txt
 * file that was distributed with this source code.
*/

#include "Application.hxx"
#include "MainWindowBase.hxx"
#include "renderer/OptixRenderer.h"
#include <QString>
#include <QMessageBox>
#include "RenderWidget.hxx"
#include "gui/AboutWindow.hxx"
#include "gui/ComputeDeviceInformationWidget.hxx"
#include "gui/docks/RenderInformationDock.hxx"
#include "gui/docks/OutputDock.hxx"
#include "gui/docks/PPMDock.hxx"
#include "gui/docks/CameraDock.hxx"
#include "gui/docks/SceneDock.hxx"
#include "ComputeDeviceRepository.h"
#include "scene/SceneFactory.h"
#include "config.h"
#include <qfiledialog.h>
#include <qinputdialog.h>
#include <qlineedit.h>

MainWindowBase::MainWindowBase(Application& application)
    : m_application(application),
      m_camera(application.getCamera())
{
    setupUi(this);
    actionReload_scene->setVisible(false);
    //connect(&application.getOutputSettingsModel(), SIGNAL(resolutionUpdated()), this, SLOT(onOutputSettingsResolutionUpdated()));
    //connect(&application.getPPMSettingsModel(), SIGNAL(updated()), this, SLOT(onPPMSettingsModelUpdated()));

    connect(&application, SIGNAL(applicationError(QString)), this, SLOT(onApplicationError(QString)));

    // Render Information Dock
    RenderInformationDock* renderInformationDock = new RenderInformationDock(this, application.getRenderStatisticsModel(), application);
    this->addDockWidget(Qt::RightDockWidgetArea, renderInformationDock);
    connect(renderInformationDock, SIGNAL(renderStatusToggle()), this, SLOT(onRenderStatusToggle()));
    connect(renderInformationDock, SIGNAL(renderRestart()), this, SLOT(onRenderRestart()));

    // Output Dock

    OutputDock* outputDock = new OutputDock(this, application.getOutputSettingsModel());
    this->addDockWidget(Qt::RightDockWidgetArea, outputDock);

    // PPM Information dock

    PPMDock* ppmDock = new PPMDock(this, m_application, m_application.getPPMSettingsModel());
    this->addDockWidget(Qt::RightDockWidgetArea, ppmDock);

    // Camera Dock

    CameraDock* cameraDock = new CameraDock(this, application.getCamera(), application.getPPMSettingsModel(), application.getOutputSettingsModel());
    this->addDockWidget(Qt::RightDockWidgetArea, cameraDock);
    connect(&application, SIGNAL(cameraUpdated()), cameraDock, SLOT(onCameraUpdated()));
    connect(cameraDock, SIGNAL(cameraUpdated()), &application, SLOT(onCameraUpdated()));

    // Scene Dock

    SceneDock* sceneDock = new SceneDock(this, application.getSceneManager());
    this->addDockWidget(Qt::RightDockWidgetArea, sceneDock);

    // Status Bar Running Status and Time

    m_statusbar_runningStatusLabel = new QLabel(this);
    this->statusBar()->addPermanentWidget(m_statusbar_runningStatusLabel, 1);
    m_statusbar_runningStatusLabel->setGeometry(100, 0, 100, 12);
    QTimer* runningStatusLabelTimer = new QTimer(this);
    runningStatusLabelTimer->setInterval(100);
    connect(runningStatusLabelTimer, SIGNAL(timeout()), this, SLOT(onUpdateRunningStatusLabelTimer()));
    runningStatusLabelTimer->start();

    // Status Bar Render Method

    m_statusbar_renderMethodLabel = new QLabel(this);
    this->statusBar()->addPermanentWidget(m_statusbar_renderMethodLabel, 1);
    m_statusbar_renderMethodLabel->setGeometry(100, 0, 100, 12);

    // Render Widget
    m_renderWidget = new RenderWidget(centralwidget, application.getCamera(), application.getOutputSettingsModel());
    gridLayout->addWidget(m_renderWidget, 0, 0, 1, 1);
    connect(m_renderWidget, SIGNAL(cameraUpdated()), &application, SLOT(onCameraUpdated()));
    connect(&application, SIGNAL(newFrameReadyForDisplay(const float*, unsigned long long)), 
            m_renderWidget, SLOT(onNewFrameReadyForDisplay(const float*, unsigned long long)),
            Qt::QueuedConnection);

    connect(&application, SIGNAL(runningStatusChanged()), this, SLOT(onRunningStatusChanged()));
    connect(&application, SIGNAL(renderMethodChanged()), this, SLOT(onRenderMethodChanged()));
    connect(this, SIGNAL(renderRestart()), &m_application, SLOT(onRenderRestart()));
    connect(this, SIGNAL(renderStatusToggle()), &m_application, SLOT(onRenderStatusToggle()));

    onRunningStatusChanged();
    onRenderMethodChanged();
}

void MainWindowBase::closeEvent( QCloseEvent* event )
{
    
}

MainWindowBase::~MainWindowBase()
{

}

void MainWindowBase::onActionAbout()
{
    AboutWindow* aboutWindow = new AboutWindow(this);
    aboutWindow->show();
    connect(aboutWindow, SIGNAL(finished()), aboutWindow, SLOT(deleteLater()));
}
<commit_msg>Temporally disable broken Renderer Window<commit_after>/* 
 * Copyright (c) 2013 Opposite Renderer
 * For the full copyright and license information, please view the LICENSE.txt
 * file that was distributed with this source code.
*/

#include "Application.hxx"
#include "MainWindowBase.hxx"
#include "renderer/OptixRenderer.h"
#include <QString>
#include <QMessageBox>
#include "RenderWidget.hxx"
#include "gui/AboutWindow.hxx"
#include "gui/ComputeDeviceInformationWidget.hxx"
#include "gui/docks/RenderInformationDock.hxx"
#include "gui/docks/OutputDock.hxx"
#include "gui/docks/PPMDock.hxx"
#include "gui/docks/CameraDock.hxx"
#include "gui/docks/SceneDock.hxx"
#include "ComputeDeviceRepository.h"
#include "scene/SceneFactory.h"
#include "config.h"
#include <qfiledialog.h>
#include <qinputdialog.h>
#include <qlineedit.h>

MainWindowBase::MainWindowBase(Application& application)
    : m_application(application),
      m_camera(application.getCamera())
{
    setupUi(this);
    actionReload_scene->setVisible(false);
    //connect(&application.getOutputSettingsModel(), SIGNAL(resolutionUpdated()), this, SLOT(onOutputSettingsResolutionUpdated()));
    //connect(&application.getPPMSettingsModel(), SIGNAL(updated()), this, SLOT(onPPMSettingsModelUpdated()));

    connect(&application, SIGNAL(applicationError(QString)), this, SLOT(onApplicationError(QString)));

    // Render Information Dock
    RenderInformationDock* renderInformationDock = new RenderInformationDock(this, application.getRenderStatisticsModel(), application);
    this->addDockWidget(Qt::RightDockWidgetArea, renderInformationDock);
    connect(renderInformationDock, SIGNAL(renderStatusToggle()), this, SLOT(onRenderStatusToggle()));
    connect(renderInformationDock, SIGNAL(renderRestart()), this, SLOT(onRenderRestart()));

    // Output Dock

    OutputDock* outputDock = new OutputDock(this, application.getOutputSettingsModel());
    this->addDockWidget(Qt::RightDockWidgetArea, outputDock);

    // PPM Information dock

    PPMDock* ppmDock = new PPMDock(this, m_application, m_application.getPPMSettingsModel());
    this->addDockWidget(Qt::RightDockWidgetArea, ppmDock);

    // Camera Dock

    CameraDock* cameraDock = new CameraDock(this, application.getCamera(), application.getPPMSettingsModel(), application.getOutputSettingsModel());
    this->addDockWidget(Qt::RightDockWidgetArea, cameraDock);
    connect(&application, SIGNAL(cameraUpdated()), cameraDock, SLOT(onCameraUpdated()));
    connect(cameraDock, SIGNAL(cameraUpdated()), &application, SLOT(onCameraUpdated()));

    // Scene Dock

    SceneDock* sceneDock = new SceneDock(this, application.getSceneManager());
    this->addDockWidget(Qt::RightDockWidgetArea, sceneDock);

    // Status Bar Running Status and Time

    m_statusbar_runningStatusLabel = new QLabel(this);
    this->statusBar()->addPermanentWidget(m_statusbar_runningStatusLabel, 1);
    m_statusbar_runningStatusLabel->setGeometry(100, 0, 100, 12);
    QTimer* runningStatusLabelTimer = new QTimer(this);
    runningStatusLabelTimer->setInterval(100);
    connect(runningStatusLabelTimer, SIGNAL(timeout()), this, SLOT(onUpdateRunningStatusLabelTimer()));
    runningStatusLabelTimer->start();

    // Status Bar Render Method

    m_statusbar_renderMethodLabel = new QLabel(this);
    this->statusBar()->addPermanentWidget(m_statusbar_renderMethodLabel, 1);
    m_statusbar_renderMethodLabel->setGeometry(100, 0, 100, 12);

    // Render Widget

	// FIXME uncomment and fix RenderWidget behaviour
    /*m_renderWidget = new RenderWidget(centralwidget, application.getCamera(), application.getOutputSettingsModel());
    gridLayout->addWidget(m_renderWidget, 0, 0, 1, 1);
    connect(m_renderWidget, SIGNAL(cameraUpdated()), &application, SLOT(onCameraUpdated()));
    connect(&application, SIGNAL(newFrameReadyForDisplay(const float*, unsigned long long)), 
            m_renderWidget, SLOT(onNewFrameReadyForDisplay(const float*, unsigned long long)),
            Qt::QueuedConnection);*/

    connect(&application, SIGNAL(runningStatusChanged()), this, SLOT(onRunningStatusChanged()));
    connect(&application, SIGNAL(renderMethodChanged()), this, SLOT(onRenderMethodChanged()));
    connect(this, SIGNAL(renderRestart()), &m_application, SLOT(onRenderRestart()));
    connect(this, SIGNAL(renderStatusToggle()), &m_application, SLOT(onRenderStatusToggle()));

    onRunningStatusChanged();
    onRenderMethodChanged();
}

void MainWindowBase::closeEvent( QCloseEvent* event )
{
    
}

MainWindowBase::~MainWindowBase()
{

}

void MainWindowBase::onActionAbout()
{
    AboutWindow* aboutWindow = new AboutWindow(this);
    aboutWindow->show();
    connect(aboutWindow, SIGNAL(finished()), aboutWindow, SLOT(deleteLater()));
}

{'fraction_non_alphanumeric': 0.1261930010604454, 'fraction_numerical': 0.006574761399787911, 'mean_word_length': 6.36796875, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6783587', 'n_tokens_mistral': 2850, 'n_tokens_neox': 2714, 'n_words': 508}