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

Use using instead of typedef [tools, tracking, visualization] #3115

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
4 changes: 2 additions & 2 deletions tools/compute_hausdorff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ using namespace pcl::io;
using namespace pcl::console;
using namespace pcl::search;

typedef PointXYZ PointType;
typedef PointCloud<PointXYZ> Cloud;
using PointType = PointXYZ;
using Cloud = PointCloud<PointXYZ>;

void
printHelp (int, char **argv)
Expand Down
6 changes: 3 additions & 3 deletions tools/crf_segmentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ float default_leaf_size = 0.005f;
double default_feature_threshold = 5.0;
double default_normal_radius_search = 0.03;

typedef PointXYZRGBA PointT;
typedef PointCloud<PointT> CloudT;
typedef PointCloud<PointXYZRGBL> CloudLT;
using PointT = PointXYZRGBA;
using CloudT = PointCloud<PointT>;
using CloudLT = PointCloud<PointXYZRGBL>;

void
printHelp (int, char **argv)
Expand Down
4 changes: 2 additions & 2 deletions tools/crop_to_hull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ using namespace pcl;
using namespace pcl::io;
using namespace pcl::console;

typedef PointXYZ PointT;
typedef PointCloud<PointT> CloudT;
using PointT = PointXYZ;
using CloudT = PointCloud<PointT>;

const static double default_alpha = 1e3f;

Expand Down
4 changes: 2 additions & 2 deletions tools/davidsdk_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
using namespace std::chrono_literals;

/** @brief Convenience typedef */
typedef pcl::visualization::CloudViewer CloudViewer;
using CloudViewer = pcl::visualization::CloudViewer;

/** @brief Convenience typedef for XYZ point clouds */
typedef pcl::PointCloud<pcl::PointXYZ> PointCloudXYZ;
using PointCloudXYZ = pcl::PointCloud<pcl::PointXYZ>;

