Skip to content

Commit

Permalink
More depreciation updates for qt.
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Stamile committed Apr 21, 2022
1 parent 421f33c commit 9f0cf8d
Show file tree
Hide file tree
Showing 54 changed files with 189 additions and 186 deletions.
6 changes: 4 additions & 2 deletions isis/src/base/apps/isisminer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <QString>
#include <QStringList>
#include <QTime>
#include <QElapsedTimer>

// boost library
#include <boost/foreach.hpp>
Expand Down Expand Up @@ -113,13 +114,14 @@ void IsisMain() {
<< " (TimeIn: " << stime.toString("hh:mm:ss.zzz")
<< ")\n"
<< "Description: " << strategy->description() << "\n";
stime.start();
QElapsedTimer stimer;
stimer.start();
int n = strategy->apply(resources);
unsigned int ntotal = strategy->totalProcessed();
cout << n << " of " << ntotal << " processed in "
<< strategy->type() << "::" << strategy->name()
<< " (TimeOut: " << QTime::currentTime().toString("hh:mm:ss.zzz") << ")\n";
cout << "ElapsedTime(s): " << stime.elapsed() / 1000 << "\n";
cout << "ElapsedTime(s): " << stimer.elapsed() / 1000 << "\n";
}

// Get total elapded time
Expand Down
4 changes: 1 addition & 3 deletions isis/src/base/apps/spiceinit/SpiceClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,9 +644,7 @@ namespace Isis {
QString encodedString = elementContents(pointingTag);

QByteArray encodedArray;
for (int i = 0; i < encodedString.size(); i++) {
encodedArray.append(encodedString.data()[i]);
}
encodedArray.append(encodedString.toUtf8());

QByteArray unencodedArray(QByteArray::fromHex(encodedArray));

Expand Down
4 changes: 2 additions & 2 deletions isis/src/base/objs/Application/Application.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ find files of those names at the top level of this repository. **/
#include <iostream>
#include <fstream>
#include <QString>
#include <QTime>
#include <QElapsedTimer>
#include <string>
#include <ctime>

Expand Down Expand Up @@ -148,7 +148,7 @@ namespace Isis {
QLocalSocket *p_connectionToParent; //!<
time_t p_startTime; //!<
clock_t p_startClock; //!<
QTime m_connectTime; //!< Used to calculate program's run time
QElapsedTimer m_connectTime; //!< Used to calculate program's run time
QString p_datetime; //!<
int p_startDirectIO; //!<
int p_startPageFaults; //!<
Expand Down
12 changes: 6 additions & 6 deletions isis/src/base/objs/BulletTargetShape/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ using namespace Isis;
int main(int argc, char *argv[]) {
try {
qDebug() << "Testing BulletTargetShape";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing default constructor";
qDebug() << "";
BulletTargetShape defaultTargetShape;
qDebug() << "Target name: " << defaultTargetShape.name();
qDebug() << "Maximum distance in kilometers: " << defaultTargetShape.maximumDistance();
qDebug() << "btCollisionBody pointer is valid? " << (bool) defaultTargetShape.body();
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing load constructor";
QString dskfile("$ISISTESTDATA/isis/src/base/unitTestData/hay_a_amica_5_itokawashape_v1_0_64q.bds");
Expand All @@ -37,30 +37,30 @@ int main(int argc, char *argv[]) {
qDebug() << "Target name: " << itokawaTargetShape->name();
qDebug() << "Maximum distance in kilometers: " << itokawaTargetShape->maximumDistance();
qDebug() << "btCollisionBody pointer is valid? " << (bool) itokawaTargetShape->body();
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing load constructor with cube";
QString itokawaCube = "$ISISTESTDATA/isis/src/hayabusa/unitTestData/st_2391934788_v.cub";
qDebug() << "Testing with " << itokawaCube << "...";
qDebug() << "";
BulletTargetShape *cubeTargetShape = BulletTargetShape::load(itokawaCube);
qDebug() << "Target shape pointer is valid?" << (bool) cubeTargetShape;
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing load constructor with other extension";
QString otherFile = "$ISISTESTDATA/isis/src/base/unitTestData/xmlTestLabel.xml";
qDebug() << "Testing with " << otherFile << "...";
qDebug() << "";
BulletTargetShape *otherTargetShape = BulletTargetShape::load(otherFile);
qDebug() << "Target shape pointer is valid?" << (bool) otherTargetShape;
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing collision body constructor";
BulletTargetShape collisionTargetShape(itokawaTargetShape->body(), "Itokawa");
qDebug() << "Target name: " << collisionTargetShape.name();
qDebug() << "Maximum distance in kilometers: " << collisionTargetShape.maximumDistance();
qDebug() << "btCollisionBody pointer is valid? " << (bool) collisionTargetShape.body();
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing null collision body constructor";
BulletTargetShape nullTargetShape(0, "Null");
Expand Down
24 changes: 12 additions & 12 deletions isis/src/base/objs/EmbreeShapeModel/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) {

QString dskfile("$ISISTESTDATA/isis/src/base/unitTestData/hay_a_amica_5_itokawashape_v1_0_64q.bds");
qDebug() << "Testing with " << dskfile << "...";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Get an instance of the target manager";
qDebug() << "";
Expand Down Expand Up @@ -89,7 +89,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing observer look direction intersection";
qDebug() << endl;
qDebug() << Qt::endl;
std::vector<double> observerVec(3, 0.0);
std::vector<double> lookVec(3, 0.0);
observerVec[0] = 1000.0;
Expand All @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing observer look direction non-intersection";
qDebug() << endl;
qDebug() << Qt::endl;
observerVec[0] = 1000.0;
observerVec[1] = 1000.0;
observerVec[2] = 1000.0;
Expand All @@ -131,7 +131,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing latitude, longitude intersection";
qDebug() << endl;
qDebug() << Qt::endl;

Latitude testLat(45, Angle::Degrees);
Longitude testLon(85, Angle::Degrees);
Expand All @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing latitude, longitude occlusion";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Using " << itokawaCubeFile;
Latitude occLat(0, Angle::Degrees);
Expand All @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing surface point intersection";
qDebug() << endl;
qDebug() << Qt::endl;

testLat.setDegrees(0.0);
testLon.setDegrees(200.0);
Expand All @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing surface point occlusion";
qDebug() << endl;
qDebug() << Qt::endl;

testLat.setDegrees(-45.0);
testLon.setDegrees(80.0);
Expand All @@ -220,7 +220,7 @@ int main(int argc, char *argv[]) {
qDebug() << "";

qDebug() << "Testing local radius";
qDebug() << endl;
qDebug() << Qt::endl;

testLat.setDegrees(35.0);
testLon.setDegrees(270.0);
Expand All @@ -232,7 +232,7 @@ int main(int argc, char *argv[]) {
outputModelStatus(itokawaModel);

qDebug() << "Testing visibility check";
qDebug() << endl;
qDebug() << Qt::endl;

observerVec[0] = 1000.0;
observerVec[1] = 0.0;
Expand Down Expand Up @@ -267,7 +267,7 @@ int main(int argc, char *argv[]) {
<< itokawaModel.isVisibleFrom(observerVec, lookVec);

qDebug() << "Testing default ellipsoid normal";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Starting model status";
outputModelStatus(itokawaModel);
Expand All @@ -276,7 +276,7 @@ int main(int argc, char *argv[]) {
outputModelStatus(itokawaModel);

qDebug() << "Testing photometric angles";
qDebug() << endl;
qDebug() << Qt::endl;

outputModelStatus(itokawaModel);
observerVec[0] = 1000.0;
Expand All @@ -289,7 +289,7 @@ int main(int argc, char *argv[]) {
qDebug() << "Incidence angle: " << itokawaModel.incidenceAngle(observerVec);

qDebug() << "Testing errors";
qDebug() << endl;
qDebug() << Qt::endl;

}
catch (IException &e) {
Expand Down
58 changes: 29 additions & 29 deletions isis/src/base/objs/EmbreeTargetShape/unitTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int main(int argc, char *argv[]) {
Preference::Preferences(true);

qDebug() << "RTCMultiHitRay";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Creating default ray";
RTCMultiHitRay defaultRay;
Expand All @@ -75,10 +75,10 @@ int main(int argc, char *argv[]) {
LinearAlgebra::Vector linRayDirection = LinearAlgebra::vector(32.4, 15, -1.6);
RTCMultiHitRay linRay(linRayOrigin, linRayDirection);
outputMultiHitRay(linRay);
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "RTCOcclusionRay";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Creating default ray";
RTCOcclusionRay defaultOccRay;
Expand All @@ -93,10 +93,10 @@ int main(int argc, char *argv[]) {
qDebug() << "Creating ray from linear algebra vectors";
RTCOcclusionRay linOccRay(linRayOrigin, linRayDirection);
outputOcclusionRay(linOccRay);
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "RayHitInformation";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Creating default ray hit information";
RayHitInformation defaultHit;
Expand All @@ -106,10 +106,10 @@ int main(int argc, char *argv[]) {
qDebug() << "Creating ray hit information from intersection, normal, and primitive ID";
RayHitInformation testHit(linRayOrigin, linRayDirection, -10);
outputRayHitInformation(testHit);
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "EmbreeTargetShape";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Creating default target shape";
EmbreeTargetShape defaultShape;
Expand All @@ -126,14 +126,14 @@ int main(int argc, char *argv[]) {
qDebug() << " Z min: " << defaultBounds.lower_z;
qDebug() << " Z max: " << defaultBounds.upper_z;
qDebug() << " Maximum distance: " << defaultShape.maximumSceneDistance();
qDebug() << endl;
qDebug() << Qt::endl;

QString dskfile("$ISISTESTDATA/isis/src/base/unitTestData/hay_a_amica_5_itokawashape_v1_0_64q.bds");
qDebug() << "Testing with " << dskfile << "...";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Loading shapefile";
qDebug() << endl;
qDebug() << Qt::endl;

EmbreeTargetShape itokawaShape(dskfile);
qDebug() << "Target shape name: " << itokawaShape.name();
Expand All @@ -149,98 +149,98 @@ int main(int argc, char *argv[]) {
qDebug() << " Z min: " << itokawaBounds.lower_z;
qDebug() << " Z max: " << itokawaBounds.upper_z;
qDebug() << " Maximum distance: " << itokawaShape.maximumSceneDistance();
qDebug() << endl;
qDebug() << Qt::endl;

// Vectors for observer-look direction intersections
LinearAlgebra::Vector observer(3);
LinearAlgebra::Vector lookDirection(3);

qDebug() << "Testing axes ray intersection:";
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 1000.0; observer[1] = 0.0; observer[2] = 0.0;
lookDirection[0] = -1.0; lookDirection[1] = 0.0; lookDirection[2] = 0.0;
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 0.0; observer[1] = 1000.0; observer[2] = 0.0;
lookDirection[0] = 0.0; lookDirection[1] = -1.0; lookDirection[2] = 0.0;
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 0.0; observer[1] = 0.0; observer[2] = 1000.0;
lookDirection[0] = 0.0; lookDirection[1] = 0.0; lookDirection[2] = -1.0;
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing offset ray intersection:";
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 100.0; observer[1] = 0.05; observer[2] = 0.0;
lookDirection[0] = -1.0; lookDirection[1] = 0.0; lookDirection[2] = 0.0;
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 0.0; observer[1] = 100.0; observer[2] = 0.05;
lookDirection[0] = 0.0; lookDirection[1] = -1.0; lookDirection[2] = 0.0;
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 0.05; observer[1] = 0.0; observer[2] = 100.0;
lookDirection[0] = 0.0; lookDirection[1] = 0.0; lookDirection[2] = -1.0;
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing diagonal ray intersection:";
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 10.0; observer[1] = 10.05; observer[2] = 0.0;
lookDirection[0] = -1.0; lookDirection[1] = -1.0; lookDirection[2] = 0.0;
lookDirection = LinearAlgebra::normalize(lookDirection);
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 0.0; observer[1] = 10.0; observer[2] = 10.05;
lookDirection[0] = 0.0; lookDirection[1] = -1.0; lookDirection[2] = -1.0;
lookDirection = LinearAlgebra::normalize(lookDirection);
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 10.05; observer[1] = 0.0; observer[2] = 10.0;
lookDirection[0] = -1.0; lookDirection[1] = 0.0; lookDirection[2] = -1.0;
lookDirection = LinearAlgebra::normalize(lookDirection);
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 10.0; observer[1] = 10.0; observer[2] = 10.0;
lookDirection[0] = -1.0; lookDirection[1] = -1.0; lookDirection[2] = -1.0;
lookDirection = LinearAlgebra::normalize(lookDirection);
outputIntersection(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing ray occlusion:";
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 3.0; observer[1] = 2.0; observer[2] = 1.0;
lookDirection[0] = -3.0; lookDirection[1] = -2.0; lookDirection[2] = -1.0;
lookDirection = LinearAlgebra::normalize(lookDirection);
outputOcclusion(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 3.0; observer[1] = 2.0; observer[2] = 1.0;
lookDirection[0] = -3.1; lookDirection[1] = -1.9; lookDirection[2] = -1.1;
lookDirection = LinearAlgebra::normalize(lookDirection);
outputOcclusion(itokawaShape, observer, lookDirection);
qDebug() << endl;
qDebug() << Qt::endl;

observer[0] = 1.0; observer[1] = 1.0; observer[2] = 1.0;
lookDirection[0] = -0.9; lookDirection[1] = -1.1; lookDirection[2] = -1.0;
lookDirection = LinearAlgebra::normalize(lookDirection);
outputOcclusion(itokawaShape, observer, lookDirection, 36496);
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Testing error throws";
qDebug() << endl;
qDebug() << Qt::endl;

qDebug() << "Invalid shapefile";
try {
Expand Down
Loading

0 comments on commit 9f0cf8d

Please sign in to comment.