Skip to content

Commit

Permalink
Openlime viewer code for casting and saving.
Browse files Browse the repository at this point in the history
  • Loading branch information
ponchio committed Nov 30, 2024
1 parent c0f69f2 commit b6c756d
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
5 changes: 5 additions & 0 deletions relightlab/res.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,10 @@
<file>icons/light/scalable/chevrons-down.svg</file>
<file>icons/light/scalable/chevrons-up.svg</file>
<file alias="relight.png">../build_scripts/relight.png</file>
<file alias="demo/index.html">../demo/index.html</file>
<file alias="demo/openlime.min.js">../demo/openlime.min.js</file>
<file alias="demo/skin.svg">../demo/skin.svg</file>
<file alias="demo/skin.css">../demo/skin.css</file>

</qresource>
</RCC>
1 change: 0 additions & 1 deletion relightlab/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@

* dark theme on windows conflicts
* Accessing the crop tab before loading the project causes it to stop working.
* ptm and hsh number of planes cannot be changed.
* check for invalid inner circle when creating a sphere.
* test pause/stop/play in queue.
* deal with #lights different from #images
Expand Down
18 changes: 16 additions & 2 deletions relightlab/rtiplan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RtiPlanRow::RtiPlanRow(RtiParameters &param, QFrame *parent): QFrame(parent), pa

layout->addStretch(1);

QFrame *buttonsFrame = new QFrame;
buttonsFrame = new QFrame;
buttonsFrame->setMinimumWidth(860);
buttonsFrame->setFrameStyle(QFrame::Box);

Expand Down Expand Up @@ -290,7 +290,16 @@ void RtiQualityRow::allowLossless(bool allow) {
losslessbox->setEnabled(allow);
}

RtiWebLayoutRow::RtiWebLayoutRow(RtiParameters &parameters, QFrame *parent): RtiPlanRow(parameters, parent) {
RtiWebLayoutRow::RtiWebLayoutRow(RtiParameters &parameters, QFrame *parent):
RtiPlanRow(parameters, parent) {
//reparent buttons to make space for export openlime viewer checkbox
QVBoxLayout *content = new QVBoxLayout;
delete buttons;

buttonsFrame->setLayout(content);
buttons = new QHBoxLayout;
content->addLayout(buttons);

label->label->setText("Web layout:");
label->help->setId("rti/web_layout");

Expand All @@ -316,6 +325,11 @@ RtiWebLayoutRow::RtiWebLayoutRow(RtiParameters &parameters, QFrame *parent): Rti
group->addButton(deepzoom);
group->addButton(tarzoom);
group->addButton(itarzoom);

QCheckBox *openlime = new QCheckBox("Add openlime viewer code.");
openlime->setChecked(parameters.openlime);
connect(openlime, &QCheckBox::stateChanged, [this](int state) { this->parameters.openlime = state > 0; });
content->addWidget(openlime);
}

void RtiWebLayoutRow::setWebLayout(RtiParameters::WebLayout layout, bool emitting) {
Expand Down
2 changes: 2 additions & 0 deletions relightlab/rtiplan.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class QSpinBox;
class QLabelButton;
class HelpLabel;
class QHBoxLayout;
class QVBoxLayout;
class QLineEdit;

class RtiPlanRow: public QFrame {
Expand All @@ -21,6 +22,7 @@ class RtiPlanRow: public QFrame {
RtiParameters &parameters;
HelpLabel *label = nullptr;
QHBoxLayout *buttons = nullptr;
QFrame *buttonsFrame = nullptr;
};


Expand Down
3 changes: 3 additions & 0 deletions relightlab/rtitask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ void RtiTask::run() {
} else
builder->save(output.toStdString(), parameters.quality);

if(parameters.openlime)
openlime();

} catch(std::string e) {
error = e.c_str();
status = STOPPED;
Expand Down

0 comments on commit b6c756d

Please sign in to comment.