Skip to content

Commit

Permalink
Merge pull request #3075 from taketwo/fix-warnings
Browse files Browse the repository at this point in the history
Fix warnings reported by GCC
  • Loading branch information
taketwo authored May 9, 2019
2 parents db7eb3c + cf64109 commit f9fb3f5
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 247 deletions.
8 changes: 5 additions & 3 deletions apps/cloud_composer/src/project_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pcl::cloud_composer::ProjectModel::ProjectModel (QObject* parent)
}

pcl::cloud_composer::ProjectModel::ProjectModel (const ProjectModel&)
: QStandardItemModel ()
{
}

Expand Down Expand Up @@ -313,9 +314,10 @@ pcl::cloud_composer::ProjectModel::insertNewCloudFromRGBandDepth ()
new_point.y = ((float)(centerY - y)) * depth * fl_const; // vtk seems to start at the bottom left image corner
new_point.z = depth;
}

uint32_t rgb = (uint32_t)color_pixel[0] << 16 | (uint32_t)color_pixel[1] << 8 | (uint32_t)color_pixel[2];
new_point.rgb = *reinterpret_cast<float*> (&rgb);

new_point.r = color_pixel[0];
new_point.g = color_pixel[1];
new_point.b = color_pixel[2];
cloud->points.push_back (new_point);
// qDebug () << "depth = "<<depth << "x,y,z="<<data[0]<<","<<data[1]<<","<<data[2];
//qDebug() << "r ="<<color_pixel[0]<<" g="<<color_pixel[1]<<" b="<<color_pixel[2];
Expand Down
1 change: 1 addition & 0 deletions apps/cloud_composer/src/properties_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pcl::cloud_composer::PropertiesModel::PropertiesModel (CloudComposerItem* parent
}

