Skip to content

Commit

Permalink
Code cleanup and C++11. openMVG#527
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoulon committed Apr 22, 2016
1 parent b9d8b23 commit 944254c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/openMVG/cameras/Camera_Pinhole.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class Pinhole_Intrinsic : public IntrinsicBase
* @param pose Extrinsic matrix
* @return Concatenation of intrinsic matrix and extrinsic matrix
*/
Mat34 get_projective_equivalent( const geometry::Pose3 & pose ) const
Mat34 get_projective_equivalent( const geometry::Pose3 & pose ) const override
{
Mat34 P;
P_From_KRt( K(), pose.rotation(), pose.translation(), &P );
Expand Down
26 changes: 13 additions & 13 deletions src/openMVG/features/regions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,15 @@ class Binary_Regions : public Regions
//-- Class functions
//--

bool IsScalar() const {return false;}
bool IsBinary() const {return true;}
std::string Type_id() const {return typeid(typename DescriptorT::bin_type).name();}
size_t DescriptorLength() const {return static_cast<size_t>(L);}
bool IsScalar() const override {return false;}
bool IsBinary() const override {return true;}
std::string Type_id() const override {return typeid(typename DescriptorT::bin_type).name();}
size_t DescriptorLength() const override {return static_cast<size_t>(L);}

/// Read from files the regions and their corresponding descriptors.
bool Load(
const std::string& sfileNameFeats,
const std::string& sfileNameDescs)
const std::string& sfileNameDescs) override
{
return loadFeatsFromFile(sfileNameFeats, vec_feats_)
& loadDescsFromBinFile(sfileNameDescs, vec_descs_);
Expand All @@ -230,29 +230,29 @@ class Binary_Regions : public Regions
/// Export in two separate files the regions and their corresponding descriptors.
bool Save(
const std::string& sfileNameFeats,
const std::string& sfileNameDescs) const
const std::string& sfileNameDescs) const override
{
return saveFeatsToFile(sfileNameFeats, vec_feats_)
& saveDescsToBinFile(sfileNameDescs, vec_descs_);
}

bool LoadFeatures(const std::string& sfileNameFeats)
bool LoadFeatures(const std::string& sfileNameFeats) override
{
return loadFeatsFromFile(sfileNameFeats, vec_feats_);
}

PointFeatures GetRegionsPositions() const
PointFeatures GetRegionsPositions() const override
{
return PointFeatures(vec_feats_.begin(), vec_feats_.end());
}

Vec2 GetRegionPosition(size_t i) const
Vec2 GetRegionPosition(size_t i) const override
{
return Vec2f(vec_feats_[i].coords()).cast<double>();
}

/// Return the number of defined regions
size_t RegionCount() const {return vec_feats_.size();}
size_t RegionCount() const override {return vec_feats_.size();}

/// Mutable and non-mutable FeatureT getters.
inline std::vector<FeatureT> & Features() { return vec_feats_; }
Expand All @@ -262,7 +262,7 @@ class Binary_Regions : public Regions
inline std::vector<DescriptorT> & Descriptors() { return vec_descs_; }
inline const std::vector<DescriptorT> & Descriptors() const { return vec_descs_; }

const void * DescriptorRawData() const { return &vec_descs_[0];}
const void * DescriptorRawData() const override { return &vec_descs_[0];}

template<class Archive>
void serialize(Archive & ar)
Expand All @@ -271,13 +271,13 @@ class Binary_Regions : public Regions
ar(vec_descs_);
}

Regions * EmptyClone() const
Regions * EmptyClone() const override
{
return new Binary_Regions;
}

// Return the squared Hamming distance between two descriptors
double SquaredDescriptorDistance(size_t i, const Regions * regions, size_t j) const
double SquaredDescriptorDistance(size_t i, const Regions * regions, size_t j) const override
{
assert(i < vec_descs_.size());
assert(regions);
Expand Down

0 comments on commit 944254c

Please sign in to comment.