6 |
|
#include "ui_incrementsdialog.h" |
7 |
|
#include "ui_commandsdialog.h" |
8 |
|
|
9 |
< |
#include <QtGui/QMessageBox> |
10 |
< |
#include <QtGui/QLineEdit> |
11 |
< |
#include <QtGui/QCloseEvent> |
12 |
< |
#include <QtGui/QFileDialog> |
13 |
< |
#include <QtGui/QInputDialog> |
14 |
< |
#include <QtCore/QDebug> |
15 |
< |
#include <QtCore/QTime> |
16 |
< |
#include <QtCore/QTextStream> |
9 |
> |
#include <QMessageBox> |
10 |
> |
#include <QLineEdit> |
11 |
> |
#include <QCloseEvent> |
12 |
> |
#include <QFileDialog> |
13 |
> |
#include <QInputDialog> |
14 |
> |
#include <QDebug> |
15 |
> |
#include <QTime> |
16 |
> |
#include <QTextStream> |
17 |
|
|
18 |
|
#include <iostream> |
19 |
|
|
150 |
|
this, SLOT(saveImage())); |
151 |
|
connect(m_ui->loadView, SIGNAL(triggered()), |
152 |
|
this, SLOT(loadView())); |
153 |
+ |
connect(m_ui->loadRif, SIGNAL(triggered()), |
154 |
+ |
this, SLOT(loadRif())); |
155 |
|
connect(m_ui->backfaceVisibility, SIGNAL(triggered()), |
156 |
|
this, SLOT(toggleBackfaceVisibility())); |
157 |
|
connect(m_ui->grayscale, SIGNAL(triggered()), |
243 |
|
enableInterface(true); |
244 |
|
return; |
245 |
|
} |
246 |
< |
qt_process_command(command.toAscii()); |
246 |
> |
qt_process_command(command.toLatin1()); |
247 |
|
QString msg; |
248 |
|
QTextStream(&msg) << "Render Time: " << t.elapsed() << " ms"; |
249 |
|
m_ui->messageBox->appendPlainText(msg); |
496 |
|
command += m_exposureDialogUi->exposureSetting->text(); |
497 |
|
} |
498 |
|
|
499 |
< |
runCommand(command.toAscii()); |
499 |
> |
runCommand(command.toLatin1()); |
500 |
|
} |
501 |
|
|
502 |
|
void MainWindow::updatePointRadio() |
526 |
|
command += m_parameterDialogUi->valueY->text(); |
527 |
|
command += " "; |
528 |
|
command += m_parameterDialogUi->valueZ->text(); |
529 |
< |
runCommand(command.toAscii()); |
529 |
> |
runCommand(command.toLatin1()); |
530 |
|
} |
531 |
|
if(m_parameterDialogUi->weight->isModified()) |
532 |
|
{ |
533 |
|
QString command = "set aw "; |
534 |
|
command += m_parameterDialogUi->weight->text(); |
535 |
< |
runCommand(command.toAscii()); |
535 |
> |
runCommand(command.toLatin1()); |
536 |
|
} |
537 |
|
if(m_parameterDialogUi->accuracy->isModified()) |
538 |
|
{ |
539 |
|
QString command = "set aa "; |
540 |
|
command += m_parameterDialogUi->accuracy->text(); |
541 |
< |
runCommand(command.toAscii()); |
541 |
> |
runCommand(command.toLatin1()); |
542 |
|
} |
543 |
|
if(m_parameterDialogUi->divisions->isModified()) |
544 |
|
{ |
545 |
|
QString command = "set ad "; |
546 |
|
command += m_parameterDialogUi->divisions->text(); |
547 |
< |
runCommand(command.toAscii()); |
547 |
> |
runCommand(command.toLatin1()); |
548 |
|
} |
549 |
|
if(m_parameterDialogUi->supersamples->isModified()) |
550 |
|
{ |
551 |
|
QString command = "set as "; |
552 |
|
command += m_parameterDialogUi->supersamples->text(); |
553 |
< |
runCommand(command.toAscii()); |
553 |
> |
runCommand(command.toLatin1()); |
554 |
|
} |
555 |
|
if(m_parameterDialogUi->bounces->isModified()) |
556 |
|
{ |
557 |
|
QString command = "set ab "; |
558 |
|
command += m_parameterDialogUi->bounces->text(); |
559 |
< |
runCommand(command.toAscii()); |
559 |
> |
runCommand(command.toLatin1()); |
560 |
|
} |
561 |
|
if(m_parameterDialogUi->resolution->isModified()) |
562 |
|
{ |
563 |
|
QString command = "set ar "; |
564 |
|
command += m_parameterDialogUi->resolution->text(); |
565 |
< |
runCommand(command.toAscii()); |
565 |
> |
runCommand(command.toLatin1()); |
566 |
|
} |
567 |
|
if(m_parameterDialogUi->certainty->isModified()) |
568 |
|
{ |
569 |
|
QString command = "set dc "; |
570 |
|
command += m_parameterDialogUi->certainty->text(); |
571 |
< |
runCommand(command.toAscii()); |
571 |
> |
runCommand(command.toLatin1()); |
572 |
|
} |
573 |
|
if(m_parameterDialogUi->threshold->isModified()) |
574 |
|
{ |
575 |
|
QString command = "set dt "; |
576 |
|
command += m_parameterDialogUi->threshold->text(); |
577 |
< |
runCommand(command.toAscii()); |
577 |
> |
runCommand(command.toLatin1()); |
578 |
|
} |
579 |
|
if(m_parameterDialogUi->visibility->isModified()) |
580 |
|
{ |
581 |
|
QString command = "set dv "; |
582 |
|
command += m_parameterDialogUi->visibility->text(); |
583 |
< |
runCommand(command.toAscii()); |
583 |
> |
runCommand(command.toLatin1()); |
584 |
|
} |
585 |
|
if(m_parameterDialogUi->jitter->isModified()) |
586 |
|
{ |
587 |
|
QString command = "set dj "; |
588 |
|
command += m_parameterDialogUi->jitter->text(); |
589 |
< |
runCommand(command.toAscii()); |
589 |
> |
runCommand(command.toLatin1()); |
590 |
|
} |
591 |
|
if(m_parameterDialogUi->sampling->isModified()) |
592 |
|
{ |
593 |
|
QString command = "set ds "; |
594 |
|
command += m_parameterDialogUi->sampling->text(); |
595 |
< |
runCommand(command.toAscii()); |
595 |
> |
runCommand(command.toLatin1()); |
596 |
|
} |
597 |
|
if(m_parameterDialogUi->limit_weight->isModified()) |
598 |
|
{ |
599 |
|
QString command = "set lw "; |
600 |
|
command += m_parameterDialogUi->limit_weight->text(); |
601 |
< |
runCommand(command.toAscii()); |
601 |
> |
runCommand(command.toLatin1()); |
602 |
|
} |
603 |
|
if(m_parameterDialogUi->reflection->isModified()) |
604 |
|
{ |
605 |
|
QString command = "set lr "; |
606 |
|
command += m_parameterDialogUi->reflection->text(); |
607 |
< |
runCommand(command.toAscii()); |
607 |
> |
runCommand(command.toLatin1()); |
608 |
|
} |
609 |
|
if(m_parameterDialogUi->albedoX->isModified() || |
610 |
|
m_parameterDialogUi->albedoY->isModified() || |
616 |
|
command += m_parameterDialogUi->albedoY->text(); |
617 |
|
command += " "; |
618 |
|
command += m_parameterDialogUi->albedoZ->text(); |
619 |
< |
runCommand(command.toAscii()); |
619 |
> |
runCommand(command.toLatin1()); |
620 |
|
} |
621 |
|
if(m_parameterDialogUi->extinctionX->isModified() || |
622 |
|
m_parameterDialogUi->extinctionY->isModified() || |
633 |
|
{ |
634 |
|
QString command = "set mg "; |
635 |
|
command += m_parameterDialogUi->eccentricity->text(); |
636 |
< |
runCommand(command.toAscii()); |
636 |
> |
runCommand(command.toLatin1()); |
637 |
|
} |
638 |
|
if(m_parameterDialogUi->mistDistance->isModified()) |
639 |
|
{ |
640 |
|
QString command = "set ms "; |
641 |
|
command += m_parameterDialogUi->mistDistance->text(); |
642 |
< |
runCommand(command.toAscii()); |
642 |
> |
runCommand(command.toLatin1()); |
643 |
|
} |
644 |
|
if(m_parameterDialogUi->sample->isModified()) |
645 |
|
{ |
646 |
|
QString command = "set ps "; |
647 |
|
command += m_parameterDialogUi->sample->text(); |
648 |
< |
runCommand(command.toAscii()); |
648 |
> |
runCommand(command.toLatin1()); |
649 |
|
} |
650 |
|
if(m_parameterDialogUi->px_threshold->isModified()) |
651 |
|
{ |
652 |
|
QString command = "set pt "; |
653 |
|
command += m_parameterDialogUi->px_threshold->text(); |
654 |
< |
runCommand(command.toAscii()); |
654 |
> |
runCommand(command.toLatin1()); |
655 |
|
} |
656 |
|
if(m_parameterDialogUi->sp_jitter->isModified()) |
657 |
|
{ |
658 |
|
QString command = "set ss "; |
659 |
|
command += m_parameterDialogUi->sp_jitter->text(); |
660 |
< |
runCommand(command.toAscii()); |
660 |
> |
runCommand(command.toLatin1()); |
661 |
|
} |
662 |
|
if(m_parameterDialogUi->sp_threshold->isModified()) |
663 |
|
{ |
664 |
|
QString command = "set st "; |
665 |
|
command += m_parameterDialogUi->sp_threshold->text(); |
666 |
< |
runCommand(command.toAscii()); |
666 |
> |
runCommand(command.toLatin1()); |
667 |
|
} |
668 |
|
m_parameterDialog->hide(); |
669 |
|
} |
686 |
|
{ |
687 |
|
m_viewDialogUi->angular->setChecked(true); |
688 |
|
} |
689 |
+ |
else if(ourview.type==VT_PLS) |
690 |
+ |
{ |
691 |
+ |
m_viewDialogUi->planispheric->setChecked(true); |
692 |
+ |
} |
693 |
|
else if(ourview.type==VT_CYL) |
694 |
|
{ |
695 |
|
m_viewDialogUi->cylindrical->setChecked(true); |
748 |
|
nv.type = VT_ANG; |
749 |
|
changed = true; |
750 |
|
} |
751 |
+ |
if(m_viewDialogUi->planispheric->isChecked() && nv.type != VT_PLS) |
752 |
+ |
{ |
753 |
+ |
nv.type = VT_PLS; |
754 |
+ |
changed = true; |
755 |
+ |
} |
756 |
|
if(m_viewDialogUi->cylindrical->isChecked() && nv.type != VT_CYL) |
757 |
|
{ |
758 |
|
nv.type = VT_CYL; |
958 |
|
this->currentImageName = QFileDialog::getSaveFileName(this, tr("Save File"), |
959 |
|
"", tr(".hdr images (*.hdr)")); |
960 |
|
QString command = "write " + this->currentImageName; |
961 |
< |
this->runCommand(command.toAscii()); |
961 |
> |
this->runCommand(command.toLatin1()); |
962 |
|
} |
963 |
|
|
964 |
|
void MainWindow::saveCurrentImage() |
969 |
|
return; |
970 |
|
} |
971 |
|
QString command = "write " + this->currentImageName; |
972 |
< |
this->runCommand(command.toAscii()); |
972 |
> |
this->runCommand(command.toLatin1()); |
973 |
|
} |
974 |
|
|
975 |
|
void MainWindow::loadView() |
976 |
|
{ |
977 |
|
QString viewFileName = QFileDialog::getOpenFileName(this, tr("Open View File"), |
978 |
< |
"", tr("View Files (*.vp *.vf)")); |
978 |
> |
"", tr("View Files (*.vf *.vp *.vfh *.vfv)")); |
979 |
|
QString command = "last " + viewFileName; |
980 |
< |
this->runCommand(command.toAscii()); |
980 |
> |
this->runCommand(command.toLatin1()); |
981 |
|
} |
982 |
|
|
983 |
|
void MainWindow::toggleGrayscale() |
991 |
|
{ |
992 |
|
command += " 0"; |
993 |
|
} |
994 |
< |
this->runCommand(command.toAscii()); |
994 |
> |
this->runCommand(command.toLatin1()); |
995 |
|
this->runCommand("new"); |
996 |
|
} |
997 |
|
|
1006 |
|
{ |
1007 |
|
command += " 0"; |
1008 |
|
} |
1009 |
< |
this->runCommand(command.toAscii()); |
1009 |
> |
this->runCommand(command.toLatin1()); |
1010 |
|
this->runCommand("new"); |
1011 |
|
} |
1012 |
|
|
1021 |
|
{ |
1022 |
|
command += " 0"; |
1023 |
|
} |
1024 |
< |
this->runCommand(command.toAscii()); |
1024 |
> |
this->runCommand(command.toLatin1()); |
1025 |
|
this->runCommand("new"); |
1026 |
|
} |
1027 |
|
|
1028 |
+ |
void MainWindow::loadRif() |
1029 |
+ |
{ |
1030 |
+ |
bool ok; |
1031 |
+ |
QString viewName = QInputDialog::getText(this, tr("Input view name"), |
1032 |
+ |
tr("Name of view:"), QLineEdit::Normal, |
1033 |
+ |
"", &ok); |
1034 |
+ |
if (ok && !viewName.isEmpty()) |
1035 |
+ |
{ |
1036 |
+ |
QString radFileName = QFileDialog::getOpenFileName(this, tr("Open rad File"), |
1037 |
+ |
"", tr("rad files (*.rif)")); |
1038 |
+ |
QString command = "L " + viewName + " " + radFileName; |
1039 |
+ |
this->runCommand(command.toLatin1()); |
1040 |
+ |
} |
1041 |
+ |
} |
1042 |
+ |
|
1043 |
|
void MainWindow::appendToRif() |
1044 |
|
{ |
1045 |
|
bool ok; |
1051 |
|
QString radFileName = QFileDialog::getSaveFileName(this, tr("Save File"), |
1052 |
|
"", tr("rad files (*.rif)"), 0, QFileDialog::DontConfirmOverwrite); |
1053 |
|
QString command = "V " + viewName + " " + radFileName; |
1054 |
< |
this->runCommand(command.toAscii()); |
1054 |
> |
this->runCommand(command.toLatin1()); |
1055 |
|
} |
1056 |
|
} |
1057 |
|
|
1062 |
|
if(viewFileName != "") |
1063 |
|
{ |
1064 |
|
QString command = "view " + viewFileName; |
1065 |
< |
this->runCommand(command.toAscii()); |
1065 |
> |
this->runCommand(command.toLatin1()); |
1066 |
|
} |
1067 |
|
} |
1068 |
|
|