Skip to content

Commit

Permalink
saveWork
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayLimaye committed Jun 29, 2015
1 parent 27af8e4 commit 9026bfa
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
13 changes: 9 additions & 4 deletions tools/paint-graphcut/drishtipaint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,14 @@ DrishtiPaint::on_help_clicked()
}

void DrishtiPaint::on_saveImage_triggered() { m_imageWidget->saveImage(); }
void DrishtiPaint::on_saveWork_triggered()
void
DrishtiPaint::on_saveWork_triggered()
{
saveWork();
QMessageBox::information(0, "Save Work", "Tags, Curves and Fibers saved");
}
void
DrishtiPaint::saveWork()
{
if (m_volume->isValid())
{
Expand All @@ -246,8 +253,6 @@ void DrishtiPaint::on_saveWork_triggered()
m_imageWidget->saveCurves(curvesfile);

m_volume->saveIntermediateResults();

QMessageBox::information(0, "Save Work", "Tags, Curves and Fibers saved");
}
}

Expand Down Expand Up @@ -1777,7 +1782,7 @@ void
DrishtiPaint::connectImageWidget()
{
connect(m_imageWidget, SIGNAL(saveWork()),
this, SLOT(on_saveWork_triggered()));
this, SLOT(saveWork()));

connect(m_imageWidget, SIGNAL(getSlice(int)),
this, SLOT(getSlice(int)));
Expand Down
1 change: 1 addition & 0 deletions tools/paint-graphcut/drishtipaint.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class DrishtiPaint : public QMainWindow
void openRecentFile();
void on_actionHelp_triggered();
void on_saveWork_triggered();
void saveWork();
void on_saveImage_triggered();
void on_actionLoad_triggered();
void on_actionLoad_Curves_triggered();
Expand Down
13 changes: 12 additions & 1 deletion tools/paint-graphcut/imagewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,7 @@ ImageWidget::checkRecursive()
if (m_cslc >= m_maxslc)
{
m_applyRecursive = false;
emit saveWork();
}
else
{
Expand Down Expand Up @@ -1508,6 +1509,7 @@ void ImageWidget::endFiber()
{
m_fibers.endFiber();
emit hideEndFiber();
emit saveWork();
}

void
Expand Down Expand Up @@ -1537,6 +1539,7 @@ ImageWidget::freezeLivewire(bool select)
{
endLivewirePropagation();
m_applyRecursive = false;
emit saveWork();
}
return;
}
Expand Down Expand Up @@ -1684,6 +1687,7 @@ ImageWidget::endCurve()
{
m_addingCurvePoints = false;
emit hideEndCurve();
emit saveWork();
}

void
Expand Down Expand Up @@ -1901,6 +1905,7 @@ ImageWidget::freezeModifyUsingLivewire()
closed, c.tag, c.thickness,
false, c.type, seeds);
emit polygonLevels(cg->polygonLevels());
emit saveWork();
}
m_livewire.resetPoly();
}
Expand All @@ -1927,7 +1932,8 @@ ImageWidget::propagateCurves(bool flag)
if (m_applyRecursive) // stop the recursive process
{
endLivewirePropagation();

emit saveWork();

m_applyRecursive = false;
m_extraPressed = false;
m_cslc = 0;
Expand Down Expand Up @@ -1955,6 +1961,7 @@ ImageWidget::fiberModeKeyPressEvent(QKeyEvent *event)
{
m_fibers.removeFiber(m_pickDepth, m_pickWidth, m_pickHeight);
emit viewerUpdate();
emit saveWork();
update();
}
else if (event->key() == Qt::Key_Space)
Expand Down Expand Up @@ -2057,6 +2064,7 @@ ImageWidget::curveModeKeyPressEvent(QKeyEvent *event)
if (m_livewire.poly().count() > 5)
{
freezeLivewire(false);
emit saveWork();
return true;
}
}
Expand All @@ -2067,6 +2075,7 @@ ImageWidget::curveModeKeyPressEvent(QKeyEvent *event)
if (m_addingCurvePoints)
update();
newCurve(false);
emit saveWork();
return true;
}

Expand Down Expand Up @@ -2125,6 +2134,7 @@ ImageWidget::curveModeKeyPressEvent(QKeyEvent *event)
shiftModifier,
m_minHSlice, m_maxHSlice);

emit saveWork();
update();
return true;
}
Expand Down Expand Up @@ -2423,6 +2433,7 @@ ImageWidget::keyPressEvent(QKeyEvent *event)
if (m_applyRecursive) // stop the recursive process
{
endLivewirePropagation();
emit saveWork();

m_applyRecursive = false;
m_extraPressed = false;
Expand Down
2 changes: 1 addition & 1 deletion tools/paint-graphcut/volumefilemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ VolumeFileManager::setSliceMem(int d, uchar *tmp)
m_qfile.close();
//--------

m_memChanged = true;
//m_memChanged = true;
}

uchar*
Expand Down

0 comments on commit 9026bfa

Please sign in to comment.