pcl::cloud_composer::PropertiesModel::PropertiesModel (const PropertiesModel& to_copy)
: QStandardItemModel ()
{
for (int i=0; i < to_copy.rowCount (); ++i){
QList <QStandardItem*> new_row;
Expand Down
1 change: 1 addition & 0 deletions apps/cloud_composer/src/toolbox_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pcl::cloud_composer::ToolBoxModel::ToolBoxModel (QTreeView* tool_view, QTreeView
}

pcl::cloud_composer::ToolBoxModel::ToolBoxModel (const ToolBoxModel&)
: QStandardItemModel ()
{
}

Expand Down
2 changes: 0 additions & 2 deletions apps/in_hand_scanner/src/mesh_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ pcl::ihs::MeshProcessing::MeshProcessing ()
void
pcl::ihs::MeshProcessing::processBoundary (Mesh& mesh, const std::vector <HalfEdgeIndices>& boundary_collection, const bool cleanup) const
{
typedef std::vector <Mesh::HalfEdgeIndices> BoundaryCollection;

Mesh::VertexIndex vi_a, vi_b, vi_c, vi_d;
Eigen::Vector3f ab, bc, ac, n_adb, n_plane; // Edges and normals
Mesh::FaceIndex opposite_face;
Expand Down
3 changes: 1 addition & 2 deletions apps/modeler/include/pcl/apps/modeler/main_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ namespace pcl
friend class AbstractItem;

MainWindow();
MainWindow(const MainWindow &) {} // copy ctor hidden
MainWindow& operator=(const MainWindow &) { return (*this); } // assign op. hidden
MainWindow& operator=(const MainWindow &) = delete;
~MainWindow();

Ui::MainWindow *ui_; // Designer form
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@ class CopyBuffer : public Statistics
if (register_stats)
registerStats();
}

/// @brief Copy Constructor
/// @details create a copy buffer by copying all the internal states of the
/// passed copy buffer.
/// @param copy the copy buffer object used to initialize this object
CopyBuffer (const CopyBuffer& copy);

/// @brief Destructor
~CopyBuffer ()
{
}

/// @brief Equal Operator
/// @details Copy all the internal states to the this copy buffer object.
/// @param copy_buffer the copy buffer object used to update the this object
/// @return A reference to this.
CopyBuffer&
operator= (const CopyBuffer& copy_buffer);

/// @brief Sets the points in the copy buffer.
/// @details The passed selection pointer is used to get specified points
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ class CopyCommand : public Command
has_undo_ = false;
}

/// @brief Destructor
~CopyCommand ()
{
}

protected:
/// @brief Copy the selected points into the copy buffer.
/// @pre Assumes the constructor was given appropriate pointers to the
Expand All @@ -86,23 +81,14 @@ class CopyCommand : public Command

private:
/// @brief Default constructor - object is not default constructable
CopyCommand ()
{
assert(false);
}
CopyCommand () = delete;

/// @brief Copy constructor - commands are non-copyable
CopyCommand (const CopyCommand&)
{
assert(false);
}
CopyCommand (const CopyCommand&) = delete;

/// @brief Equal operator - commands are non-copyable
CopyCommand&
operator= (const CopyCommand&)
{
assert(false); return (*this);
}
operator= (const CopyCommand&) = delete;

/// a pointer to the copy buffer.
CopyBufferPtr copy_buffer_ptr_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,14 @@ class CutCommand : public Command

private:
/// @brief Default constructor - object is not default constructable
CutCommand () : cut_selection_(CloudPtr())
{
assert(false);
}

CutCommand () = delete;

/// @brief Copy constructor - commands are non-copyable
CutCommand (const CutCommand&) : cut_selection_(CloudPtr())
{
assert(false);
}
CutCommand (const CutCommand&) = delete;

/// @brief Equal operator - commands are non-copyable
CutCommand&
operator= (const CutCommand&)
{
assert(false); return (*this);
}
operator= (const CutCommand&) = delete;

/// A shared pointer pointing to the selection object.
SelectionPtr selection_ptr_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ class DeleteCommand : public Command
DeleteCommand (SelectionPtr selection_ptr, CloudPtr cloud_ptr);

/// @brief Destructor
~DeleteCommand ()
{
}

~DeleteCommand () = default;

protected:
/// @brief Removes the selected points and maintains a backup for undo.
void
Expand All @@ -69,24 +67,14 @@ class DeleteCommand : public Command

private:
/// @brief Default constructor - object is not default constructable
DeleteCommand (): deleted_selection_(CloudPtr())
{
assert(false);
}

DeleteCommand () = delete;

/// @brief Copy constructor - commands are non-copyable
DeleteCommand (const DeleteCommand& c)
: deleted_selection_(c.deleted_selection_)
{
assert(false);
}
DeleteCommand (const DeleteCommand& c) = delete;

/// @brief Equal operator - commands are non-copyable
DeleteCommand&
operator= (const DeleteCommand&)
{
assert(false); return (*this);
}
operator= (const DeleteCommand&) = delete;

/// a pointer pointing to the cloud
CloudPtr cloud_ptr_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ class DenoiseCommand : public Command
{
}

/// @brief Destructor
~DenoiseCommand ()
{
}

protected:
/// @brief Runs the denois algorithm to remove all the outliers.
void
Expand All @@ -83,18 +78,11 @@ class DenoiseCommand : public Command
}

/// @brief Copy constructor - commands are non-copyable
DenoiseCommand (const DenoiseCommand&)
: removed_indices_(CloudPtr())
{
assert(false);
}
DenoiseCommand (const DenoiseCommand&) = delete;

/// @brief Equal operator - commands are non-copyable
DenoiseCommand&
operator= (const DenoiseCommand&)
{
assert(false); return (*this);
}
operator= (const DenoiseCommand&) = delete;

/// A shared pointer pointing to the selection object of the widget
SelectionPtr selection_ptr_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ class PasteCommand : public Command
SelectionPtr selection_ptr, CloudPtr cloud_ptr);
// comment that the selection is updated (also resets the matrix in cloud)

/// @brief Destructor
~PasteCommand ()
{
}

protected:
/// @brief Appends the points in the copy buffer into the cloud.
/// @details After appending the points to the cloud, this function also
Expand All @@ -73,22 +68,14 @@ class PasteCommand : public Command

private:
/// @brief Default constructor - object is not default constructable
PasteCommand ()
{
}

PasteCommand () = delete;

/// @brief Copy constructor - commands are non-copyable
PasteCommand (const PasteCommand&)
{
assert(false);
}
PasteCommand (const PasteCommand&) = delete;

