From 69cb258eee63a27f4463a716558cfa92f7a70265 Mon Sep 17 00:00:00 2001 From: Zack Moratto Date: Thu, 21 Mar 2013 18:58:07 -0700 Subject: [PATCH] IsisIO: Become compliant with ISIS 3.4.3 The dropped the 'get' prefix on some of their methods. They switched over to QString in more places. --- src/asp/IsisIO/DiskImageResourceIsis.cc | 22 +++++++++++----------- src/asp/IsisIO/IsisAdjustCameraModel.cc | 2 +- src/asp/IsisIO/IsisInterface.cc | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/asp/IsisIO/DiskImageResourceIsis.cc b/src/asp/IsisIO/DiskImageResourceIsis.cc index d578a5747..5c627220c 100644 --- a/src/asp/IsisIO/DiskImageResourceIsis.cc +++ b/src/asp/IsisIO/DiskImageResourceIsis.cc @@ -63,18 +63,18 @@ namespace vw { void DiskImageResourceIsis::open(std::string const& filename) { m_cube = boost::shared_ptr( new Isis::Cube() ); m_filename = filename; - m_cube->open( m_filename ); + m_cube->open( QString::fromStdString(m_filename) ); VW_ASSERT( m_cube->isOpen(), IOErr() << "DiskImageResourceIsis: Could not open cube file: \"" << filename << "\"." ); // Extract the dimensions of the image - m_format.planes = m_cube->getBandCount(); - m_format.cols = m_cube->getSampleCount(); - m_format.rows = m_cube->getLineCount(); + m_format.planes = m_cube->bandCount(); + m_format.cols = m_cube->sampleCount(); + m_format.rows = m_cube->lineCount(); m_format.pixel_format = VW_PIXEL_SCALAR; - Isis::PixelType isis_ptype = m_cube->getPixelType(); + Isis::PixelType isis_ptype = m_cube->pixelType(); switch (isis_ptype) { case Isis::UnsignedByte: m_bytes_per_pixel = 1; @@ -116,16 +116,16 @@ namespace vw { /// Read the disk image into the given buffer. void DiskImageResourceIsis::read(ImageBuffer const& dest, BBox2i const& bbox) const { - VW_ASSERT(bbox.max().x() <= m_cube->getSampleCount() || - bbox.max().y() <= m_cube->getLineCount(), + VW_ASSERT(bbox.max().x() <= m_cube->sampleCount() || + bbox.max().y() <= m_cube->lineCount(), IOErr() << "DiskImageResourceIsis: requested bbox " << bbox - << " exceeds image dimensions [" << m_cube->getSampleCount() - << " " << m_cube->getLineCount() << "]"); + << " exceeds image dimensions [" << m_cube->sampleCount() + << " " << m_cube->lineCount() << "]"); // Read in the requested tile from the cube file. Note that ISIS // cube pixel indices appear to be 1-based. Isis::Portal buffer( bbox.width(), bbox.height(), - m_cube->getPixelType() ); + m_cube->pixelType() ); buffer.SetPosition(bbox.min().x()+1, bbox.min().y()+1, 1); m_cube->read(buffer); @@ -213,6 +213,6 @@ namespace vw { bool DiskImageResourceIsis::is_map_projected() const { // They used to have a HasProjection. I'm not sure if this fix is // the correct method now. - return m_cube->getProjection() != NULL; + return m_cube->projection() != NULL; } } diff --git a/src/asp/IsisIO/IsisAdjustCameraModel.cc b/src/asp/IsisIO/IsisAdjustCameraModel.cc index 638d5bbbf..d744290d4 100644 --- a/src/asp/IsisIO/IsisAdjustCameraModel.cc +++ b/src/asp/IsisIO/IsisAdjustCameraModel.cc @@ -189,7 +189,7 @@ IsisAdjustCameraModel::camera_pose( Vector2 const& pix ) const { std::string IsisAdjustCameraModel::serial_number() const { Isis::Pvl copy( m_label ); - return Isis::SerialNumber::Compose( copy, true ); + return Isis::SerialNumber::Compose( copy, true ).toStdString(); } double IsisAdjustCameraModel::ephemeris_time( Vector2 const& pix ) const { diff --git a/src/asp/IsisIO/IsisInterface.cc b/src/asp/IsisIO/IsisInterface.cc index 6d298d1b0..fbfb13a0c 100644 --- a/src/asp/IsisIO/IsisInterface.cc +++ b/src/asp/IsisIO/IsisInterface.cc @@ -40,9 +40,9 @@ using namespace asp::isis; IsisInterface::IsisInterface( std::string const& file ) { // Opening labels and camera - Isis::FileName cubefile( file.c_str() ); + Isis::FileName ifilename( QString::fromStdString(file) ); m_label.reset( new Isis::Pvl() ); - m_label->Read( cubefile.expanded() ); + m_label->Read( ifilename.expanded() ); // Opening Isis::Camera m_camera.reset(Isis::CameraFactory::Create( *m_label )); @@ -52,9 +52,9 @@ IsisInterface::~IsisInterface() {} IsisInterface* IsisInterface::open( std::string const& filename ) { // Opening Labels (This should be done somehow though labels) - Isis::FileName cubefile( filename.c_str() ); + Isis::FileName ifilename( QString::fromStdString(filename) ); Isis::Pvl label; - label.Read( cubefile.expanded() ); + label.Read( ifilename.expanded() ); Isis::Camera* camera = Isis::CameraFactory::Create( label ); @@ -92,7 +92,7 @@ int IsisInterface::samples() const { std::string IsisInterface::serial_number() const { Isis::Pvl copy( *m_label ); - return Isis::SerialNumber::Compose( copy, true ); + return Isis::SerialNumber::Compose( copy, true ).toStdString(); } double IsisInterface::ephemeris_time( vw::Vector2 const& pix ) const {