提交 bf05cfd2 编写于 作者: M Markus Vieth

MomentOfInertiaEstimation: call functions from PCLBase

上级 4ed8b8c5
......@@ -567,8 +567,7 @@ pcl::MomentOfInertiaEstimation<PointT>::getMassCenter (Eigen::Vector3f& mass_cen
template <typename PointT> void
pcl::MomentOfInertiaEstimation<PointT>::setInputCloud (const PointCloudConstPtr& cloud)
{
input_ = cloud;
pcl::PCLBase<PointT>::setInputCloud (cloud);
is_valid_ = false;
}
......@@ -576,10 +575,7 @@ pcl::MomentOfInertiaEstimation<PointT>::setInputCloud (const PointCloudConstPtr&
template <typename PointT> void
pcl::MomentOfInertiaEstimation<PointT>::setIndices (const IndicesPtr& indices)
{
indices_ = indices;
fake_indices_ = false;
use_indices_ = true;
pcl::PCLBase<PointT>::setIndices (indices);
is_valid_ = false;
}
......@@ -587,10 +583,7 @@ pcl::MomentOfInertiaEstimation<PointT>::setIndices (const IndicesPtr& indices)
template <typename PointT> void
pcl::MomentOfInertiaEstimation<PointT>::setIndices (const IndicesConstPtr& indices)
{
indices_.reset (new std::vector<int> (*indices));
fake_indices_ = false;
use_indices_ = true;
pcl::PCLBase<PointT>::setIndices (indices);
is_valid_ = false;
}
......@@ -598,10 +591,7 @@ pcl::MomentOfInertiaEstimation<PointT>::setIndices (const IndicesConstPtr& indic
template <typename PointT> void
pcl::MomentOfInertiaEstimation<PointT>::setIndices (const PointIndicesConstPtr& indices)
{
indices_.reset (new std::vector<int> (indices->indices));
fake_indices_ = false;
use_indices_ = true;
pcl::PCLBase<PointT>::setIndices (indices);
is_valid_ = false;
}
......@@ -609,40 +599,7 @@ pcl::MomentOfInertiaEstimation<PointT>::setIndices (const PointIndicesConstPtr&
template <typename PointT> void
pcl::MomentOfInertiaEstimation<PointT>::setIndices (std::size_t row_start, std::size_t col_start, std::size_t nb_rows, std::size_t nb_cols)
{
if ((nb_rows > input_->height) || (row_start > input_->height))
{
PCL_ERROR ("[PCLBase::setIndices] cloud is only %d height\n", input_->height);
return;
}
if ((nb_cols > input_->width) || (col_start > input_->width))
{
PCL_ERROR ("[PCLBase::setIndices] cloud is only %d width\n", input_->width);
return;
}
const std::size_t row_end = row_start + nb_rows;
if (row_end > input_->height)
{
PCL_ERROR ("[PCLBase::setIndices] %d is out of rows range %d\n", row_end, input_->height);
return;
}
const std::size_t col_end = col_start + nb_cols;
if (col_end > input_->width)
{
PCL_ERROR ("[PCLBase::setIndices] %d is out of columns range %d\n", col_end, input_->width);
return;
}
indices_.reset (new std::vector<int>);
indices_->reserve (nb_cols * nb_rows);
for(std::size_t i = row_start; i < row_end; i++)
for(std::size_t j = col_start; j < col_end; j++)
indices_->push_back (static_cast<int> ((i * input_->width) + j));
fake_indices_ = false;
use_indices_ = true;
pcl::PCLBase<PointT>::setIndices (row_start, col_start, nb_rows, nb_cols);
is_valid_ = false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册