-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moves save/restore/delete of Stretch from AdvancedStretchTool to StretchTool. #3965
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
cd722a0
Stretch refactor inital move of Blob out of Stretch and creation of S…
krlberry c68530f
Cleanup and move setting of name into CubeStretch class
krlberry 3d3448e
Add band numbers initial work
krlberry e492211
Added the ability to save the band number to the stretch blob and als…
krlberry 3e1a4ea
Merge
krlberry 9f93c4f
Moves primary save/load/delete to StretchTool from AdvancedStretchToo…
krlberry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -291,6 +291,16 @@ namespace Isis { | |
connect(m_flashButton, SIGNAL(pressed()), this, SLOT(stretchChanged())); | ||
connect(m_flashButton, SIGNAL(released()), this, SLOT(stretchChanged())); | ||
|
||
// Buttons migrated out of Advanced Stretch Tool | ||
QPushButton *saveToCubeButton = new QPushButton("Save"); | ||
connect(saveToCubeButton, SIGNAL(clicked(bool)), this, SLOT(saveStretchToCube())); | ||
|
||
QPushButton *deleteFromCubeButton = new QPushButton("Delete"); | ||
connect(deleteFromCubeButton, SIGNAL(clicked(bool)), this, SLOT(deleteFromCube())); | ||
|
||
QPushButton *loadStretchButton = new QPushButton("Load"); | ||
connect(loadStretchButton, SIGNAL(clicked(bool)), this, SLOT(loadStretchFromCube())); | ||
|
||
QHBoxLayout *layout = new QHBoxLayout(hbox); | ||
layout->setMargin(0); | ||
layout->addWidget(m_copyButton); | ||
|
@@ -301,6 +311,13 @@ namespace Isis { | |
layout->addWidget(m_stretchMaxEdit); | ||
layout->addWidget(advancedButton); | ||
layout->addWidget(m_flashButton); | ||
|
||
// should only display if gray stretch | ||
// Save/Restore strech only supported for Grayscale images. Hide buttons if in RGB. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm omitting the change suggested in this comment, because I'm working on adding RGB now. |
||
layout->addWidget(saveToCubeButton); | ||
layout->addWidget(deleteFromCubeButton); | ||
layout->addWidget(loadStretchButton); | ||
|
||
layout->addStretch(); // Pushes everything else left in the menu bar | ||
hbox->setLayout(layout); | ||
|
||
|
@@ -353,6 +370,7 @@ namespace Isis { | |
} | ||
} | ||
|
||
|
||
/** | ||
* Update the streches and corresponding histograms for all the | ||
* colors Red, Green and Blue for Stretch All Mode. | ||
|
@@ -398,8 +416,11 @@ namespace Isis { | |
for (objIter=lab->beginObject(); objIter<lab->endObject(); objIter++) { | ||
if (objIter->name() == "Stretch") { | ||
PvlKeyword tempKeyword = objIter->findKeyword("Name"); | ||
QString tempName = tempKeyword[0]; | ||
namelist.append(tempName); | ||
int bandNumber = int(objIter->findKeyword("BandNumber")); | ||
if (cvp->grayBand() == bandNumber) { | ||
QString tempName = tempKeyword[0]; | ||
namelist.append(tempName); | ||
} | ||
} | ||
} | ||
|
||
|
@@ -412,7 +433,11 @@ namespace Isis { | |
StretchBlob stretchBlob(stretchName); | ||
icube->read(stretchBlob); | ||
CubeStretch cubeStretch = stretchBlob.getStretch(); | ||
m_advancedStretch->restoreSavedStretch(cubeStretch); | ||
if (m_advancedStretch->isVisible()) { | ||
m_advancedStretch->restoreSavedStretch(cubeStretch); | ||
} | ||
cvp->stretchGray(cubeStretch); | ||
emit stretchChanged(); | ||
} | ||
} | ||
|
||
|
@@ -431,8 +456,11 @@ namespace Isis { | |
for (objIter=lab->beginObject(); objIter<lab->endObject(); objIter++) { | ||
if (objIter->name() == "Stretch") { | ||
PvlKeyword tempKeyword = objIter->findKeyword("Name"); | ||
QString tempName = tempKeyword[0]; | ||
namelist.append(tempName); | ||
int bandNumber = int(objIter->findKeyword("BandNumber")); | ||
if (cvp->grayBand() == bandNumber) { | ||
QString tempName = tempKeyword[0]; | ||
namelist.append(tempName); | ||
} | ||
} | ||
} | ||
|
||
|
@@ -538,8 +566,16 @@ namespace Isis { | |
} | ||
} | ||
|
||
CubeStretch stretch = m_advancedStretch->getGrayCubeStretch(); | ||
CubeStretch stretch; | ||
if (m_advancedStretch->isVisible()) { | ||
stretch = m_advancedStretch->getGrayCubeStretch(); | ||
} | ||
else { | ||
stretch = cvp->grayStretch(); | ||
} | ||
|
||
stretch.setName(text); | ||
stretch.setBandNumber(cvp->grayBand()); | ||
StretchBlob stretchBlob(stretch); | ||
icube->write(stretchBlob); | ||
|
||
|
@@ -908,7 +944,6 @@ namespace Isis { | |
m_advancedStretch->updateStretch(cubeViewport()); | ||
m_advancedStretch->show(); | ||
} | ||
|
||
updateTool(); | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not make sense to a programmer in a few days