/** @brief CloudViewer pointer */
boost::shared_ptr<CloudViewer> viewer_ptr;
Expand Down
4 changes: 2 additions & 2 deletions tools/depth_sense_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ printHelp (int, char **argv)
void
printDeviceList ()
{
typedef boost::shared_ptr<pcl::DepthSenseGrabber> DepthSenseGrabberPtr;
using DepthSenseGrabberPtr = boost::shared_ptr<pcl::DepthSenseGrabber>;
std::vector<DepthSenseGrabberPtr> grabbers;
std::cout << "Connected devices: ";
boost::format fmt ("\n #%i %s");
Expand Down Expand Up @@ -120,7 +120,7 @@ class DepthSenseViewer

public:

typedef pcl::PointCloud<PointT> PointCloudT;
using PointCloudT = pcl::PointCloud<PointT>;

DepthSenseViewer (pcl::DepthSenseGrabber& grabber)
: grabber_ (grabber)
Expand Down
12 changes: 6 additions & 6 deletions tools/elch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@

#include <vector>

typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<PointType> Cloud;
typedef Cloud::ConstPtr CloudConstPtr;
typedef Cloud::Ptr CloudPtr;
typedef std::pair<std::string, CloudPtr> CloudPair;
typedef std::vector<CloudPair> CloudVector;
using PointType = pcl::PointXYZ;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = Cloud::ConstPtr;
using CloudPtr = Cloud::Ptr;
using CloudPair = std::pair<std::string, CloudPtr>;
using CloudVector = std::vector<CloudPair>;

bool
loopDetection (int end, const CloudVector &clouds, double dist, int &first, int &last)
Expand Down
4 changes: 2 additions & 2 deletions tools/ensenso_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
using namespace std::chrono_literals;

/** @brief Convenience typedef */
typedef pcl::visualization::CloudViewer CloudViewer;
using CloudViewer = pcl::visualization::CloudViewer;

/** @brief Convenience typedef for XYZ point clouds */
typedef pcl::PointCloud<pcl::PointXYZ> PointCloudXYZ;
using PointCloudXYZ = pcl::PointCloud<pcl::PointXYZ>;

/** @brief CloudViewer pointer */
boost::shared_ptr<CloudViewer> viewer_ptr;
Expand Down
6 changes: 3 additions & 3 deletions tools/generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ using namespace pcl::io;
using namespace pcl::common;
using namespace pcl::console;

typedef PointXYZ PointType;
typedef PointCloud<PointXYZ> Cloud;
typedef const Cloud::ConstPtr ConstCloudPtr;
using PointType = PointXYZ;
using Cloud = PointCloud<PointXYZ>;
using ConstCloudPtr = const Cloud::ConstPtr;

std::string default_distribution = "uniform";
float default_xmin = 0.0f;
Expand Down
6 changes: 3 additions & 3 deletions tools/grid_min.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ using namespace pcl;
using namespace pcl::io;
using namespace pcl::console;

typedef PointXYZ PointType;
typedef PointCloud<PointXYZ> Cloud;
typedef const Cloud::ConstPtr ConstCloudPtr;
using PointType = PointXYZ;
using Cloud = PointCloud<PointXYZ>;
using ConstCloudPtr = const Cloud::ConstPtr;

float default_resolution = 1.0f;

Expand Down
4 changes: 2 additions & 2 deletions tools/hdl_viewer_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ template<typename PointType>
class SimpleHDLViewer
{
public:
typedef PointCloud<PointType> Cloud;
typedef typename Cloud::ConstPtr CloudConstPtr;
using Cloud = PointCloud<PointType>;
using CloudConstPtr = typename Cloud::ConstPtr;

SimpleHDLViewer (Grabber& grabber,
PointCloudColorHandler<PointType> &handler)
Expand Down
8 changes: 4 additions & 4 deletions tools/icp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
#include <fstream>
#include <vector>

typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<PointType> Cloud;
typedef Cloud::ConstPtr CloudConstPtr;
typedef Cloud::Ptr CloudPtr;
using PointType = pcl::PointXYZ;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = Cloud::ConstPtr;
using CloudPtr = Cloud::Ptr;

int
main (int argc, char **argv)
Expand Down
8 changes: 4 additions & 4 deletions tools/icp2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
#include <fstream>
#include <vector>

typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<PointType> Cloud;
typedef Cloud::ConstPtr CloudConstPtr;
typedef Cloud::Ptr CloudPtr;
using PointType = pcl::PointXYZ;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = Cloud::ConstPtr;
using CloudPtr = Cloud::Ptr;

int
main (int argc, char **argv)
Expand Down
2 changes: 1 addition & 1 deletion tools/linemod_detection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using namespace pcl;
using namespace pcl::io;
using namespace pcl::console;

typedef pcl::PointCloud<pcl::PointXYZRGBA> PointCloudXYZRGBA;
using PointCloudXYZRGBA = pcl::PointCloud<pcl::PointXYZRGBA>;

void
printHelp (int, char **argv)
Expand Down
6 changes: 3 additions & 3 deletions tools/local_max.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ using namespace pcl;
using namespace pcl::io;
using namespace pcl::console;

typedef PointXYZ PointType;
typedef PointCloud<PointXYZ> Cloud;
typedef const Cloud::ConstPtr ConstCloudPtr;
using PointType = PointXYZ;
using Cloud = PointCloud<PointXYZ>;
using ConstCloudPtr = const Cloud::ConstPtr;

float default_radius = 1.0f;

Expand Down
12 changes: 6 additions & 6 deletions tools/lum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@

#include <vector>

typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<PointType> Cloud;
typedef Cloud::ConstPtr CloudConstPtr;
typedef Cloud::Ptr CloudPtr;
typedef std::pair<std::string, CloudPtr> CloudPair;
typedef std::vector<CloudPair> CloudVector;
using PointType = pcl::PointXYZ;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = Cloud::ConstPtr;
using CloudPtr = Cloud::Ptr;
using CloudPair = std::pair<std::string, CloudPtr>;
using CloudVector = std::vector<CloudPair>;

int
main (int argc, char **argv)
Expand Down
2 changes: 1 addition & 1 deletion tools/match_linemod_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ using namespace pcl;
using namespace pcl::io;
using namespace pcl::console;

typedef pcl::PointCloud<pcl::PointXYZRGBA> PointCloudXYZRGBA;
using PointCloudXYZRGBA = pcl::PointCloud<pcl::PointXYZRGBA>;

void
printHelp (int, char **argv)
Expand Down
6 changes: 3 additions & 3 deletions tools/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ using namespace pcl::io;
using namespace pcl::console;


typedef PointXYZ PointType;
typedef PointCloud<PointXYZ> Cloud;
typedef const Cloud::ConstPtr ConstCloudPtr;
using PointType = PointXYZ;
using Cloud = PointCloud<PointXYZ>;
using ConstCloudPtr = const Cloud::ConstPtr;

std::string default_method = "open";
float default_resolution = 1.0f;
Expand Down
8 changes: 4 additions & 4 deletions tools/ndt2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
#include <fstream>
#include <vector>

typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<PointType> Cloud;
typedef Cloud::ConstPtr CloudConstPtr;
typedef Cloud::Ptr CloudPtr;
using PointType = pcl::PointXYZ;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = Cloud::ConstPtr;
using CloudPtr = Cloud::Ptr;


void
Expand Down
8 changes: 4 additions & 4 deletions tools/ndt3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
#include <vector>


typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<PointType> Cloud;
typedef Cloud::ConstPtr CloudConstPtr;
typedef Cloud::Ptr CloudPtr;
using PointType = pcl::PointXYZ;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = Cloud::ConstPtr;
using CloudPtr = Cloud::Ptr;


int
Expand Down
4 changes: 2 additions & 2 deletions tools/oni2pcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ using namespace std;
using namespace pcl;
using namespace pcl::console;

typedef PointCloud<PointXYZRGBA> Cloud;
typedef Cloud::ConstPtr CloudConstPtr;
using Cloud = PointCloud<PointXYZRGBA>;
using CloudConstPtr = Cloud::ConstPtr;

int i = 0;
char buf[4096];
Expand Down
4 changes: 2 additions & 2 deletions tools/oni_viewer_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ template <typename PointType>
class SimpleONIViewer
{
public:
typedef pcl::PointCloud<PointType> Cloud;
typedef typename Cloud::ConstPtr CloudConstPtr;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = typename Cloud::ConstPtr;

SimpleONIViewer(pcl::ONIGrabber& grabber)
: viewer("PCL OpenNI Viewer")
Expand Down
4 changes: 2 additions & 2 deletions tools/openni2_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ template <typename PointType>
class OpenNI2Viewer
{
public:
typedef pcl::PointCloud<PointType> Cloud;
typedef typename Cloud::ConstPtr CloudConstPtr;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = typename Cloud::ConstPtr;

OpenNI2Viewer (pcl::io::OpenNI2Grabber& grabber)
: cloud_viewer_ (new pcl::visualization::PCLVisualizer ("PCL OpenNI2 cloud"))
Expand Down
4 changes: 2 additions & 2 deletions tools/openni_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ do \
//////////////////////////////////////////////////////////////////////////////////////////
struct Frame
{
typedef boost::shared_ptr<Frame> Ptr;
typedef boost::shared_ptr<const Frame> ConstPtr;
using Ptr = boost::shared_ptr<Frame>;
using ConstPtr = boost::shared_ptr<const Frame>;

Frame (const boost::shared_ptr<openni_wrapper::Image> &_image,
const boost::shared_ptr<openni_wrapper::DepthImage> &_depth_image,
Expand Down
4 changes: 2 additions & 2 deletions tools/openni_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ template <typename PointType>
class OpenNIViewer
{
public:
typedef pcl::PointCloud<PointType> Cloud;
typedef typename Cloud::ConstPtr CloudConstPtr;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = typename Cloud::ConstPtr;

OpenNIViewer (pcl::Grabber& grabber)
: cloud_viewer_ (new pcl::visualization::PCLVisualizer ("PCL OpenNI cloud"))
Expand Down
4 changes: 2 additions & 2 deletions tools/openni_viewer_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ template <typename PointType>
class SimpleOpenNIViewer
{
public:
typedef pcl::PointCloud<PointType> Cloud;
typedef typename Cloud::ConstPtr CloudConstPtr;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = typename Cloud::ConstPtr;

SimpleOpenNIViewer (pcl::OpenNIGrabber& grabber)
: cloud_viewer_ ("PCL OpenNI Viewer")
Expand Down
12 changes: 6 additions & 6 deletions tools/pcd_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@
using namespace std::chrono_literals;
using namespace pcl::console;

typedef pcl::visualization::PointCloudColorHandler<pcl::PCLPointCloud2> ColorHandler;
typedef ColorHandler::Ptr ColorHandlerPtr;
typedef ColorHandler::ConstPtr ColorHandlerConstPtr;
using ColorHandler = pcl::visualization::PointCloudColorHandler<pcl::PCLPointCloud2>;
using ColorHandlerPtr = ColorHandler::Ptr;
using ColorHandlerConstPtr = ColorHandler::ConstPtr;

typedef pcl::visualization::PointCloudGeometryHandler<pcl::PCLPointCloud2> GeometryHandler;
typedef GeometryHandler::Ptr GeometryHandlerPtr;
typedef GeometryHandler::ConstPtr GeometryHandlerConstPtr;
using GeometryHandler = pcl::visualization::PointCloudGeometryHandler<pcl::PCLPointCloud2>;
using GeometryHandlerPtr = GeometryHandler::Ptr;
using GeometryHandlerConstPtr = GeometryHandler::ConstPtr;

#define NORMALS_SCALE 0.01f
#define PC_SCALE 0.001f
Expand Down
6 changes: 3 additions & 3 deletions tools/progressive_morphological_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ using namespace pcl;
using namespace pcl::io;
using namespace pcl::console;

typedef PointXYZ PointType;
typedef PointCloud<PointXYZ> Cloud;
typedef const Cloud::ConstPtr ConstCloudPtr;
using PointType = PointXYZ;
using Cloud = PointCloud<PointXYZ>;
using ConstCloudPtr = const Cloud::ConstPtr;

int default_max_window_size = 33;
float default_slope = 0.7f;
Expand Down
6 changes: 3 additions & 3 deletions tools/radius_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
#include <pcl/filters/conditional_removal.h>


typedef pcl::PointXYZ PointType;
typedef pcl::PointCloud<PointType> Cloud;
typedef Cloud::ConstPtr CloudConstPtr;
using PointType = pcl::PointXYZ;
using Cloud = pcl::PointCloud<PointType>;
using CloudConstPtr = Cloud::ConstPtr;

float default_radius = 1.0f;
bool default_inside = true;
Expand Down
4 changes: 2 additions & 2 deletions tools/real_sense_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ printHelp (int, char **argv)
void
printDeviceList ()
{
typedef boost::shared_ptr<pcl::RealSenseGrabber> RealSenseGrabberPtr;
using RealSenseGrabberPtr = boost::shared_ptr<pcl::RealSenseGrabber>;
std::vector<RealSenseGrabberPtr> grabbers;
std::cout << "Connected devices: ";
boost::format fmt ("\n #%i %s");
Expand Down Expand Up @@ -147,7 +147,7 @@ class RealSenseViewer

public:

typedef pcl::PointCloud<PointT> PointCloudT;
using PointCloudT = pcl::PointCloud<PointT>;

RealSenseViewer (pcl::RealSenseGrabber& grabber)
: grabber_ (grabber)
Expand Down
2 changes: 1 addition & 1 deletion tools/sac_segmentation_plane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output
tt.tic ();

// Refine the plane indices
typedef SampleConsensusModelPlane<PointXYZ>::Ptr SampleConsensusModelPlanePtr;
using SampleConsensusModelPlanePtr = SampleConsensusModelPlane<PointXYZ>::Ptr;
SampleConsensusModelPlanePtr model (new SampleConsensusModelPlane<PointXYZ> (xyz));
RandomSampleConsensus<PointXYZ> sac (model, threshold);
sac.setMaxIterations (max_iterations);
Expand Down
Loading