Loading isis/src/base/objs/Camera/Camera.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,10 @@ namespace Isis { * @param cube The Pvl label from the cube is used to create the Camera object. */ Camera::Camera(Cube &cube) : Sensor(cube) { m_instrumentId = cube.label()->findGroup("Instrument", PvlObject::FindOptions::Traverse).findKeyword("InstrumentId")[0]; m_instrumentNameLong = "Unknown"; m_instrumentNameShort = "Unknown"; m_spacecraftNameLong = "Unknown"; Loading Loading @@ -2876,6 +2880,16 @@ namespace Isis { } /** * This method returns the InstrumentId as it appears in the cube. * * @return QString Returns m_instrumentId */ QString Camera::instrumentId() { return m_instrumentId; } /** * This method returns the full instrument name. * Loading isis/src/base/objs/Camera/Camera.h +7 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,9 @@ namespace Isis { * @history 2017-08-30 Summer Stapleton - Updated documentation. References #4807. * @history 2017-01-11 Christopher Combs - Added bool deleteExisting to SetDistortionMap to * prevent a segfault when the distortion map is incomplete. Fixes $5163. * @hitsory 2018-07-12 Summer Stapleton - Added m_instrumentId and instrumentId() in order to * collect the InstrumentId from the original cube label for * comparisons related to image imports in ipce. References #5460. */ class Camera : public Sensor { Loading Loading @@ -329,6 +332,8 @@ namespace Isis { CameraGroundMap *GroundMap(); CameraSkyMap *SkyMap(); QString instrumentId(); QString instrumentNameLong() const; QString instrumentNameShort() const; QString spacecraftNameLong() const; Loading Loading @@ -497,6 +502,8 @@ namespace Isis { friend class RadarGroundMap; //!< A friend class to calculate focal length friend class RadarSlantRangeMap; //!< A friend class to calculate focal length QString m_instrumentId; //!< The InstrumentId as it appears on the cube. QString m_instrumentNameLong; //!< Full instrument name QString m_instrumentNameShort; //!< Shortened instrument name QString m_spacecraftNameLong; //!< Full spacecraft name Loading isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp +20 −6 Original line number Diff line number Diff line Loading @@ -531,12 +531,26 @@ namespace Isis { if (cube) { // Commenting these out as a quick and dirty fix to segfault related to threading on // astrovm4 until it can be handled properly. -Summer //Camera *camera = cube->camera(); //project()->addCamera(camera); //Target *target = camera->target(); //project()->addTarget(target); // Confirm that the target body and the gui camera do not exist before creating and // and adding them for each image. Since a target may be covered by many cameras and a // camera may cover many targets, have to get tricky with the checking. QString instrumentId = cube->label()->findGroup("Instrument", PvlObject::FindOptions::Traverse).findKeyword("InstrumentId")[0]; QString targetName = cube->label()->findGroup("Instrument", PvlObject::FindOptions::Traverse).findKeyword("TargetName")[0]; if (!project()->hasTarget(targetName)) { Camera *camera = cube->camera(); Target *target = camera->target(); project()->addTarget(target); if (!project()->hasCamera(instrumentId)) { project()->addCamera(camera); } } else if (!project()->hasCamera(instrumentId)) { Camera *camera = cube->camera(); project()->addCamera(camera); } // Create a new image from the result in the thread spawned in WorkOrder::redo(). Image *newImage = new Image(cube); Loading isis/src/qisis/objs/Directory/ImportImagesWorkOrder.h +5 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,11 @@ namespace Isis { * checking in functor operator method. Fixes #4955. * @history 2018-01-18 Tracie Sucharski - Add the targets and gui cameras to the project. * Fixes #5181. * @history 2018-07-12 Summer Stapleton - Updated how adding the targets and the gui cameras to * the project is handled to address segfault. Instead of creating a * camera and a target with every new image imported and adding them if * needed, they are now no longer created in the first place except * when needed. Fixes #5460. * */ class ImportImagesWorkOrder : public WorkOrder { Loading isis/src/qisis/objs/GuiCamera/GuiCamera.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ namespace Isis { // m_radii[1] = target->radii().at(1); // m_radii[2] = target->radii().at(2); m_instrumentId = camera->instrumentId(); m_spacecraftNameShort = camera->spacecraftNameShort(); m_spacecraftNameLong = camera->spacecraftNameLong(); m_instrumentNameShort = camera->instrumentNameShort(); Loading Loading @@ -297,6 +299,16 @@ namespace Isis { return m_id->toString().remove(QRegExp("[{}]")); } /** * @brief Retrieve the InstrumentId as appears in the original cube label. * @return @b QString Returns m_instrumentId */ QString GuiCamera::instrumentId() { return m_instrumentId; } /** * @brief Retrieves an abbreviated version for the name of the instrument. * @return @b QString Returns m_instrumentNameShort. Loading @@ -305,6 +317,7 @@ namespace Isis { return m_instrumentNameShort; } /** * @brief Retrieves a long version for the name of the instrument. * @return @b QString Returns m_instrumentNameLong. Loading @@ -313,6 +326,7 @@ namespace Isis { return m_instrumentNameLong; } /** * @brief Retrieves an abbbreviated name for the spacecraft. * @return @b QString Returns m_spacecraftNameShort. Loading @@ -321,6 +335,7 @@ namespace Isis { return m_spacecraftNameShort; } /** * @brief Retrieves the full name of the spacecraft. * @return @b QString Returns m_spacecraftNameLong. Loading Loading
isis/src/base/objs/Camera/Camera.cpp +14 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,10 @@ namespace Isis { * @param cube The Pvl label from the cube is used to create the Camera object. */ Camera::Camera(Cube &cube) : Sensor(cube) { m_instrumentId = cube.label()->findGroup("Instrument", PvlObject::FindOptions::Traverse).findKeyword("InstrumentId")[0]; m_instrumentNameLong = "Unknown"; m_instrumentNameShort = "Unknown"; m_spacecraftNameLong = "Unknown"; Loading Loading @@ -2876,6 +2880,16 @@ namespace Isis { } /** * This method returns the InstrumentId as it appears in the cube. * * @return QString Returns m_instrumentId */ QString Camera::instrumentId() { return m_instrumentId; } /** * This method returns the full instrument name. * Loading
isis/src/base/objs/Camera/Camera.h +7 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,9 @@ namespace Isis { * @history 2017-08-30 Summer Stapleton - Updated documentation. References #4807. * @history 2017-01-11 Christopher Combs - Added bool deleteExisting to SetDistortionMap to * prevent a segfault when the distortion map is incomplete. Fixes $5163. * @hitsory 2018-07-12 Summer Stapleton - Added m_instrumentId and instrumentId() in order to * collect the InstrumentId from the original cube label for * comparisons related to image imports in ipce. References #5460. */ class Camera : public Sensor { Loading Loading @@ -329,6 +332,8 @@ namespace Isis { CameraGroundMap *GroundMap(); CameraSkyMap *SkyMap(); QString instrumentId(); QString instrumentNameLong() const; QString instrumentNameShort() const; QString spacecraftNameLong() const; Loading Loading @@ -497,6 +502,8 @@ namespace Isis { friend class RadarGroundMap; //!< A friend class to calculate focal length friend class RadarSlantRangeMap; //!< A friend class to calculate focal length QString m_instrumentId; //!< The InstrumentId as it appears on the cube. QString m_instrumentNameLong; //!< Full instrument name QString m_instrumentNameShort; //!< Shortened instrument name QString m_spacecraftNameLong; //!< Full spacecraft name Loading
isis/src/qisis/objs/Directory/ImportImagesWorkOrder.cpp +20 −6 Original line number Diff line number Diff line Loading @@ -531,12 +531,26 @@ namespace Isis { if (cube) { // Commenting these out as a quick and dirty fix to segfault related to threading on // astrovm4 until it can be handled properly. -Summer //Camera *camera = cube->camera(); //project()->addCamera(camera); //Target *target = camera->target(); //project()->addTarget(target); // Confirm that the target body and the gui camera do not exist before creating and // and adding them for each image. Since a target may be covered by many cameras and a // camera may cover many targets, have to get tricky with the checking. QString instrumentId = cube->label()->findGroup("Instrument", PvlObject::FindOptions::Traverse).findKeyword("InstrumentId")[0]; QString targetName = cube->label()->findGroup("Instrument", PvlObject::FindOptions::Traverse).findKeyword("TargetName")[0]; if (!project()->hasTarget(targetName)) { Camera *camera = cube->camera(); Target *target = camera->target(); project()->addTarget(target); if (!project()->hasCamera(instrumentId)) { project()->addCamera(camera); } } else if (!project()->hasCamera(instrumentId)) { Camera *camera = cube->camera(); project()->addCamera(camera); } // Create a new image from the result in the thread spawned in WorkOrder::redo(). Image *newImage = new Image(cube); Loading
isis/src/qisis/objs/Directory/ImportImagesWorkOrder.h +5 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,11 @@ namespace Isis { * checking in functor operator method. Fixes #4955. * @history 2018-01-18 Tracie Sucharski - Add the targets and gui cameras to the project. * Fixes #5181. * @history 2018-07-12 Summer Stapleton - Updated how adding the targets and the gui cameras to * the project is handled to address segfault. Instead of creating a * camera and a target with every new image imported and adding them if * needed, they are now no longer created in the first place except * when needed. Fixes #5460. * */ class ImportImagesWorkOrder : public WorkOrder { Loading
isis/src/qisis/objs/GuiCamera/GuiCamera.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ namespace Isis { // m_radii[1] = target->radii().at(1); // m_radii[2] = target->radii().at(2); m_instrumentId = camera->instrumentId(); m_spacecraftNameShort = camera->spacecraftNameShort(); m_spacecraftNameLong = camera->spacecraftNameLong(); m_instrumentNameShort = camera->instrumentNameShort(); Loading Loading @@ -297,6 +299,16 @@ namespace Isis { return m_id->toString().remove(QRegExp("[{}]")); } /** * @brief Retrieve the InstrumentId as appears in the original cube label. * @return @b QString Returns m_instrumentId */ QString GuiCamera::instrumentId() { return m_instrumentId; } /** * @brief Retrieves an abbreviated version for the name of the instrument. * @return @b QString Returns m_instrumentNameShort. Loading @@ -305,6 +317,7 @@ namespace Isis { return m_instrumentNameShort; } /** * @brief Retrieves a long version for the name of the instrument. * @return @b QString Returns m_instrumentNameLong. Loading @@ -313,6 +326,7 @@ namespace Isis { return m_instrumentNameLong; } /** * @brief Retrieves an abbbreviated name for the spacecraft. * @return @b QString Returns m_spacecraftNameShort. Loading @@ -321,6 +335,7 @@ namespace Isis { return m_spacecraftNameShort; } /** * @brief Retrieves the full name of the spacecraft. * @return @b QString Returns m_spacecraftNameLong. Loading