/// @brief Equal operator - commands are non-copyable
PasteCommand&
operator= (const PasteCommand&)
{
assert(false); return (*this);
}
operator= (const PasteCommand&) = delete;

/// a pointer pointing to the copy buffer.
ConstCopyBufferPtr copy_buffer_ptr_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,6 @@ class Selection : public Statistics
registerStats();
}

/// @brief Copy constructor
/// @param copy The selection object to be copied
Selection (const Selection& copy)
: cloud_ptr_(copy.cloud_ptr_), selected_indices_(copy.selected_indices_)
{
}

/// @brief Destructor.
~Selection ()
{
}

/// @brief Equal operator
/// @param selection a const reference to a selection object whose
/// properties will be copied.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ class TransformCommand : public Command
TransformCommand (ConstSelectionPtr selection_ptr, CloudPtr cloud_ptr,
const float* matrix, float translate_x,
float translate_y, float translate_z);

/// @brief Destructor
~TransformCommand ()
{
}

protected:
// Transforms the coorindates of the selected points according to the transform
Expand All @@ -73,16 +68,11 @@ class TransformCommand : public Command

private:
/// @brief Copy constructor - object is not copy-constructable
TransformCommand (const TransformCommand&)
{
}
TransformCommand (const TransformCommand&) = delete;

/// @brief Equal operator - object is non-copyable
TransformCommand&
operator= (const TransformCommand&)
{
assert(false); return (*this);
}
operator= (const TransformCommand&) = delete;

/// @brief Applies the transformation to the point values
/// @param sel_ptr A pointer to the selection object whose points are to be
Expand Down
2 changes: 1 addition & 1 deletion apps/point_cloud_editor/src/cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Cloud::Cloud (const Cloud3D &cloud, bool register_stats)
}

Cloud::Cloud (const Cloud &copy)
: cloud_(copy.cloud_), selection_wk_ptr_(copy.selection_wk_ptr_),
: Statistics (copy), cloud_(copy.cloud_), selection_wk_ptr_(copy.selection_wk_ptr_),
use_color_ramp_(copy.use_color_ramp_),
color_ramp_axis_(copy.color_ramp_axis_),
display_scale_(copy.display_scale_),
Expand Down
12 changes: 0 additions & 12 deletions apps/point_cloud_editor/src/copyBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@
#include <pcl/apps/point_cloud_editor/statistics.h>
#include <pcl/apps/point_cloud_editor/common.h>

CopyBuffer::CopyBuffer (const CopyBuffer& copy_buffer) :
buffer_(copy_buffer.buffer_)
{
}

CopyBuffer&
CopyBuffer::operator= (const CopyBuffer& copy_buffer)
{
buffer_ = copy_buffer.buffer_;
return (*this);
}

void
CopyBuffer::set (ConstCloudPtr cloud_ptr, const Selection& selection)
{
Expand Down
12 changes: 4 additions & 8 deletions apps/src/openni_shift_to_depth_conversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,16 @@ class SimpleOpenNIViewer
newPoint.x = static_cast<float> (x) * depth * fl_const;
newPoint.y = static_cast<float> (y) * depth * fl_const;

const uint8_t& pixel_r = rgbData_arg[i * 3 + 0];
const uint8_t& pixel_g = rgbData_arg[i * 3 + 1];
const uint8_t& pixel_b = rgbData_arg[i * 3 + 2];

// Define point color
uint32_t rgb = (static_cast<uint32_t> (pixel_r) << 16 | static_cast<uint32_t> (pixel_g) << 8
| static_cast<uint32_t> (pixel_b));
newPoint.rgb = *reinterpret_cast<float*> (&rgb);
newPoint.r = rgbData_arg[i * 3 + 0];
newPoint.g = rgbData_arg[i * 3 + 1];
newPoint.b = rgbData_arg[i * 3 + 2];
}
else
{
// Define bad point
newPoint.x = newPoint.y = newPoint.z = bad_point;
newPoint.rgb = 0.0f;
newPoint.rgba = 0;
}

// Add point to cloud
Expand Down
Loading

0 comments on commit f9fb3f5

Please sign in to comment.