Skip to content

Commit

Permalink
Merge branch 'master' into develop/update-externals
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Jan 10, 2022
2 parents 74df9ee + a11980f commit 38dbe6d
Show file tree
Hide file tree
Showing 14 changed files with 201 additions and 140 deletions.
27 changes: 15 additions & 12 deletions six/modules/c++/six.sicd/include/six/sicd/ComplexClassification.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ namespace sicd
* \class ComplexClassification
* \brief The implementation of Classification for complex products
*/
class ComplexClassification: public Classification
struct ComplexClassification: public Classification
{
public:
virtual std::string getLevel() const
std::string getLevel() const override
{
return level;
}
Expand All @@ -46,22 +45,26 @@ class ComplexClassification: public Classification
return os;
}

bool operator==(const ComplexClassification& rhs) const
{
return (level == rhs.getLevel() &&
fileOptions == rhs.fileOptions);
}

//! This is spelled out (i.e. 'UNCLASSIFIED')
std::string level;

bool operator==(const ComplexClassification& rhs) const // need member-function for SWIG
{
return static_cast<const Classification&>(*this) == static_cast<const Classification&>(rhs);
}

private:
virtual bool equalTo(const Classification& rhs) const override
bool operator_eq(const ComplexClassification& rhs) const
{
return (level == rhs.getLevel() &&
fileOptions == rhs.fileOptions);
}
bool equalTo(const Classification& rhs) const override
{
const ComplexClassification* classification = dynamic_cast<const ComplexClassification*>(&rhs);
auto classification = dynamic_cast<const ComplexClassification*>(&rhs);
if (classification != nullptr)
{
return *this == *classification;
return this->operator_eq(*classification);
}
return false;
}
Expand Down
9 changes: 6 additions & 3 deletions six/modules/c++/six.sicd/include/six/sicd/ComplexData.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ struct ComplexData: public Data
return six::getImageMode(collectionInformation->radarMode);
}

bool operator==(const ComplexData& rhs) const;

/*
* Check that class members are consistent with each other
*
Expand All @@ -370,8 +368,13 @@ struct ComplexData: public Data
*/
void fillDefaultFields();

bool operator==(const ComplexData& rhs) const // need member-function for SWIG
{
return static_cast<const Data&>(*this) == static_cast<const Data&>(rhs);
}
private:
virtual bool equalTo(const Data& rhs) const override;
bool operator_eq(const ComplexData& rhs) const;
bool equalTo(const Data& rhs) const override;

/*
* Classification contains the classification level (stored in
Expand Down
6 changes: 3 additions & 3 deletions six/modules/c++/six.sicd/source/ComplexData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ComplexData::pixelToImagePoint(const types::RowCol<double>& pixelLoc) const
return imagePt;
}

bool ComplexData::operator==(const ComplexData& rhs) const
bool ComplexData::operator_eq(const ComplexData& rhs) const
{
return (collectionInformation == rhs.collectionInformation &&
imageCreation == rhs.imageCreation &&
Expand All @@ -134,10 +134,10 @@ bool ComplexData::operator==(const ComplexData& rhs) const

bool ComplexData::equalTo(const Data& rhs) const
{
const ComplexData* data = dynamic_cast<const ComplexData*>(&rhs);
auto data = dynamic_cast<const ComplexData*>(&rhs);
if (data != nullptr)
{
return *this == *data;
return this->operator_eq(*data);
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ namespace sidd
*
* Compiler-generated copy constructor and assignment operator are sufficient
*/
class DerivedClassification: public Classification
struct DerivedClassification: public Classification
{
public:
virtual std::string getLevel() const
std::string getLevel() const override
{
return classification;
}
Expand Down Expand Up @@ -233,12 +232,15 @@ class DerivedClassification: public Classification
// that type of data in this document.
BooleanType externalNotice;

bool operator==(const DerivedClassification& rhs) const // need member-function for SWIG
{
return static_cast<const Classification&>(*this) == static_cast<const Classification&>(rhs);
}
private:
//! Equality operator
bool operator==(const DerivedClassification& rhs) const;
bool operator_eq(const DerivedClassification& rhs) const;
bool equalTo(const Classification& rhs) const override;


private:
virtual bool equalTo(const Classification& rhs) const override;
static
void putImpl(const std::string& name,
const std::vector<std::string>& strs,
Expand Down
9 changes: 6 additions & 3 deletions six/modules/c++/six.sidd/include/six/sidd/DerivedData.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,14 @@ struct DerivedData: public Data
types::RowCol<double>
pixelToImagePoint(const types::RowCol<double>& pixelLoc) const;

bool operator==(const DerivedData& rhs) const;

bool operator==(const DerivedData& rhs) const // need member-function for SWIG
{
return static_cast<const Data&>(*this) == static_cast<const Data&>(rhs);
}
private:
bool operator_eq(const DerivedData& rhs) const;
static const char VENDOR_ID[];
virtual bool equalTo(const Data& rhs) const override;
bool equalTo(const Data& rhs) const override;
std::string mVersion;
};
}
Expand Down
37 changes: 22 additions & 15 deletions six/modules/c++/six.sidd/include/six/sidd/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,16 @@ struct Remap

