Skip to content

Commit

Permalink
Remove duplicated dome variable in DomePanel.
Browse files Browse the repository at this point in the history
  • Loading branch information
ponchio committed Jan 9, 2025
1 parent 07118ac commit 03cba0a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
7 changes: 4 additions & 3 deletions relightlab/domepanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void DomePanel::loadLP(QString path) {
QMessageBox::critical(this, "Loading .lp file failed", error);
return;
}

Dome &dome = qRelightApp->project().dome;
dome.lightConfiguration = Dome::DIRECTIONAL;
dome.directions = directions;
QFileInfo info(path);
Expand All @@ -129,7 +129,7 @@ void DomePanel::loadLP(QString path) {

updateDomeList();

emit accept(dome);
emit updated();
}

void DomePanel::loadDome(QString path) {
Expand All @@ -143,6 +143,7 @@ void DomePanel::loadDome(QString path) {
QMessageBox::critical(this, "Loading .dome file failed", error);
return;
}
Dome &dome = qRelightApp->project().dome;
dome = new_dome;

QFileInfo info(path);
Expand All @@ -152,7 +153,7 @@ void DomePanel::loadDome(QString path) {
if(imageWidth != 0 && qRelightApp->project().measures.size() != 0)
dome.imageWidth = imageWidth;
updateDomeList();
emit accept(dome);
emit updated();
}


Expand Down
2 changes: 1 addition & 1 deletion relightlab/domepanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public slots:
void updateDomeList();

signals:
void accept(Dome dome);
void updated();

private:
Dome dome;
Expand Down
4 changes: 0 additions & 4 deletions relightlab/lightgeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,6 @@ void LightsGeometry::init() {
directions_view->initFromDome(dome);
}

void LightsGeometry::setDome(Dome dome) {
qRelightApp->project().dome = dome;
init();
}

void LightsGeometry::setFromSpheres() {
//get spheres & lens from project
Expand Down
5 changes: 1 addition & 4 deletions relightlab/lightgeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ class LightsGeometry: public QFrame {
LightsGeometry(QWidget *parent = nullptr);
~LightsGeometry();

void init();


public slots:
void setDome(Dome dome); //when a dome is selected
void init();
void setFromSpheres(); //when reflective spheres reflections have been processed
void setSpherical(QAbstractButton *button);
void exportDome();
Expand Down
2 changes: 1 addition & 1 deletion relightlab/lightsframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LightsFrame::LightsFrame() {
content->addStretch();

connect(sphere_panel, SIGNAL(updated()), geometry, SLOT(setFromSpheres()));
connect(dome_panel, SIGNAL(accept(Dome)), geometry, SLOT(setDome(Dome)));
connect(dome_panel, SIGNAL(updated()), geometry, SLOT(init()));
}

void LightsFrame::clear() {
Expand Down

0 comments on commit 03cba0a

Please sign in to comment.