Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions isis/src/base/apps/spiceinit/SpiceClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,8 @@ namespace Isis {
}

QDomDocument document;
QString errorMsg;
int errorLine, errorCol;

if(!p_response->isEmpty() &&
document.setContent(QString(p_response->toLatin1()),
&errorMsg, &errorLine, &errorCol)) {
QDomDocument::ParseResult result = document.setContent(QString(p_response->toLatin1()));
if(!p_response->isEmpty() && bool(result)) {
return document.firstChild().toElement();
}
else {
Expand Down
11 changes: 5 additions & 6 deletions isis/src/base/apps/spiceserver/spiceserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ namespace Isis {

// Parse the XML with Qt's XML parser... kindof convoluted, I'm sorry
QDomDocument document;
QString error;
int errorLine, errorCol;
if ( document.setContent(QString(xml), &error, &errorLine, &errorCol) ) {
QDomDocument::ParseResult result = document.setContent(QString(xml));
if ( bool(result) ) {
QDomElement rootElement = document.firstChild().toElement();

for ( QDomNode node = rootElement.firstChild();
Expand Down Expand Up @@ -121,9 +120,9 @@ namespace Isis {
}
else {
QString err = "Unable to read XML. The reason given was [";
err += error;
err += "] on line [" + toString(errorLine) + "] column [";
err += toString(errorCol) + "]";
err += result.errorMessage;
err += "] on line [" + QString::number(result.errorLine) + "] column [";
err += QString::number(result.errorColumn) + "]";
throw IException(IException::Io, err, _FILEINFO_);
}
}
Expand Down
2 changes: 1 addition & 1 deletion isis/src/base/objs/AtmosModel/NumericalAtmosApprox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace Isis {
// This method was derived from an algorithm in the text
// Numerical Recipes in C: The Art of Scientific Computing
// Section 4.3 by Flannery, Press, Teukolsky, and Vetterling
int maxits = 20; // maximium number of iterations allowed to converge
constexpr int maxits = 20; // maximium number of iterations allowed to converge
double dss = 0; // error estimate for
double h[maxits+1]; // relative stepsizes for trap
double trap[maxits+1]; // successive trapeziodal approximations
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/objs/AutoReg/AutoReg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,11 +895,11 @@ namespace Isis {
bool AutoReg::ComputeChipZScore(Chip &chip) {
Statistics patternStats;
for(int i = 0; i < chip.Samples(); i++) {
double pixels[chip.Lines()];
std::vector<double> pixels(chip.Lines());
for(int j = 0; j < chip.Lines(); j++) {
pixels[j] = chip.GetValue(i + 1, j + 1);
}
patternStats.AddData(pixels, chip.Lines());
patternStats.AddData(&pixels[0], chip.Lines());
}

// If it does not pass, return
Expand Down
6 changes: 3 additions & 3 deletions isis/src/base/objs/BulletShapeModel/BulletShapeModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@ namespace Isis {
shapefile = (QString) kernels["ShapeModel"];
}

QScopedPointer<BulletTargetShape> v_shape( BulletTargetShape::load(shapefile) );
if (v_shape.isNull() ) {
std::unique_ptr<BulletTargetShape> v_shape( BulletTargetShape::load(shapefile) );
if (v_shape != nullptr) {
QString mess = "Cannot create a BulletShape from " + shapefile;
throw IException(IException::User, mess, _FILEINFO_);
}

// Attempt to initialize the DSK file - exception ensues if errors occur
// error thrown if ShapeModel=Null (i.e. Ellipsoid)
m_model.reset(new BulletWorldManager(shapefile));
m_model->addTarget( v_shape.take() );
m_model->addTarget( v_shape.release() );
}


Expand Down
6 changes: 3 additions & 3 deletions isis/src/base/objs/CubeDataThread/CubeDataThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ namespace Isis {
// Destroy the cubes still in memory
if (p_managedCubes) {
for (int i = p_managedCubes->size() - 1; i >= 0; i--) {
if ((p_managedCubes->end() - 1)->first) // only delete if we own it!
delete (p_managedCubes->end() - 1).value().second;
p_managedCubes->erase(p_managedCubes->end() - 1);
if (std::prev(p_managedCubes->end())->first) // only delete if we own it!
delete std::prev(p_managedCubes->end()).value().second;
p_managedCubes->erase(std::prev(p_managedCubes->end()));
}
}

Expand Down
10 changes: 5 additions & 5 deletions isis/src/base/objs/ExportPdsTable/ExportPdsTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ namespace Isis {
// create an array of nulls to pad
// from the end of each row to the end of the record
int numRowNulls = outputFileRecordBytes - m_rowBytes;
char endRowPadding[numRowNulls];
std::vector<char> endRowPadding(numRowNulls);
for (int i = 0; i < numRowNulls; i++) {
endRowPadding[i] = '\0';
}
Expand All @@ -104,11 +104,11 @@ namespace Isis {

for(int recIndex = 0; recIndex < m_isisTable->Records(); recIndex++) {
TableRecord record = (*m_isisTable)[recIndex];
char rowBuffer[record.RecordSize()];
Pack(record, rowBuffer, endianSwap);
std::vector<char> rowBuffer(record.RecordSize());
Pack(record, &rowBuffer[0], endianSwap);
int i = recIndex*m_outputRecordBytes;
memmove(pdsTableBuffer + i, &rowBuffer, record.RecordSize());
memmove(pdsTableBuffer + i + m_rowBytes, &endRowPadding, numRowNulls);
memmove(pdsTableBuffer + i, &rowBuffer[0], record.RecordSize());
memmove(pdsTableBuffer + i + m_rowBytes, &endRowPadding[0], numRowNulls);
}
return fillMetaData();
}
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/objs/GisGeometry/GisGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ namespace Isis {
}

GisTopology *gis(GisTopology::instance());
QScopedPointer<GisGeometry> geom(new GisGeometry());
std::unique_ptr<GisGeometry> geom(new GisGeometry());

geom->m_type = m_type;
geom->m_geom = gis->clone(m_geom);
geom->m_preparedGeom = makePrepared(geom->m_geom);
return (geom.take());
return (geom.release());
}


Expand Down
18 changes: 2 additions & 16 deletions isis/src/base/objs/GridPolygonSeeder/GridPolygonSeeder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,7 @@ namespace Isis {
// of the grid.
int xSteps = (int)((polyBoundBox->getMaxX() - polyBoundBox->getMinX()) / p_Xspacing + 1.5);
int ySteps = (int)((polyBoundBox->getMaxY() - polyBoundBox->getMinY()) / p_Yspacing + 1.5);
PointStatus pointCheck[xSteps][ySteps];

// Initialize our grid of point status'
for(int y = 0; y < ySteps; y++) {
for(int x = 0; x < xSteps; x++) {
pointCheck[x][y] = pointShouldCheck;
}
}
std::vector<std::vector<PointStatus>> pointCheck(xSteps, std::vector<PointStatus>(ySteps, pointShouldCheck));

/**
* This is a pretty good equation for how much precision is to be used in the in-depth checks
Expand Down Expand Up @@ -312,14 +305,7 @@ namespace Isis {
gridNewCheckPt,
gridCheckPt
};

GridPoint grid[gridSize][gridSize];

for(int y = 0; y < gridSize; y++) {
for(int x = 0; x < gridSize; x++) {
grid[x][y] = gridEmpty;
}
}
std::vector<std::vector<GridPoint>> grid(gridSize, std::vector<GridPoint>(gridSize, gridEmpty));

// Precision 0: Always center, this is always true
grid[gridSize/2][gridSize/2] = gridCheckPt;
Expand Down
25 changes: 13 additions & 12 deletions isis/src/base/objs/Gui/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ namespace Isis {
int status = QMessageBox::warning(this,
ui.ProgramName(),
p_errorString,
"Ok", "Abort", "", 0, 1);
QMessageBox::Ok | QMessageBox::Abort,
QMessageBox::Ok);
p_errorString.clear();
return status;
}
Expand All @@ -634,22 +635,22 @@ namespace Isis {
if(p_processAction->isEnabled()) return;

Isis::UserInterface &ui = Application::GetUserInterface();
switch(QMessageBox::information(this,
ui.ProgramName(),
QString("Program suspended, choose to ") +
QString("continue processing, stop ") +
QString("processing or exit the program"),
"Continue",
"Stop",
"Exit", 0, 2)) {
case 0: // Pressed continue
int ret = QMessageBox::information(this,
ui.ProgramName(),
QString("Program suspended, choose to ") +
QString("continue processing, stop ") +
QString("processing or exit the program"),
QMessageBox::Yes | QMessageBox::No | QMessageBox::Close,
QMessageBox::Close);
switch(ret) {
case QMessageBox::Yes: // Pressed continue
break;

case 1: // Pressed stop
case QMessageBox::No: // Pressed stop
p_stop = true;
break;

case 2: // Pressed exit
case QMessageBox::Close: // Pressed exit
p_stop = true;
qApp->quit();
}
Expand Down
41 changes: 21 additions & 20 deletions isis/src/base/objs/Gui/GuiEditFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace Isis {

// Action File-> Open
m_open = new QAction(menuBar);
m_open->setShortcut(Qt::CTRL + Qt::Key_O);
m_open->setShortcut(Qt::CTRL | Qt::Key_O);
m_open->setText("&Open...");
m_open->setToolTip("Open File");
QString whatsThis = "Open a file to edit";
Expand All @@ -97,7 +97,7 @@ namespace Isis {

// Action File-> Save
m_save = new QAction(menuBar);
m_save->setShortcut(Qt::CTRL + Qt::Key_S);
m_save->setShortcut(Qt::CTRL | Qt::Key_S);
m_save->setText("&Save...");
m_save->setToolTip("Save File");
m_save->setWhatsThis("Save the current file");
Expand All @@ -107,7 +107,7 @@ namespace Isis {
// Action File->Save As
m_saveAs = new QAction(menuBar);
m_saveAs->setText("Save &As...");
m_saveAs->setShortcut(Qt::CTRL + Qt::Key_A);
m_saveAs->setShortcut(Qt::CTRL | Qt::Key_A);
m_saveAs->setToolTip("Save As File");
m_saveAs->setWhatsThis("Save the current file into another file");
connect(m_saveAs, SIGNAL(triggered()), this, SLOT(saveAs()));
Expand All @@ -116,15 +116,15 @@ namespace Isis {
// Action File->close
m_close = new QAction(menuBar);
m_close->setText("&Close...");
m_close->setShortcut(Qt::CTRL + Qt::Key_C);
m_close->setShortcut(Qt::CTRL | Qt::Key_C);
m_close->setToolTip("Close File");
m_close->setWhatsThis("Close the current file");
connect(m_close, SIGNAL(triggered()), this, SLOT(closeFile()));
fileMenu->addAction(m_close);

// Action Exit
m_exit = menuBar->addAction("&Exit");
m_exit->setShortcut(Qt::CTRL + Qt::Key_E);
m_exit->setShortcut(Qt::CTRL | Qt::Key_E);
m_exit->setText("&Exit...");
m_exit->setToolTip("Exit");
m_exit->setWhatsThis("Exit the Editor");
Expand Down Expand Up @@ -194,10 +194,11 @@ namespace Isis {
//Set up the list of filters that are default with this dialog.
//cerr << "setTextChanged=" << m_textChanged << endl;
if (m_textChanged) {
if(QMessageBox::question((QWidget *)parent(), tr("Save File?"),
tr("Are you sure you want to save this file?"),
tr("&Save"), tr("&Cancel"),
QString(), 1, 0)) {
int ret = QMessageBox::question((QWidget *)parent(), tr("Save File?"),
tr("Are you sure you want to save this file?"),
QMessageBox::Save | QMessageBox::Cancel,
QMessageBox::Save);
if(ret) {
saveFile();
}
}
Expand All @@ -215,7 +216,7 @@ namespace Isis {
*
* @author Sharmila Prasad (5/20/2011)
*/
void GuiEditFile::closeFile(){
void GuiEditFile::closeFile() {
if (m_textChanged) {
if(QMessageBox::question((QWidget *)parent(), tr("Save File?"),
tr("Changes have been made to the file. Do you want to Save?"),
Expand All @@ -236,7 +237,7 @@ namespace Isis {
*
* @param psOutFile
*/
void GuiEditFile::OpenFile(QString psOutFile){
void GuiEditFile::OpenFile(QString psOutFile) {
//cerr << "Open File " << psOutFile.toStdString() << "\n";
if(psOutFile.isEmpty()){
QMessageBox::information((QWidget *)parent(), "Error", "No output file selected");
Expand All @@ -251,7 +252,7 @@ namespace Isis {
//m_editWin->setWindowTitle(FileName(psOutFile.toStdString()).Name().c_str());
windowTitle(psOutFile);

if (m_editFile->open(QIODevice::ReadWrite)){
if (m_editFile->open(QIODevice::ReadWrite)) {
char buf[1024];
QString bufStr;
qint64 lineLength = m_editFile->readLine(buf, sizeof(buf));
Expand All @@ -274,8 +275,8 @@ namespace Isis {
*
* @author Sharmila Prasad (5/20/2011)
*/
void GuiEditFile::saveFile(){
if (m_editFile){
void GuiEditFile::saveFile() {
if (m_editFile) {
clearFile();
QTextStream out(m_editFile);
out << m_txtEdit->document()->toPlainText();
Expand Down Expand Up @@ -315,9 +316,10 @@ namespace Isis {
m_editFile->close();
delete(m_editFile);
m_editFile = new QFile(psNewFile);
m_editFile->open(QFile::ReadWrite);
saveFile();
windowTitle(psNewFile);
if (m_editFile->open(QFile::ReadWrite)) {
saveFile();
windowTitle(psNewFile);
}
}

/**
Expand All @@ -326,10 +328,9 @@ namespace Isis {
*
* @author Sharmila Prasad (5/23/2011)
*/
void GuiEditFile::clearFile(){
if (m_editFile){
void GuiEditFile::clearFile() {
if (m_editFile) {
m_editFile->close();
//m_editFile->open(QIODevice::Truncate | QIODevice::ReadWrite);
m_editFile->open(QFile::ReadWrite | QFile::Truncate);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ namespace Isis {
*
* @return conversion was successful
*/
bool LineScanCameraGroundMap::SetGround(const Latitude &lat,
const Longitude &lon) {
bool LineScanCameraGroundMap::SetGround(const Latitude &lat, const Longitude &lon) {
Distance radius(p_camera->LocalRadius(lat, lon));

if (radius.isValid()) {
Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/objs/NaifDskPlateModel/NaifDskPlateModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ namespace Isis {
}

// Open the NAIF Digital Shape Kernel (DSK)
QScopedPointer<NaifDskDescriptor> dsk(new NaifDskDescriptor());
std::unique_ptr<NaifDskDescriptor> dsk(new NaifDskDescriptor());
dsk->m_dskfile = dskfile;
NaifStatus::CheckErrors();
dasopr_c( dskFile.expanded().toLatin1().data(), &dsk->m_handle );
Expand All @@ -376,7 +376,7 @@ namespace Isis {
NaifStatus::CheckErrors();

// return pointer
return ( dsk.take() );
return ( dsk.release() );
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2752,7 +2752,7 @@ namespace Isis {
}
int n = Size();
p_clampedSecondDerivs.resize(n);
double u[n];
std::vector<double> u(n);
double p, sig, qn, un;

if(p_clampedDerivFirstPt > 0.99e30) {
Expand Down Expand Up @@ -3244,7 +3244,9 @@ namespace Isis {
double y;

int ns;
double den, dif, dift, c[n], d[n], ho, hp, w;
std::vector<double> c(n);
std::vector<double> d(n);
double den, dif, dift, ho, hp, w;
double *err = 0;
ns = 1;
dif = fabs(a - p_x[0]);
Expand Down
Loading
Loading