virtual Remap* clone() const = 0;

bool operator==(const Remap& rhs)
{
return this->equalTo(rhs);
}

bool operator!=(const Remap& rhs)
{
return !(*this == rhs);
}

virtual bool equalTo(const Remap& rhs) const = 0;

};
inline bool operator==(const Remap& lhs, const Remap& rhs)
{
return lhs.equalTo(rhs) && rhs.equalTo(lhs);
}
inline bool operator!=(const Remap& lhs, const Remap& rhs)
{
return !(lhs == rhs);
}

/*!
* \struct MonochromeDisplayRemap
Expand Down Expand Up @@ -114,8 +111,13 @@ struct MonochromeDisplayRemap : public Remap
//! Remap parameters
ParameterCollection remapParameters;

virtual bool equalTo(const Remap& rhs) const;
virtual bool operator==(const MonochromeDisplayRemap& rhs) const;
bool equalTo(const Remap& rhs) const override;
bool operator==(const MonochromeDisplayRemap& rhs) const // need member-function for SWIG
{
return static_cast<const Remap&>(*this) == static_cast<const Remap&>(rhs);
}
private:
bool operator_eq(const MonochromeDisplayRemap& rhs) const;
};

/*!
Expand All @@ -140,8 +142,13 @@ struct ColorDisplayRemap : public Remap
return new ColorDisplayRemap(*this);
}

virtual bool equalTo(const Remap& rhs) const;
virtual bool operator==(const ColorDisplayRemap& rhs) const;
bool equalTo(const Remap& rhs) const override;
bool operator==(const ColorDisplayRemap& rhs) const // need member-function for SWIG
{
return static_cast<const Remap&>(*this) == static_cast<const Remap&>(rhs);
}
private:
bool operator_eq(const ColorDisplayRemap& rhs) const;
};

/*!
Expand Down
76 changes: 44 additions & 32 deletions six/modules/c++/six.sidd/include/six/sidd/Measurement.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,26 +79,22 @@ struct Projection
ProjectionType projectionType;
ReferencePoint referencePoint;

virtual ~Projection() {}

friend bool operator==(const Projection& lhs, const Projection& rhs)
{
return lhs.equalTo(rhs);
}

friend bool operator!=(const Projection& lhs, const Projection& rhs)
{
return !(lhs == rhs);
}
virtual ~Projection() = default;

//! Pure
virtual Projection* clone() const = 0;
virtual bool isMeasurable() const { return false; }

private:
virtual bool equalTo(const Projection& rhs) const = 0;

};
inline bool operator==(const Projection& lhs, const Projection& rhs)
{
return lhs.equalTo(rhs) && rhs.equalTo(lhs);
}
inline bool operator!=(const Projection& lhs, const Projection& rhs)
{
return !(lhs == rhs);
}

/*!
* \struct PolynomialProjection
Expand All @@ -115,7 +111,7 @@ struct PolynomialProjection : public Projection
this->projectionType = ProjectionType::POLYNOMIAL;
}

virtual ~PolynomialProjection() {}
virtual ~PolynomialProjection() = default;

/*!
* Define a copy operator
Expand All @@ -142,10 +138,13 @@ struct PolynomialProjection : public Projection
//! Find a col in the image associated with a lat-lon
Poly2D latLonToCol;

bool operator==(const PolynomialProjection& rhs) const;

bool operator==(const PolynomialProjection& rhs) const // need member-function for SWIG
{
return static_cast<const Projection&>(*this) == static_cast<const Projection&>(rhs);
}
private:
virtual bool equalTo(const Projection& rhs) const override;
bool operator_eq(const PolynomialProjection& rhs) const;
bool equalTo(const Projection& rhs) const override;
};

/*!
Expand All @@ -154,7 +153,7 @@ struct PolynomialProjection : public Projection
*/
struct MeasurableProjection : public Projection
{
virtual ~MeasurableProjection() {}
virtual ~MeasurableProjection() = default;

RowColDouble sampleSpacing;

Expand All @@ -163,10 +162,13 @@ struct MeasurableProjection : public Projection

bool isMeasurable() const { return true; }

bool operator==(const MeasurableProjection& rhs) const;

bool operator_eq(const MeasurableProjection& rhs) const;
bool operator==(const MeasurableProjection& rhs) const // need member-function for SWIG
{
return static_cast<const Projection&>(*this) == static_cast<const Projection&>(rhs);
}
private:
virtual bool equalTo(const Projection& rhs) const override;
bool equalTo(const Projection& rhs) const override;
};

