示例#1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent), _ui(new Ui::MainWindow), _nextScene(QString::null)
{
    _ui->setupUi(this);

    Camera* camera = new Camera;
    camera->set(config->defaultCameraVerticalFOV(), config->defaultCameraAspectRatio());
    camera->setAperture(config->defaultCameraAperture());
    camera->setFocalPlane(config->defaultCameraFocusPlane());

    _ui->renderer->setCamera(camera);
    _setConfig();
    _ui->sceneNames->addItems(sceneGenerator->scenes());
    _ui->sceneNames->setCurrentIndex(0);
    logger->setConsole(_ui->console);
    logger->setStatusBar(_ui->statusBar);

    onLoadScene();

    connect(_ui->action_Save, SIGNAL(triggered()), SLOT(onSaveImage()));
    connect(_ui->action_Play_Pause, SIGNAL(triggered()), SLOT(onPlayPause()));
    connect(_ui->action_Stop, SIGNAL(triggered()), SLOT(onStop()));
    connect(_ui->action_Reload, SIGNAL(triggered()), SLOT(onLoadScene()));

    connect(_ui->sceneNames, SIGNAL(currentIndexChanged(QString)), SLOT(onLoadScene()));
    connect(_ui->integrator, SIGNAL(currentTextChanged(QString)), SLOT(onIntegratorChanged()));

    connect(_ui->renderer, SIGNAL(renderingFinished()), SLOT(onRenderingFinished()));
    connect(_ui->renderer, SIGNAL(renderingStarted()), SLOT(onRenderingStarted()));
    connect(_ui->renderer, SIGNAL(clicked(Intersection)), SLOT(onClick(Intersection)));

    QTimer* progressTimer = new QTimer(this);
    connect(progressTimer, SIGNAL(timeout()), SLOT(onUpdateProgress()));
    progressTimer->start(35);
}
示例#2
0
ofxGuiContainer::ofxGuiContainer(const ofParameterGroup & _parameters, const ofJson & config)
    :ofxGuiContainer(_parameters.getName()) {

    addParametersFrom(_parameters);
    _setConfig(config);

}
ofxGuiInputField<Type>::ofxGuiInputField(ofParameter<Type>& _val, const ofJson &config)
	:ofxGuiInputField(){

	value.makeReferenceTo(_val);
	input = ofToString(value);
	inputWidth = getTextBoundingBox(input,0,0).width;
	value.addListener(this,&ofxGuiInputField::valueChanged);
	pressCounter = 0;
	_setConfig(config);

}
ofxGuiInputField<Type>::ofxGuiInputField(const ofJson &config)
	:ofxGuiInputField(){

	_setConfig(config);

}
示例#5
0
ofxGuiContainer::ofxGuiContainer(const std::string& collectionName, const ofJson & config)
    :ofxGuiContainer(collectionName) {

    _setConfig(config);

}