Skip to content

Commit

Permalink
Move some functions to pure virtual
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristin Berry authored and tgiroux committed Jun 8, 2021
1 parent 1e1d41a commit d3d35fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ namespace Isis {
m_observationNumber = src.m_observationNumber;
m_instrumentId = src.m_instrumentId;

m_solveSettings = src.m_solveSettings;

m_index = src.m_index;
}

Expand Down Expand Up @@ -121,8 +119,8 @@ namespace Isis {
m_observationNumber = src.m_observationNumber;
m_instrumentId = src.m_instrumentId;

m_solveSettings = src.m_solveSettings;
}

return *this;
}

Expand Down Expand Up @@ -213,18 +211,6 @@ namespace Isis {
}


/**
* Accesses the solve settings
*
* @return @b const BundleObservationSolveSettingsQsp Returns a pointer to the solve
* settings for this AbstractBundleObservation
*/
const BundleObservationSolveSettingsQsp AbstractBundleObservation::solveSettings() {
// NEEDED for BundleMeasure
return m_solveSettings;
}


/**
* Applies the parameter corrections
*
Expand All @@ -241,22 +227,19 @@ namespace Isis {
* @internal
* @todo always returns true?
*/
// FIXME: can this work at parent level or should be pure virtual?
bool AbstractBundleObservation::applyParameterCorrections(LinearAlgebra::Vector corrections) {
// Will be different for ISIS and CSM
return false;
}


/**
* Returns the number of total parameters there are for solving
*
* The total number of parameters is equal to the number of position parameters and number of
* pointing parameters
*
* @return @b int Returns the number of parameters there are
*/
// FIXME: can this work at parent level or should be pure virtual?
int AbstractBundleObservation::numberParameters() {
// different
return 0;
}

Expand All @@ -280,61 +263,6 @@ namespace Isis {
return m_index;
}

/**
* @brief Creates and returns a formatted QString representing the bundle coefficients and
* parameters
*
* @depricated The function formatBundleOutputString is depricated as of ISIS 3.9
* and will be removed in ISIS 4.0
*
* @param errorPropagation Boolean indicating whether or not to attach more information
* (corrections, sigmas, adjusted sigmas...) to the output QString
* @param imageCSV Boolean which is set to true if the function is being
* called from BundleSolutionInfo::outputImagesCSV(). It is set to false by default
* for backwards compatibility.
*
* @return @b QString Returns a formatted QString representing the AbstractBundleObservation
*
* @internal
* @history 2016-10-26 Ian Humphrey - Default values are now provided for parameters that are
* not being solved. Fixes #4464.
*/
QString AbstractBundleObservation::formatBundleOutputString(bool errorPropagation, bool imageCSV) {
// different for both
// TODO: either remove or update.
return "Test";
}


/**
* @brief Takes in an open std::ofstream and writes out information which goes into the
* bundleout.txt file.
*
* @param fpOut The open std::ofstream object which is passed in from
* BundleSolutionInfo::outputText()
* @param errorPropagation Boolean indicating whether or not to attach more information
* (corrections, sigmas, adjusted sigmas...) to the output.
*/
void AbstractBundleObservation::bundleOutputString(std::ostream &fpOut, bool errorPropagation) {
// different in both
}

/**
* @brief Creates and returns a formatted QString representing the bundle coefficients and
* parameters in csv format.
*
* @param errorPropagation Boolean indicating whether or not to attach more information
* (corrections, sigmas, adjusted sigmas...) to the output QString
*
* @return @b QString Returns a formatted QString representing the AbstractBundleObservation in
* csv format
*/
QString AbstractBundleObservation::bundleOutputCSV(bool errorPropagation) {
// different in both
// TODO: either remove or update.
return "Test";
}


// FIXME: will this work for both? CSM can list parameters, right?
QStringList AbstractBundleObservation::parameterList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Isis {

// constructor
AbstractBundleObservation(BundleImageQsp image, QString observationNumber, QString instrumentId,
BundleTargetBodyQsp bundleTargetBody); // target body and CSM question
BundleTargetBodyQsp bundleTargetBody);

// copy constructor
AbstractBundleObservation(const AbstractBundleObservation &src);
Expand Down Expand Up @@ -61,15 +61,14 @@ namespace Isis {
virtual LinearAlgebra::Vector &adjustedSigmas();


// TODO: remove later
virtual const BundleObservationSolveSettingsQsp solveSettings();
virtual const BundleObservationSolveSettingsQsp solveSettings() = 0;
virtual int numberParameters();
virtual bool applyParameterCorrections(LinearAlgebra::Vector corrections);

virtual void bundleOutputString(std::ostream &fpOut,bool errorPropagation);
virtual QString bundleOutputCSV(bool errorPropagation);
virtual void bundleOutputString(std::ostream &fpOut,bool errorPropagation) = 0;
virtual QString bundleOutputCSV(bool errorPropagation) = 0;

virtual QString formatBundleOutputString(bool errorPropagation, bool imageCSV=false);
virtual QString formatBundleOutputString(bool errorPropagation, bool imageCSV=false) = 0;

virtual QStringList parameterList();
virtual QStringList imageNames();
Expand All @@ -96,7 +95,6 @@ namespace Isis {
LinearAlgebra::Vector m_aprioriSigmas;
//! A posteriori (adjusted) parameter sigmas.
LinearAlgebra::Vector m_adjustedSigmas;
BundleObservationSolveSettingsQsp m_solveSettings; //!< Solve settings for this observation.
};

//! Typdef for AbstractBundleObservation QSharedPointer.
Expand Down
1 change: 1 addition & 0 deletions isis/src/control/objs/BundleUtilities/BundleObservation.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ namespace Isis {
bool initParameterWeights();

private:
QStringList m_parameterNamesList; //!< List of all cube parameters.
BundleObservationSolveSettingsQsp m_solveSettings; //!< Solve settings for this observation.

SpiceRotation *m_instrumentRotation; //!< Instrument spice rotation (in primary image).
Expand Down

0 comments on commit d3d35fd

Please sign in to comment.