Skip to content

Commit

Permalink
Add override methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Dec 19, 2023
1 parent e748c28 commit 05292fe
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 50 deletions.
16 changes: 15 additions & 1 deletion libs/maps/include/mrpt/maps/CColouredPointsMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CColouredPointsMap : public CPointsMap
CColouredPointsMap(const CPointsMap& o) { CPointsMap::operator=(o); }
CColouredPointsMap(const CColouredPointsMap& o) : CPointsMap()
{
impl_copyFrom(o);
CColouredPointsMap::impl_copyFrom(o);
}
CColouredPointsMap& operator=(const CPointsMap& o)
{
Expand Down Expand Up @@ -227,6 +227,20 @@ class CColouredPointsMap : public CPointsMap
* predefined value */
void resetPointsMinDist(float defValue = 2000.0f);

// clang-format off
auto getPointsBufferRef_color_R() const -> const mrpt::aligned_std_vector<float>* override { return &m_color_R;}
auto getPointsBufferRef_color_G() const -> const mrpt::aligned_std_vector<float>* override { return &m_color_G; }
auto getPointsBufferRef_color_B() const -> const mrpt::aligned_std_vector<float>* override { return &m_color_B; }

auto getPointsBufferRef_color_R() -> mrpt::aligned_std_vector<float>* override { return &m_color_R; }
auto getPointsBufferRef_color_G() -> mrpt::aligned_std_vector<float>* override { return &m_color_G; }
auto getPointsBufferRef_color_B() -> mrpt::aligned_std_vector<float>* override { return &m_color_B; }

void insertPointField_color_R(float v) override { m_color_R.push_back(v); }
void insertPointField_color_G(float v) override { m_color_G.push_back(v); }
void insertPointField_color_B(float v) override { m_color_B.push_back(v); }
/// clang-format on

/** @name PCL library support
@{ */

Expand Down
19 changes: 6 additions & 13 deletions libs/maps/include/mrpt/maps/CPointsMapXYZI.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,6 @@ class CPointsMapXYZI : public CPointsMap
return m_intensity[index];
}

/** Provides a direct access to a read-only reference of the internal
* intensity point buffer. \sa getPointsBufferRef_x() */
auto getPointsBufferRef_intensity() const
-> const mrpt::aligned_std_vector<float>* override
{
return &m_intensity;
}
auto getPointsBufferRef_intensity()
-> mrpt::aligned_std_vector<float>* override
{
return &m_intensity;
}

/** Returns true if the point map has a color field for each point */
bool hasColorPoints() const override { return true; }

Expand All @@ -189,6 +176,12 @@ class CPointsMapXYZI : public CPointsMap
void getVisualizationInto(
mrpt::opengl::CSetOfObjects& outObj) const override;

// clang-format off
auto getPointsBufferRef_intensity() const -> const mrpt::aligned_std_vector<float>* override { return &m_intensity; }
auto getPointsBufferRef_intensity() -> mrpt::aligned_std_vector<float>* override { return &m_intensity; }
void insertPointField_Intensity(float i) override { m_intensity.push_back(i); }
/// clang-format on

/** @name PCL library support
@{ */

Expand Down
50 changes: 14 additions & 36 deletions libs/maps/include/mrpt/maps/CPointsMapXYZIRT.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,42 +229,6 @@ class CPointsMapXYZIRT : public CPointsMap
return m_intensity[index];
}

auto getPointsBufferRef_intensity() const
-> const mrpt::aligned_std_vector<float>* override
{
return &m_intensity;
}

auto getPointsBufferRef_ring() const
-> const mrpt::aligned_std_vector<uint16_t>* override
{
return &m_ring;
}

auto getPointsBufferRef_timestamp() const
-> const mrpt::aligned_std_vector<float>* override
{
return &m_time;
}

auto getPointsBufferRef_intensity()
-> mrpt::aligned_std_vector<float>* override
{
return &m_intensity;
}

auto getPointsBufferRef_ring()
-> mrpt::aligned_std_vector<uint16_t>* override
{
return &m_ring;
}

auto getPointsBufferRef_timestamp()
-> mrpt::aligned_std_vector<float>* override
{
return &m_time;
}

/** Returns true if the point map has a color field for each point */
bool hasColorPoints() const override { return true; }

Expand All @@ -274,6 +238,20 @@ class CPointsMapXYZIRT : public CPointsMap
void getVisualizationInto(
mrpt::opengl::CSetOfObjects& outObj) const override;

// clang-format off
auto getPointsBufferRef_intensity() const -> const mrpt::aligned_std_vector<float>* override { return &m_intensity; }
auto getPointsBufferRef_ring() const -> const mrpt::aligned_std_vector<uint16_t>* override { return &m_ring; }
auto getPointsBufferRef_timestamp() const -> const mrpt::aligned_std_vector<float>* override { return &m_time; }

auto getPointsBufferRef_intensity() -> mrpt::aligned_std_vector<float>* override { return &m_intensity; }
auto getPointsBufferRef_ring() -> mrpt::aligned_std_vector<uint16_t>* override { return &m_ring; }
auto getPointsBufferRef_timestamp() -> mrpt::aligned_std_vector<float>* override { return &m_time; }

void insertPointField_Intensity(float i) override { m_intensity.push_back(i); }
void insertPointField_Ring(uint16_t r) override { m_ring.push_back(r); }
void insertPointField_Timestamp(float t) override { m_time.push_back(t); }
/// clang-format on

protected:
/** The intensity/reflectance data */
mrpt::aligned_std_vector<float> m_intensity;
Expand Down

0 comments on commit 05292fe

Please sign in to comment.