Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ class Model {
if (resolution <= 0)
return assembled_;

typename std::map<float, PointTPtrConst>::iterator it =
voxelized_assembled_.find(resolution);
auto it = voxelized_assembled_.find(resolution);
if (it == voxelized_assembled_.end()) {
PointTPtr voxelized(new pcl::PointCloud<PointT>);
pcl::VoxelGrid<PointT> grid_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ pcl::rec_3d_framework::GlobalNNCRHRecognizer<Distance, PointInT, FeatureT>::getP
using mv_pair = std::pair<std::string, int>;
mv_pair pair_model_view = std::make_pair(model.id_, view_id);

std::map<mv_pair,
Eigen::Matrix4f,
std::less<>,
Eigen::aligned_allocator<std::pair<const mv_pair, Eigen::Matrix4f>>>::
iterator it = poses_cache_.find(pair_model_view);
auto it = poses_cache_.find(pair_model_view);

if (it != poses_cache_.end()) {
pose_matrix = it->second;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ pcl::rec_3d_framework::GlobalNNCVFHRecognizer<Distance, PointInT, FeatureT>::get
using mv_pair = std::pair<std::string, int>;
mv_pair pair_model_view = std::make_pair(model.id_, view_id);

std::map<mv_pair,
Eigen::Matrix4f,
std::less<>,
Eigen::aligned_allocator<std::pair<const mv_pair, Eigen::Matrix4f>>>::
iterator it = poses_cache_.find(pair_model_view);
auto it = poses_cache_.find(pair_model_view);

if (it != poses_cache_.end()) {
pose_matrix = it->second;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,11 +460,7 @@ pcl::rec_3d_framework::LocalRecognitionPipeline<Distance, PointInT, FeatureT>::g
using mv_pair = std::pair<std::string, int>;
mv_pair pair_model_view = std::make_pair(model.id_, view_id);

std::map<mv_pair,
Eigen::Matrix4f,
std::less<>,
Eigen::aligned_allocator<std::pair<const mv_pair, Eigen::Matrix4f>>>::
iterator it = poses_cache_.find(pair_model_view);
auto it = poses_cache_.find(pair_model_view);

if (it != poses_cache_.end()) {
pose_matrix = it->second;
Expand All @@ -489,8 +485,7 @@ pcl::rec_3d_framework::LocalRecognitionPipeline<Distance, PointInT, FeatureT>::

if (use_cache_) {
std::pair<std::string, int> pair_model_view = std::make_pair(model.id_, view_id);
typename std::map<std::pair<std::string, int>, PointInTPtr>::iterator it =
keypoints_cache_.find(pair_model_view);
auto it = keypoints_cache_.find(pair_model_view);

if (it != keypoints_cache_.end()) {
keypoints_cloud = it->second;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class PCL_EXPORTS LocalRecognitionPipeline {
}

public:
LocalRecognitionPipeline() : search_model_("")
LocalRecognitionPipeline()
{
use_cache_ = false;
threshold_accept_model_hypothesis_ = 0.2f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ class PCL_EXPORTS OpenNIFrameSource {

pcl::OpenNIGrabber grabber_;
PointCloudPtr most_recent_frame_;
int frame_counter_;
int frame_counter_{0};
std::mutex mutex_;
bool active_;
bool active_{true};
};

} // namespace OpenNIFrameSource
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ writeMatrixToFile(const std::string& file, Eigen::Matrix4f& matrix)
for (std::size_t i = 0; i < 4; i++) {
for (std::size_t j = 0; j < 4; j++) {
out << matrix(i, j);
if (!(i == 3 && j == 3))
if (i != 3 || j != 3)
out << " ";
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ recognizeAndVisualize(
for (std::size_t i = 0; i < files.size(); i++) {
std::cout << files[i] << std::endl;
if (scene != -1)
if ((std::size_t)scene != i)
if (static_cast<std::size_t>(scene) != i)
continue;

const std::string file = ply_files_dir.string() + files[i];
Expand Down
3 changes: 1 addition & 2 deletions apps/3d_rec_framework/src/tools/openni_frame_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

namespace OpenNIFrameSource {

OpenNIFrameSource::OpenNIFrameSource(const std::string& device_id)
: grabber_(device_id), frame_counter_(0), active_(true)
OpenNIFrameSource::OpenNIFrameSource(const std::string& device_id) : grabber_(device_id)
{
std::function<void(const PointCloudConstPtr&)> frame_cb =
[this](const PointCloudConstPtr& cloud) { onNewFrame(cloud); };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CloudCommand : public QUndoCommand {
public:
CloudCommand(ConstItemList input_data, QUndoCommand* parent = nullptr);

~CloudCommand();
~CloudCommand() override;

virtual bool
runCommand(AbstractTool* tool) = 0;
Expand Down Expand Up @@ -112,8 +112,8 @@ class CloudCommand : public QUndoCommand {
bool
canUseTemplates(ConstItemList& input_data);

bool can_use_templates_;
int template_type_;
bool can_use_templates_{false};
int template_type_{-1};
};

class ModifyItemCommand : public CloudCommand {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pcl::cloud_composer::CloudItem::createCloudItemFromTemplate(
{
pcl::PCLPointCloud2::Ptr cloud_blob = pcl::make_shared<pcl::PCLPointCloud2>();
toPCLPointCloud2(*cloud_ptr, *cloud_blob);
CloudItem* cloud_item =
auto* cloud_item =
new CloudItem(name, cloud_blob, Eigen::Vector4f(), Eigen::Quaternionf(), false);
cloud_item->setData(QVariant::fromValue(cloud_ptr), ItemDataRole::CLOUD_TEMPLATED);
cloud_item->setPointType<PointT>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ pcl::cloud_composer::MergeSelection::performTemplatedAction(
input_cloud_item->printNumPoints<PointT>();
// If this cloud hasn't been completely selected
if (!input_data.contains(input_cloud_item)) {
typename PointCloud<PointT>::Ptr input_cloud =
input_cloud_item->data(ItemDataRole::CLOUD_TEMPLATED)
.value<typename PointCloud<PointT>::Ptr>();
auto input_cloud = input_cloud_item->data(ItemDataRole::CLOUD_TEMPLATED)
.value<typename PointCloud<PointT>::Ptr>();
qDebug() << "Extracting "
<< selected_item_index_map_.value(input_cloud_item)->indices.size()
<< " points out of " << input_cloud->width;
Expand All @@ -102,9 +101,8 @@ pcl::cloud_composer::MergeSelection::performTemplatedAction(
}
// Just concatenate for all fully selected clouds
foreach (const CloudComposerItem* input_item, input_data) {
typename PointCloud<PointT>::Ptr input_cloud =
input_item->data(ItemDataRole::CLOUD_TEMPLATED)
.value<typename PointCloud<PointT>::Ptr>();
auto input_cloud = input_item->data(ItemDataRole::CLOUD_TEMPLATED)
.value<typename PointCloud<PointT>::Ptr>();
*merged_cloud += *input_cloud;
}
CloudItem* cloud_item = CloudItem::createCloudItemFromTemplate<PointT>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ pcl::cloud_composer::TransformClouds::performTemplatedAction(
foreach (const CloudComposerItem* input_item, input_data) {
qDebug() << "Transforming cloud " << input_item->getId();
QVariant variant = input_item->data(ItemDataRole::CLOUD_TEMPLATED);
typename PointCloud<PointT>::Ptr input_cloud =
variant.value<typename PointCloud<PointT>::Ptr>();
auto input_cloud = variant.value<typename PointCloud<PointT>::Ptr>();

Eigen::Matrix4f transform;
if (transform_map_.contains("AllSelectedClouds"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class CloudComposerItem : public QStandardItem {

CloudComposerItem(const QString& name = "default item");
CloudComposerItem(const CloudComposerItem& to_copy);
~CloudComposerItem();
~CloudComposerItem() override;

inline int
type() const override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,15 @@ class CloudItem : public CloudComposerItem {
Eigen::Vector4f origin_;
Eigen::Quaternionf orientation_;

bool template_cloud_set_;
bool template_cloud_set_{false};

// Internal Storage of the templated type of this cloud
int point_type_;
int point_type_{PointTypeFlags::NONE};

bool
checkIfFinite();

bool is_sanitized_;
bool is_sanitized_{false};

// Helper functions which set the point_type_ based on the current point type
template <typename PointT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace cloud_composer {
class ManipulationEvent {

public:
ManipulationEvent() {}
ManipulationEvent() = default;

void
addManipulation(const QString& id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class ProjectModel : public QStandardItemModel {
public:
ProjectModel(QObject* parent = nullptr);
ProjectModel(const ProjectModel& to_copy);
~ProjectModel();
~ProjectModel() override;

ProjectModel(QString project_name, QObject* parent = nullptr);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AbstractTool : public QObject {
public:
AbstractTool(PropertiesModel* parameter_model, QObject* parent);

~AbstractTool() { qDebug() << "Tool Destructed"; }
~AbstractTool() override { qDebug() << "Tool Destructed"; }

/** \brief Function called which does work in plugin
* \param data input_data from the model - const for good reason
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public Q_SLOTS:
QItemSelectionModel* selection_model_;
QSet<QStandardItem*> tool_items;

ProjectModel* project_model_;
ProjectModel* project_model_{nullptr};
};
} // namespace cloud_composer
} // namespace pcl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class EuclideanClusteringToolFactory : public QObject, public ToolFactory {
inline QList<CloudComposerItem::ItemType>
getRequiredInputChildrenTypes() const override
{
return QList<CloudComposerItem::ItemType>();
return {};
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ pcl::cloud_composer::OrganizedSegmentationTool::performTemplatedAction(
"item! (input list)";
return output;
}
typename PointCloud<PointT>::Ptr input_cloud =
variant.value<typename PointCloud<PointT>::Ptr>();
auto input_cloud = variant.value<typename PointCloud<PointT>::Ptr>();
if (!input_cloud->isOrganized()) {
qCritical() << "Organized Segmentation requires an organized cloud!";
return output;
Expand All @@ -89,14 +88,12 @@ pcl::cloud_composer::OrganizedSegmentationTool::performTemplatedAction(
input_item->getChildren(CloudComposerItem::NORMALS_ITEM);
// Get the normals cloud, we just use the first normals that were found if there are
// more than one
pcl::PointCloud<pcl::Normal>::ConstPtr input_normals =
normals_list.value(0)
->data(ItemDataRole::CLOUD_TEMPLATED)
.value<pcl::PointCloud<pcl::Normal>::ConstPtr>();
auto input_normals = normals_list.value(0)
->data(ItemDataRole::CLOUD_TEMPLATED)
.value<pcl::PointCloud<pcl::Normal>::ConstPtr>();

QVariant variant = input_item->data(ItemDataRole::CLOUD_TEMPLATED);
typename PointCloud<PointT>::Ptr input_cloud =
variant.value<typename PointCloud<PointT>::Ptr>();
auto input_cloud = variant.value<typename PointCloud<PointT>::Ptr>();

pcl::OrganizedMultiPlaneSegmentation<PointT, pcl::Normal, pcl::Label> mps;
mps.setMinInliers(min_inliers);
Expand All @@ -121,7 +118,7 @@ pcl::cloud_composer::OrganizedSegmentationTool::performTemplatedAction(

auto plane_labels = pcl::make_shared<std::set<std::uint32_t>>();
for (std::size_t i = 0; i < label_indices.size(); ++i)
if (label_indices[i].indices.size() > (std::size_t)min_plane_size)
if (label_indices[i].indices.size() > static_cast<std::size_t>(min_plane_size))
plane_labels->insert(i);
typename PointCloud<PointT>::CloudVectorType clusters;

Expand All @@ -143,7 +140,8 @@ pcl::cloud_composer::OrganizedSegmentationTool::performTemplatedAction(

pcl::IndicesPtr extracted_indices(new pcl::Indices());
for (std::size_t i = 0; i < euclidean_label_indices.size(); i++) {
if (euclidean_label_indices[i].indices.size() >= (std::size_t)min_cluster_size) {
if (euclidean_label_indices[i].indices.size() >=
static_cast<std::size_t>(min_cluster_size)) {
typename PointCloud<PointT>::Ptr cluster(new PointCloud<PointT>);
pcl::copyPointCloud(*input_cloud, euclidean_label_indices[i].indices, *cluster);
qDebug() << "Found cluster with size " << cluster->width;
Expand All @@ -158,7 +156,7 @@ pcl::cloud_composer::OrganizedSegmentationTool::performTemplatedAction(
}

for (std::size_t i = 0; i < label_indices.size(); i++) {
if (label_indices[i].indices.size() >= (std::size_t)min_plane_size) {
if (label_indices[i].indices.size() >= static_cast<std::size_t>(min_plane_size)) {
typename PointCloud<PointT>::Ptr plane(new PointCloud<PointT>);
pcl::copyPointCloud(*input_cloud, label_indices[i].indices, *plane);
qDebug() << "Found plane with size " << plane->width;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,13 @@ pcl::cloud_composer::SupervoxelsTool::performTemplatedAction(
"item! (input list)";
return output;
}
typename PointCloud<PointT>::Ptr input_cloud =
variant.value<typename PointCloud<PointT>::Ptr>();
auto input_cloud = variant.value<typename PointCloud<PointT>::Ptr>();
// TODO: Check if Voxelized
}

foreach (const CloudComposerItem* input_item, input_data) {
QVariant variant = input_item->data(ItemDataRole::CLOUD_TEMPLATED);
typename PointCloud<PointT>::Ptr input_cloud =
variant.value<typename PointCloud<PointT>::Ptr>();
auto input_cloud = variant.value<typename PointCloud<PointT>::Ptr>();

float resolution = parameter_model_->getProperty("Resolution").toFloat();
qDebug() << "Octree resolution = " << resolution;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class NormalEstimationToolFactory : public QObject, public ToolFactory {
inline QList<CloudComposerItem::ItemType>
getRequiredInputChildrenTypes() const override
{
return QList<CloudComposerItem::ItemType>();
return {};
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class SanitizeCloudToolFactory : public QObject, public ToolFactory {
inline QList<CloudComposerItem::ItemType>
getRequiredInputChildrenTypes() const override
{
return QList<CloudComposerItem::ItemType>();
return {};
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class StatisticalOutlierRemovalToolFactory : public QObject, public ToolFactory
inline QList<CloudComposerItem::ItemType>
getRequiredInputChildrenTypes() const override
{
return QList<CloudComposerItem::ItemType>();
return {};
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class VoxelGridDownsampleToolFactory : public QObject, public ToolFactory {
inline QList<CloudComposerItem::ItemType>
getRequiredInputChildrenTypes() const override
{
return QList<CloudComposerItem::ItemType>();
return {};
}
};

Expand Down
6 changes: 3 additions & 3 deletions apps/cloud_composer/src/cloud_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void
pcl::cloud_composer::CloudView::itemChanged (QStandardItem* changed_item)
{
qDebug () << "Item Changed - Redrawing!";
CloudComposerItem* item = dynamic_cast<CloudComposerItem*> (changed_item);
auto* item = dynamic_cast<CloudComposerItem*> (changed_item);
if (item)
{
item->paintView (vis_);
Expand All @@ -127,7 +127,7 @@ pcl::cloud_composer::CloudView::rowsInserted (const QModelIndex& parent, int sta
for (int row = start; row <= end; ++row)
{
QStandardItem* new_item = parent_item->child(row);
CloudComposerItem* item = dynamic_cast<CloudComposerItem*> (new_item);
auto* item = dynamic_cast<CloudComposerItem*> (new_item);
if (item)
item->paintView (vis_);

Expand Down Expand Up @@ -155,7 +155,7 @@ pcl::cloud_composer::CloudView::rowsAboutToBeRemoved (const QModelIndex& parent,
QStandardItem* item_to_remove = parent_item->child(row);
if (item_to_remove)
qDebug () << "Removing "<<item_to_remove->text ();
CloudComposerItem* item = dynamic_cast<CloudComposerItem*> (item_to_remove);
auto* item = dynamic_cast<CloudComposerItem*> (item_to_remove);
if (item )
item->removeFromView (vis_);

Expand Down
2 changes: 1 addition & 1 deletion apps/cloud_composer/src/cloud_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pcl::cloud_composer::CloudViewer::CloudViewer(QWidget* parent) : QTabWidget(pare
void
pcl::cloud_composer::CloudViewer::addModel(ProjectModel* new_model)
{
CloudView* new_view = new CloudView(new_model);
auto* new_view = new CloudView(new_model);
connect(new_model->getSelectionModel(),
SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
new_view,
Expand Down
Loading