Source

3dmaze / renderdialog.cpp

Full commit
/* Copyright (C) 2010 by Eric Waller 
  
   Build and display a maze in either 2-D or 3-D

   This program is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.

   ewwaller@gmail.com

   Revision History

   Date        Author      Description
   ---------   ----------  -----------
   2010.7.20   E Waller    Initial Release
*/

#include "renderdialog.h"
#include "ui_render.h"

RenderDialog::RenderDialog(QDialog * parent):QDialog(parent)
{
  ui = new Ui_threeDdialog;
  ui->setupUi(this);
  connect (ui->eyeX,SIGNAL(valueChanged(double)),ui->renderWidget,SLOT(setX(double)));
  connect (ui->eyeY,SIGNAL(valueChanged(double)),ui->renderWidget,SLOT(setY(double)));
  connect (ui->eyeZ,SIGNAL(valueChanged(double)),ui->renderWidget,SLOT(setZ(double)));
  connect (ui->rotX,SIGNAL(valueChanged(int)),ui->renderWidget,SLOT(setXRotation(int)));
  //connect (ui->rotY,SIGNAL(valueChanged(int)),ui->renderWidget,SLOT(setYRotation(int)));
  connect (ui->rotZ,SIGNAL(valueChanged(int)),ui->renderWidget,SLOT(setZRotation(int)));
  connect (ui->renderWidget,SIGNAL(xRotationChanged(int)),ui->rotX,SLOT(setValue(int)));
  //connect (ui->renderWidget,SIGNAL(yRotationChanged(int)),ui->rotY,SLOT(setValue(int)));
  connect (ui->renderWidget,SIGNAL(zRotationChanged(int)),ui->rotZ,SLOT(setValue(int)));
  connect (ui->renderWidget,SIGNAL(xChanged(double)),ui->eyeX,SLOT(setValue(double)));
  connect (ui->renderWidget,SIGNAL(yChanged(double)),ui->eyeY,SLOT(setValue(double)));
  connect (ui->renderWidget,SIGNAL(zChanged(double)),ui->eyeZ,SLOT(setValue(double)));
  connect (ui->renderWidget,SIGNAL(telemetry(QString)),ui->statusEdit,SLOT(setText(QString)));
}

RenderDialog::~RenderDialog()
{
  delete ui;
}

void RenderDialog::closeEvent(QCloseEvent *event)
{
  emit(this->ClosingRenderDialog());
  event->accept();
}

void RenderDialog::SetMazeEngine(MazeEngine* theNewMaze, bool newShowSolution)
{
  ui->renderWidget->SetMazeEngine(theNewMaze, newShowSolution);
}