Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing std::move or const reference for parameters #3232

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace pcl
{

inline bool
writeCentroidToFile (std::string file, Eigen::Vector3f & centroid)
writeCentroidToFile (const std::string& file, Eigen::Vector3f & centroid)
{
std::ofstream out (file.c_str ());
if (!out)
Expand All @@ -27,7 +27,7 @@ namespace pcl
}

inline bool
getCentroidFromFile (std::string file, Eigen::Vector3f & centroid)
getCentroidFromFile (const std::string& file, Eigen::Vector3f & centroid)
{
std::ifstream in;
in.open (file.c_str (), std::ifstream::in);
Expand All @@ -45,7 +45,7 @@ namespace pcl
}

inline bool
writeMatrixToFile (std::string file, Eigen::Matrix4f & matrix)
writeMatrixToFile (const std::string& file, Eigen::Matrix4f & matrix)
{
std::ofstream out (file.c_str ());
if (!out)
Expand All @@ -69,7 +69,7 @@ namespace pcl
}

inline bool
writeFloatToFile (std::string file, float value)
writeFloatToFile (const std::string& file, float value)
{
std::ofstream out (file.c_str ());
if (!out)
Expand Down Expand Up @@ -100,7 +100,7 @@ namespace pcl
}

inline bool
readFloatFromFile (std::string dir, std::string file, float& value)
readFloatFromFile (const std::string& dir, std::string file, float& value)
{

std::vector < std::string > strs;
Expand All @@ -126,7 +126,7 @@ namespace pcl
}

inline bool
readFloatFromFile (std::string file, float& value)
readFloatFromFile (const std::string& file, float& value)
{

std::ifstream in;
Expand Down Expand Up @@ -191,7 +191,7 @@ namespace pcl
}

inline bool
readMatrixFromFile (std::string file, Eigen::Matrix4f & matrix)
readMatrixFromFile (const std::string& file, Eigen::Matrix4f & matrix)
{

std::ifstream in;
Expand All @@ -212,7 +212,7 @@ namespace pcl
}

inline bool
readMatrixFromFile2 (std::string file, Eigen::Matrix4f & matrix)
readMatrixFromFile2 (const std::string& file, Eigen::Matrix4f & matrix)
{

std::ifstream in;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace pcl

template<typename PointT>
inline void
uniform_sampling (vtkSmartPointer<vtkPolyData> polydata, size_t n_samples, typename pcl::PointCloud<PointT> & cloud_out)
uniform_sampling (const vtkSmartPointer<vtkPolyData>& polydata, size_t n_samples, typename pcl::PointCloud<PointT> & cloud_out)
{
polydata->BuildCells ();
vtkSmartPointer < vtkCellArray > cells = polydata->GetPolys ();
Expand Down Expand Up @@ -142,7 +142,7 @@ namespace pcl
}

inline void
getVerticesAsPointCloud (vtkSmartPointer<vtkPolyData> polydata, pcl::PointCloud<pcl::PointXYZ> & cloud_out)
getVerticesAsPointCloud (const vtkSmartPointer<vtkPolyData>& polydata, pcl::PointCloud<pcl::PointXYZ> & cloud_out)
{
vtkPoints *points = polydata->GetPoints ();
cloud_out.points.resize (points->GetNumberOfPoints ());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,19 @@ namespace pcl
inline void
setInputData (ConstItemList input_data)
{
original_data_ = input_data;
original_data_ = std::move(input_data);
}
protected:
/** \brief Removes the original item(s) from the model and replaces with the replacement(s)
* Replacements are only inserted once, original items must have same parent
* This stores the removed items in removed_items_
*/
bool
replaceOriginalWithNew (QList <const CloudComposerItem*> originals, QList <CloudComposerItem*> new_items);
replaceOriginalWithNew (const QList <const CloudComposerItem*>& originals, const QList <CloudComposerItem*>& new_items);

/** \brief This removes new_items from the model and restores originals */
bool
restoreOriginalRemoveNew (QList <const CloudComposerItem*> originals, QList <CloudComposerItem*> new_items);
restoreOriginalRemoveNew (const QList <const CloudComposerItem*>& originals, const QList <CloudComposerItem*>& new_items);

ConstItemList original_data_;

Expand Down Expand Up @@ -206,7 +206,7 @@ namespace pcl
redo () override;

inline void
setSelectedIndicesMap( const QMap <CloudItem*, pcl::PointIndices::Ptr > selected_item_index_map)
setSelectedIndicesMap( const QMap <CloudItem*, pcl::PointIndices::Ptr >& selected_item_index_map)
{
selected_item_index_map_ = selected_item_index_map;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pcl::cloud_composer::CloudItem::printNumPoints () const


template <typename PointT> pcl::cloud_composer::CloudItem*
pcl::cloud_composer::CloudItem::createCloudItemFromTemplate (const QString name, typename PointCloud<PointT>::Ptr cloud_ptr)
pcl::cloud_composer::CloudItem::createCloudItemFromTemplate (const QString& name, typename PointCloud<PointT>::Ptr cloud_ptr)
{
pcl::PCLPointCloud2::Ptr cloud_blob = boost::make_shared <pcl::PCLPointCloud2> ();
toPCLPointCloud2 (*cloud_ptr, *cloud_blob);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
#include <pcl/apps/cloud_composer/impl/cloud_item.hpp>

template <typename PointT> QList <pcl::cloud_composer::CloudComposerItem*>
pcl::cloud_composer::MergeSelection::performTemplatedAction (QList <const CloudComposerItem*> input_data)
pcl::cloud_composer::MergeSelection::performTemplatedAction (const QList <const CloudComposerItem*>& input_data)
{
QList <CloudComposerItem*> output;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <pcl/common/transforms.h>

template <typename PointT> QList <pcl::cloud_composer::CloudComposerItem*>
pcl::cloud_composer::TransformClouds::performTemplatedAction (QList <const CloudComposerItem*> input_data)
pcl::cloud_composer::TransformClouds::performTemplatedAction (const QList <const CloudComposerItem*>& input_data)
{
QList <CloudComposerItem*> output;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace pcl
FPFH_ITEM
};

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

Expand Down Expand Up @@ -145,7 +145,7 @@ namespace pcl
template <class T> class VPtr
{
public:
static T* asPtr (QVariant v)
static T* asPtr (const QVariant& v)
{
return (static_cast<T *> (v.value<void *> ()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace pcl
PCL_MAKE_ALIGNED_OPERATOR_NEW

CloudItem (const QString name,
const pcl::PCLPointCloud2::Ptr cloud_ptr,
const pcl::PCLPointCloud2::Ptr& cloud_ptr,
const Eigen::Vector4f& origin = Eigen::Vector4f (),
const Eigen::Quaternionf& orientation = Eigen::Quaternionf (),
bool make_templated_cloud = true);
Expand All @@ -84,7 +84,7 @@ namespace pcl
/** \brief This creates a CloudItem from a templated cloud type */
template <typename PointT>
static CloudItem*
createCloudItemFromTemplate (const QString name, typename PointCloud<PointT>::Ptr cloud_ptr);
createCloudItemFromTemplate (const QString& name, typename PointCloud<PointT>::Ptr cloud_ptr);

/** \brief virtual data getter which calls QStandardItem::data; used to create template cloud if not created yet
* WARNING : This function modifies "this" - it sets up the templated type if you request one when it doesn't exist yet!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace pcl
public:

FPFHItem (QString name,
pcl::PointCloud<pcl::FPFHSignature33>::Ptr fpfh_ptr,
const pcl::PointCloud<pcl::FPFHSignature33>::Ptr& fpfh_ptr,
double radius);
FPFHItem (const FPFHItem& to_copy);
~FPFHItem ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace pcl
public:

NormalsItem (QString name,
pcl::PointCloud<pcl::Normal>::Ptr normals_ptr,
const pcl::PointCloud<pcl::Normal>::Ptr& normals_ptr,
double radius);
NormalsItem (const NormalsItem& to_copy);
~NormalsItem ();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace pcl
getSelectedItems () { return selected_item_index_map_.keys ();}

template <typename PointT> QList <CloudComposerItem*>
performTemplatedAction (QList <const CloudComposerItem*> input_data);
performTemplatedAction (const QList <const CloudComposerItem*>& input_data);

private:
QMap <const CloudItem*, pcl::PointIndices::ConstPtr > selected_item_index_map_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace pcl
~ManipulationEvent ();

void
addManipulation (QString id, vtkSmartPointer<vtkMatrix4x4> start, vtkSmartPointer<vtkMatrix4x4> end);
addManipulation (const QString& id, const vtkSmartPointer<vtkMatrix4x4>& start, const vtkSmartPointer<vtkMatrix4x4>& end);

inline QMap <QString, vtkSmartPointer<vtkMatrix4x4> >
getStartMap () const { return id_start_map_;}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ namespace pcl

public:
SelectionEvent (vtkSmartPointer <vtkPolyData> selected_points, vtkSmartPointer<vtkActor> selected_actor, vtkSmartPointer<vtkDataSetMapper> selected_mapper, QMap < QString, vtkPolyData* > id_selected_map, vtkRenderer* renderer)
: selected_points_ (selected_points)
, selected_actor_ (selected_actor)
, selected_mapper_ (selected_mapper)
, id_selected_data_map_ (id_selected_map)
: selected_points_ (std::move(selected_points))
, selected_actor_ (std::move(selected_actor))
, selected_mapper_ (std::move(selected_mapper))
, id_selected_data_map_ (std::move(id_selected_map))
, renderer_ (renderer)
{}

Expand All @@ -73,7 +73,7 @@ namespace pcl
getActor () const { return selected_actor_; }

void
findIndicesInItem (CloudItem* cloud_item, pcl::PointIndices::Ptr indices);
findIndicesInItem (CloudItem* cloud_item, const pcl::PointIndices::Ptr& indices);

private:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace pcl

/** \brief Sets the name of the project using the horizontalHeaderItem */
void
setName (QString new_name);
setName (const QString& new_name);

/** \brief Returns the selection model which is used for this project */
inline QItemSelectionModel*
Expand All @@ -107,11 +107,11 @@ namespace pcl

/** \brief This sets the selection for points which have been selected in the QVTKWindow */
void
setPointSelection (boost::shared_ptr<SelectionEvent> selected_event);
setPointSelection (const boost::shared_ptr<SelectionEvent>& selected_event);

/** \brief This is invoked to perform the manipulations specified on the model */
void
manipulateClouds (boost::shared_ptr<ManipulationEvent> manip_event);
manipulateClouds (const boost::shared_ptr<ManipulationEvent>& manip_event);
public Q_SLOTS:
void
commandCompleted (CloudCommand* command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ namespace pcl

/** \brief Helper function for adding a new property */
void
addProperty (const QString prop_name, const QVariant value, const Qt::ItemFlags flags = Qt::ItemIsSelectable, const QString category = "");
addProperty (const QString& prop_name, const QVariant& value, const Qt::ItemFlags flags = Qt::ItemIsSelectable, const QString& category = "");

/** \brief Helper function for adding a new property category */
void
addCategory (const QString category_name);
addCategory (const QString& category_name);

/** \brief Helper function to get a property */
QVariant
getProperty (const QString prop_name) const;
getProperty (const QString& prop_name) const;

void
copyProperties (const PropertiesModel* to_copy);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace pcl
getActionText () const {return action_text_;}

void
setActionText (const QString text) { action_text_ = text; }
setActionText (const QString& text) { action_text_ = text; }

virtual QString
getToolName () const = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace pcl

private:
QStandardItem*
addToolGroup (QString tool_group_name);
addToolGroup (const QString& tool_group_name);

QTreeView* tool_view_;
QTreeView* parameter_view_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@


template <typename PointT> QList <pcl::cloud_composer::CloudComposerItem*>
pcl::cloud_composer::OrganizedSegmentationTool::performTemplatedAction (QList <const CloudComposerItem*> input_data)
pcl::cloud_composer::OrganizedSegmentationTool::performTemplatedAction (const QList <const CloudComposerItem*>& input_data)
{
QList <CloudComposerItem*> output;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@


template <typename PointT> QList <pcl::cloud_composer::CloudComposerItem*>
pcl::cloud_composer::SupervoxelsTool::performTemplatedAction (QList <const CloudComposerItem*> input_data)
pcl::cloud_composer::SupervoxelsTool::performTemplatedAction (const QList <const CloudComposerItem*>& input_data)
{
QList <CloudComposerItem*> output;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
performAction (QList <const CloudComposerItem*> input_data, PointTypeFlags::PointType type = PointTypeFlags::NONE) override;

template <typename PointT> QList <CloudComposerItem*>
performTemplatedAction (QList <const CloudComposerItem*> input_data);
performTemplatedAction (const QList <const CloudComposerItem*>& input_data);

inline QString
getToolName () const override { return "Organized Segmenation Tool";}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
performAction (QList <const CloudComposerItem*> input_data, PointTypeFlags::PointType type = PointTypeFlags::NONE) override;

template <typename PointT> QList <CloudComposerItem*>
performTemplatedAction (QList <const CloudComposerItem*> input_data);
performTemplatedAction (const QList <const CloudComposerItem*>& input_data);

inline QString
getToolName () const override { return "Voxel Superpixels Tool";}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace pcl
getToolName () const override { return "Transform Clouds Tool";}

template <typename PointT> QList <CloudComposerItem*>
performTemplatedAction (QList <const CloudComposerItem*> input_data);
performTemplatedAction (const QList <const CloudComposerItem*>& input_data);

private:
QMap <QString, vtkSmartPointer<vtkMatrix4x4> > transform_map_;
Expand Down
Loading