/*!
Expand All @@ -179,7 +181,6 @@ struct MeasurableProjection : public Projection
*/
struct GeographicProjection : public MeasurableProjection
{

//! Initialize base class projection type
GeographicProjection()
{
Expand All @@ -191,10 +192,15 @@ struct GeographicProjection : public MeasurableProjection
{
return new GeographicProjection(*this);
}
virtual ~GeographicProjection() {}
virtual ~GeographicProjection() = default;

bool operator==(const GeographicProjection& rhs) const // need member-function for SWIG
{
return static_cast<const Projection&>(*this) == static_cast<const Projection&>(rhs);
}
private:
virtual bool equalTo(const Projection& rhs) const override;
bool operator_eq(const GeographicProjection& rhs) const;
bool equalTo(const Projection& rhs) const override;
};

/*!
Expand All @@ -215,7 +221,7 @@ struct CylindricalProjection : public MeasurableProjection
this->curvatureRadius = Init::undefined<double>();
}

virtual ~CylindricalProjection() {}
virtual ~CylindricalProjection() = default;

/*!
* Define a copy operator
Expand All @@ -236,10 +242,13 @@ struct CylindricalProjection : public MeasurableProjection
*/
double curvatureRadius;

bool operator==(const CylindricalProjection& rhs) const;

bool operator==(const CylindricalProjection& rhs) const // need member-function for SWIG
{
return static_cast<const Projection&>(*this) == static_cast<const Projection&>(rhs);
}
private:
virtual bool equalTo(const Projection& rhs) const override;
bool operator_eq(const CylindricalProjection& rhs) const;
bool equalTo(const Projection& rhs) const override;
};

/*!
Expand All @@ -257,7 +266,7 @@ struct PlaneProjection : public MeasurableProjection
this->projectionType = ProjectionType::PLANE;
}

virtual ~PlaneProjection() {}
virtual ~PlaneProjection() = default;

//! Clone operation
virtual Projection* clone() const
Expand All @@ -268,10 +277,13 @@ struct PlaneProjection : public MeasurableProjection
//! Product plane definition (defined by a basis)
ProductPlane productPlane;

bool operator==(const PlaneProjection& rhs) const;

bool operator==(const PlaneProjection& rhs) const // need member-function for SWIG
{
return static_cast<const Projection&>(*this) == static_cast<const Projection&>(rhs);
}
private:
virtual bool equalTo(const Projection& rhs) const override;
bool operator_eq(const PlaneProjection& rhs) const;
bool equalTo(const Projection& rhs) const override;
};

/*!
Expand Down
Loading

0 comments on commit 38dbe6d

Please sign in to comment.