Skip to content

Commit

Permalink
Merge pull request #3137 from SunBlack/modernize-use-using_geometry
Browse files Browse the repository at this point in the history
Use using instead of typedef [geometry]
  • Loading branch information
taketwo authored Jun 11, 2019
2 parents abfe6bd + 1aef4c2 commit 388cac7
Show file tree
Hide file tree
Showing 13 changed files with 250 additions and 250 deletions.
8 changes: 4 additions & 4 deletions geometry/include/pcl/geometry/get_boundary.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ namespace pcl
std::vector <typename MeshT::HalfEdgeIndices>& boundary_he_collection,
const size_t expected_size = 3)
{
typedef MeshT Mesh;
typedef typename Mesh::HalfEdgeIndex HalfEdgeIndex;
typedef typename Mesh::HalfEdgeIndices HalfEdgeIndices;
typedef typename Mesh::InnerHalfEdgeAroundFaceCirculator IHEAFC;
using Mesh = MeshT;
using HalfEdgeIndex = typename Mesh::HalfEdgeIndex;
using HalfEdgeIndices = typename Mesh::HalfEdgeIndices;
using IHEAFC = typename Mesh::InnerHalfEdgeAroundFaceCirculator;

boundary_he_collection.clear ();

Expand Down
2 changes: 1 addition & 1 deletion geometry/include/pcl/geometry/line_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class LineIterator : public OrganizedIndexIterator
{
public:
/** \brief Neighborhood connectivity */
typedef enum {Neighbor4 = 4, Neighbor8 = 8} Neighborhood;
enum Neighborhood {Neighbor4 = 4, Neighbor8 = 8};
public:
/** \brief Constructor
* \param x_start column of the start pixel of the line
Expand Down
96 changes: 48 additions & 48 deletions geometry/include/pcl/geometry/mesh_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,55 +99,55 @@ namespace pcl
{
public:

typedef MeshBase <DerivedT, MeshTraitsT, MeshTagT> Self;
typedef boost::shared_ptr <Self> Ptr;
typedef boost::shared_ptr <const Self> ConstPtr;
using Self = MeshBase <DerivedT, MeshTraitsT, MeshTagT>;
using Ptr = boost::shared_ptr<Self>;
using ConstPtr = boost::shared_ptr<const Self>;

typedef DerivedT Derived;
using Derived = DerivedT;

// These have to be defined in the traits class.
typedef typename MeshTraitsT::VertexData VertexData;
typedef typename MeshTraitsT::HalfEdgeData HalfEdgeData;
typedef typename MeshTraitsT::EdgeData EdgeData;
typedef typename MeshTraitsT::FaceData FaceData;
typedef typename MeshTraitsT::IsManifold IsManifold;
using VertexData = typename MeshTraitsT::VertexData;
using HalfEdgeData = typename MeshTraitsT::HalfEdgeData;
using EdgeData = typename MeshTraitsT::EdgeData;
using FaceData = typename MeshTraitsT::FaceData;
using IsManifold = typename MeshTraitsT::IsManifold;

// Check if the mesh traits are defined correctly.
static_assert (std::is_convertible<IsManifold, bool>::value, "MeshTraitsT::IsManifold is not convertible to bool");

typedef MeshTagT MeshTag;
using MeshTag = MeshTagT;

// Data
typedef std::integral_constant <bool, !std::is_same <VertexData , pcl::geometry::NoData>::value> HasVertexData;
typedef std::integral_constant <bool, !std::is_same <HalfEdgeData, pcl::geometry::NoData>::value> HasHalfEdgeData;
typedef std::integral_constant <bool, !std::is_same <EdgeData , pcl::geometry::NoData>::value> HasEdgeData;
typedef std::integral_constant <bool, !std::is_same <FaceData , pcl::geometry::NoData>::value> HasFaceData;
using HasVertexData = std::integral_constant <bool, !std::is_same <VertexData , pcl::geometry::NoData>::value>;
using HasHalfEdgeData = std::integral_constant <bool, !std::is_same <HalfEdgeData, pcl::geometry::NoData>::value>;
using HasEdgeData = std::integral_constant <bool, !std::is_same <EdgeData , pcl::geometry::NoData>::value>;
using HasFaceData = std::integral_constant <bool, !std::is_same <FaceData , pcl::geometry::NoData>::value>;

typedef pcl::PointCloud <VertexData> VertexDataCloud;
typedef pcl::PointCloud <HalfEdgeData> HalfEdgeDataCloud;
typedef pcl::PointCloud <EdgeData> EdgeDataCloud;
typedef pcl::PointCloud <FaceData> FaceDataCloud;
using VertexDataCloud = pcl::PointCloud<VertexData>;
using HalfEdgeDataCloud = pcl::PointCloud<HalfEdgeData>;
using EdgeDataCloud = pcl::PointCloud<EdgeData>;
using FaceDataCloud = pcl::PointCloud<FaceData>;

// Indices
typedef pcl::geometry::VertexIndex VertexIndex;
typedef pcl::geometry::HalfEdgeIndex HalfEdgeIndex;
typedef pcl::geometry::EdgeIndex EdgeIndex;
typedef pcl::geometry::FaceIndex FaceIndex;
using VertexIndex = pcl::geometry::VertexIndex;
using HalfEdgeIndex = pcl::geometry::HalfEdgeIndex;
using EdgeIndex = pcl::geometry::EdgeIndex;
using FaceIndex = pcl::geometry::FaceIndex;

typedef std::vector <VertexIndex> VertexIndices;
typedef std::vector <HalfEdgeIndex> HalfEdgeIndices;
typedef std::vector <EdgeIndex> EdgeIndices;
typedef std::vector <FaceIndex> FaceIndices;
using VertexIndices = std::vector<VertexIndex>;
using HalfEdgeIndices = std::vector<HalfEdgeIndex>;
using EdgeIndices = std::vector<EdgeIndex>;
using FaceIndices = std::vector<FaceIndex>;

// Circulators
typedef pcl::geometry::VertexAroundVertexCirculator <const Self> VertexAroundVertexCirculator;
typedef pcl::geometry::OutgoingHalfEdgeAroundVertexCirculator <const Self> OutgoingHalfEdgeAroundVertexCirculator;
typedef pcl::geometry::IncomingHalfEdgeAroundVertexCirculator <const Self> IncomingHalfEdgeAroundVertexCirculator;
typedef pcl::geometry::FaceAroundVertexCirculator <const Self> FaceAroundVertexCirculator;
typedef pcl::geometry::VertexAroundFaceCirculator <const Self> VertexAroundFaceCirculator;
typedef pcl::geometry::InnerHalfEdgeAroundFaceCirculator <const Self> InnerHalfEdgeAroundFaceCirculator;
typedef pcl::geometry::OuterHalfEdgeAroundFaceCirculator <const Self> OuterHalfEdgeAroundFaceCirculator;
typedef pcl::geometry::FaceAroundFaceCirculator <const Self> FaceAroundFaceCirculator;
using VertexAroundVertexCirculator = pcl::geometry::VertexAroundVertexCirculator<const Self>;
using OutgoingHalfEdgeAroundVertexCirculator = pcl::geometry::OutgoingHalfEdgeAroundVertexCirculator<const Self>;
using IncomingHalfEdgeAroundVertexCirculator = pcl::geometry::IncomingHalfEdgeAroundVertexCirculator<const Self>;
using FaceAroundVertexCirculator = pcl::geometry::FaceAroundVertexCirculator<const Self>;
using VertexAroundFaceCirculator = pcl::geometry::VertexAroundFaceCirculator<const Self>;
using InnerHalfEdgeAroundFaceCirculator = pcl::geometry::InnerHalfEdgeAroundFaceCirculator<const Self>;
using OuterHalfEdgeAroundFaceCirculator = pcl::geometry::OuterHalfEdgeAroundFaceCirculator<const Self>;
using FaceAroundFaceCirculator = pcl::geometry::FaceAroundFaceCirculator<const Self>;

/** \brief Constructor. */
MeshBase ()
Expand Down Expand Up @@ -1110,21 +1110,21 @@ namespace pcl
////////////////////////////////////////////////////////////////////////

// Elements
typedef pcl::geometry::Vertex Vertex;
typedef pcl::geometry::HalfEdge HalfEdge;
typedef pcl::geometry::Face Face;
using Vertex = pcl::geometry::Vertex;
using HalfEdge = pcl::geometry::HalfEdge;
using Face = pcl::geometry::Face;

typedef std::vector <Vertex> Vertices;
typedef std::vector <HalfEdge> HalfEdges;
typedef std::vector <Face> Faces;
using Vertices = std::vector<Vertex>;
using HalfEdges = std::vector<HalfEdge>;
using Faces = std::vector<Face>;

typedef typename Vertices::iterator VertexIterator;
typedef typename HalfEdges::iterator HalfEdgeIterator;
typedef typename Faces::iterator FaceIterator;
using VertexIterator = typename Vertices::iterator;
using HalfEdgeIterator = typename HalfEdges::iterator;
using FaceIterator = typename Faces::iterator;

typedef typename Vertices::const_iterator VertexConstIterator;
typedef typename HalfEdges::const_iterator HalfEdgeConstIterator;
typedef typename Faces::const_iterator FaceConstIterator;
using VertexConstIterator = typename Vertices::const_iterator;
using HalfEdgeConstIterator = typename HalfEdges::const_iterator;
using FaceConstIterator = typename Faces::const_iterator;

/** \brief General implementation of addFace. */
FaceIndex
Expand Down Expand Up @@ -1741,8 +1741,8 @@ namespace pcl
template <class ElementContainerT, class DataContainerT, class IndexContainerT, class HasDataT> IndexContainerT
remove (ElementContainerT& elements, DataContainerT& data_cloud)
{
typedef typename IndexContainerT::value_type Index;
typedef typename ElementContainerT::value_type Element;
using Index = typename IndexContainerT::value_type;
using Element = typename ElementContainerT::value_type;

if (HasDataT::value) assert (elements.size () == data_cloud.size ());
else assert (data_cloud.empty ()); // Bug in this class!
Expand Down
100 changes: 50 additions & 50 deletions geometry/include/pcl/geometry/mesh_circulators.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ namespace pcl
{
public:

typedef boost::equality_comparable <pcl::geometry::VertexAroundVertexCirculator <MeshT>
, boost::unit_steppable <pcl::geometry::VertexAroundVertexCirculator <MeshT> > > Base;
typedef pcl::geometry::VertexAroundVertexCirculator <MeshT> Self;
using Base = boost::equality_comparable <pcl::geometry::VertexAroundVertexCirculator <MeshT>,
boost::unit_steppable <pcl::geometry::VertexAroundVertexCirculator <MeshT> > >;
using Self = pcl::geometry::VertexAroundVertexCirculator<MeshT>;

typedef MeshT Mesh;
typedef typename Mesh::VertexIndex VertexIndex;
typedef typename Mesh::HalfEdgeIndex HalfEdgeIndex;
using Mesh = MeshT;
using VertexIndex = typename Mesh::VertexIndex;
using HalfEdgeIndex = typename Mesh::HalfEdgeIndex;

/** \brief Constructor resulting in an invalid circulator. */
VertexAroundVertexCirculator ()
Expand Down Expand Up @@ -175,13 +175,13 @@ namespace pcl
{
public:

typedef boost::equality_comparable <pcl::geometry::OutgoingHalfEdgeAroundVertexCirculator <MeshT>
, boost::unit_steppable <pcl::geometry::OutgoingHalfEdgeAroundVertexCirculator <MeshT> > > Base;
typedef pcl::geometry::OutgoingHalfEdgeAroundVertexCirculator <MeshT> Self;
using Base = boost::equality_comparable <pcl::geometry::OutgoingHalfEdgeAroundVertexCirculator <MeshT>,
boost::unit_steppable <pcl::geometry::OutgoingHalfEdgeAroundVertexCirculator <MeshT> > >;
using Self = pcl::geometry::OutgoingHalfEdgeAroundVertexCirculator<MeshT>;

typedef MeshT Mesh;
typedef typename Mesh::VertexIndex VertexIndex;
typedef typename Mesh::HalfEdgeIndex HalfEdgeIndex;
using Mesh = MeshT;
using VertexIndex = typename Mesh::VertexIndex;
using HalfEdgeIndex = typename Mesh::HalfEdgeIndex;

/** \brief Constructor resulting in an invalid circulator. */
OutgoingHalfEdgeAroundVertexCirculator ()
Expand Down Expand Up @@ -283,13 +283,13 @@ namespace pcl
{
public:

typedef boost::equality_comparable <pcl::geometry::IncomingHalfEdgeAroundVertexCirculator <MeshT>
, boost::unit_steppable <pcl::geometry::IncomingHalfEdgeAroundVertexCirculator <MeshT> > > Base;
typedef pcl::geometry::IncomingHalfEdgeAroundVertexCirculator <MeshT> Self;
using Base = boost::equality_comparable <pcl::geometry::IncomingHalfEdgeAroundVertexCirculator <MeshT>,
boost::unit_steppable <pcl::geometry::IncomingHalfEdgeAroundVertexCirculator <MeshT> > >;
using Self = pcl::geometry::IncomingHalfEdgeAroundVertexCirculator<MeshT>;

typedef MeshT Mesh;
typedef typename Mesh::VertexIndex VertexIndex;
typedef typename Mesh::HalfEdgeIndex HalfEdgeIndex;
using Mesh = MeshT;
using VertexIndex = typename Mesh::VertexIndex;
using HalfEdgeIndex = typename Mesh::HalfEdgeIndex;

/** \brief Constructor resulting in an invalid circulator. */
IncomingHalfEdgeAroundVertexCirculator ()
Expand Down Expand Up @@ -391,14 +391,14 @@ namespace pcl
{
public:

typedef boost::equality_comparable <pcl::geometry::FaceAroundVertexCirculator <MeshT>
, boost::unit_steppable <pcl::geometry::FaceAroundVertexCirculator <MeshT> > > Base;
typedef pcl::geometry::FaceAroundVertexCirculator <MeshT> Self;
using Base = boost::equality_comparable <pcl::geometry::FaceAroundVertexCirculator <MeshT>,
boost::unit_steppable <pcl::geometry::FaceAroundVertexCirculator <MeshT> > >;
using Self = pcl::geometry::FaceAroundVertexCirculator<MeshT>;

typedef MeshT Mesh;
typedef typename Mesh::FaceIndex FaceIndex;
typedef typename Mesh::VertexIndex VertexIndex;
typedef typename Mesh::HalfEdgeIndex HalfEdgeIndex;
using Mesh = MeshT;
using FaceIndex = typename Mesh::FaceIndex;
using VertexIndex = typename Mesh::VertexIndex;
using HalfEdgeIndex = typename Mesh::HalfEdgeIndex;

/** \brief Constructor resulting in an invalid circulator. */
FaceAroundVertexCirculator ()
Expand Down Expand Up @@ -500,14 +500,14 @@ namespace pcl
{
public:

typedef boost::equality_comparable <pcl::geometry::VertexAroundFaceCirculator <MeshT>
, boost::unit_steppable <pcl::geometry::VertexAroundFaceCirculator <MeshT> > > Base;
typedef pcl::geometry::VertexAroundFaceCirculator <MeshT> Self;
using Base = boost::equality_comparable <pcl::geometry::VertexAroundFaceCirculator <MeshT>,
boost::unit_steppable <pcl::geometry::VertexAroundFaceCirculator <MeshT> > >;
using Self = pcl::geometry::VertexAroundFaceCirculator<MeshT>;

typedef MeshT Mesh;
typedef typename Mesh::VertexIndex VertexIndex;
typedef typename Mesh::FaceIndex FaceIndex;
typedef typename Mesh::HalfEdgeIndex HalfEdgeIndex;
using Mesh = MeshT;
using VertexIndex = typename Mesh::VertexIndex;
using FaceIndex = typename Mesh::FaceIndex;
using HalfEdgeIndex = typename Mesh::HalfEdgeIndex;

/** \brief Constructor resulting in an invalid circulator. */
VertexAroundFaceCirculator ()
Expand Down Expand Up @@ -609,13 +609,13 @@ namespace pcl
{
public:

typedef boost::equality_comparable <pcl::geometry::InnerHalfEdgeAroundFaceCirculator <MeshT>
, boost::unit_steppable <pcl::geometry::InnerHalfEdgeAroundFaceCirculator <MeshT> > > Base;
typedef pcl::geometry::InnerHalfEdgeAroundFaceCirculator <MeshT> Self;
using Base = boost::equality_comparable <pcl::geometry::InnerHalfEdgeAroundFaceCirculator <MeshT>,
boost::unit_steppable <pcl::geometry::InnerHalfEdgeAroundFaceCirculator <MeshT> > >;
using Self = pcl::geometry::InnerHalfEdgeAroundFaceCirculator<MeshT>;

typedef MeshT Mesh;
typedef typename Mesh::FaceIndex FaceIndex;
typedef typename Mesh::HalfEdgeIndex HalfEdgeIndex;
using Mesh = MeshT;
using FaceIndex = typename Mesh::FaceIndex;
using HalfEdgeIndex = typename Mesh::HalfEdgeIndex;

/** \brief Constructor resulting in an invalid circulator. */
InnerHalfEdgeAroundFaceCirculator ()
Expand Down Expand Up @@ -717,13 +717,13 @@ namespace pcl
{
public:

typedef boost::equality_comparable <pcl::geometry::OuterHalfEdgeAroundFaceCirculator <MeshT>
, boost::unit_steppable <pcl::geometry::OuterHalfEdgeAroundFaceCirculator <MeshT> > > Base;
typedef pcl::geometry::OuterHalfEdgeAroundFaceCirculator <MeshT> Self;
using Base = boost::equality_comparable <pcl::geometry::OuterHalfEdgeAroundFaceCirculator <MeshT>,
boost::unit_steppable <pcl::geometry::OuterHalfEdgeAroundFaceCirculator <MeshT> > >;
using Self = pcl::geometry::OuterHalfEdgeAroundFaceCirculator<MeshT>;

typedef MeshT Mesh;
typedef typename Mesh::FaceIndex FaceIndex;
typedef typename Mesh::HalfEdgeIndex HalfEdgeIndex;
using Mesh = MeshT;
using FaceIndex = typename Mesh::FaceIndex;
using HalfEdgeIndex = typename Mesh::HalfEdgeIndex;

/** \brief Constructor resulting in an invalid circulator. */
OuterHalfEdgeAroundFaceCirculator ()
Expand Down Expand Up @@ -825,13 +825,13 @@ namespace pcl
{
public:

typedef boost::equality_comparable <pcl::geometry::FaceAroundFaceCirculator <MeshT>
, boost::unit_steppable <pcl::geometry::FaceAroundFaceCirculator <MeshT> > > Base;
typedef pcl::geometry::FaceAroundFaceCirculator <MeshT> Self;
using Base = boost::equality_comparable <pcl::geometry::FaceAroundFaceCirculator <MeshT>,
boost::unit_steppable <pcl::geometry::FaceAroundFaceCirculator <MeshT> > >;
using Self = pcl::geometry::FaceAroundFaceCirculator<MeshT>;

typedef MeshT Mesh;
typedef typename Mesh::FaceIndex FaceIndex;
typedef typename Mesh::HalfEdgeIndex HalfEdgeIndex;
using Mesh = MeshT;
using FaceIndex = typename Mesh::FaceIndex;
using HalfEdgeIndex = typename Mesh::HalfEdgeIndex;

/** \brief Constructor resulting in an invalid circulator. */
FaceAroundFaceCirculator ()
Expand Down
12 changes: 6 additions & 6 deletions geometry/include/pcl/geometry/mesh_conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ namespace pcl
template <class HalfEdgeMeshT> void
toFaceVertexMesh (const HalfEdgeMeshT& half_edge_mesh, pcl::PolygonMesh& face_vertex_mesh)
{
typedef HalfEdgeMeshT HalfEdgeMesh;
typedef typename HalfEdgeMesh::VertexAroundFaceCirculator VAFC;
typedef typename HalfEdgeMesh::FaceIndex FaceIndex;
using HalfEdgeMesh = HalfEdgeMeshT;
using VAFC = typename HalfEdgeMesh::VertexAroundFaceCirculator;
using FaceIndex = typename HalfEdgeMesh::FaceIndex;

pcl::Vertices polygon;
pcl::toPCLPointCloud2 (half_edge_mesh.getVertexDataCloud (), face_vertex_mesh.cloud);
Expand Down Expand Up @@ -87,9 +87,9 @@ namespace pcl
template <class HalfEdgeMeshT> int
toHalfEdgeMesh (const pcl::PolygonMesh& face_vertex_mesh, HalfEdgeMeshT& half_edge_mesh)
{
typedef HalfEdgeMeshT HalfEdgeMesh;
typedef typename HalfEdgeMesh::VertexDataCloud VertexDataCloud;
typedef typename HalfEdgeMesh::VertexIndices VertexIndices;
using HalfEdgeMesh = HalfEdgeMeshT;
using VertexDataCloud = typename HalfEdgeMesh::VertexDataCloud;
using VertexIndices = typename HalfEdgeMesh::VertexIndices;

static_assert (HalfEdgeMesh::HasVertexData::value, "Output mesh must have data associated with the vertices!");

Expand Down
10 changes: 5 additions & 5 deletions geometry/include/pcl/geometry/mesh_elements.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace pcl
{
private:

typedef pcl::geometry::HalfEdgeIndex HalfEdgeIndex;
using HalfEdgeIndex = pcl::geometry::HalfEdgeIndex;

/** \brief Constructor.
* \param[in] idx_outgoing_half_edge Index to the outgoing half-edge. Defaults to an invalid index.
Expand Down Expand Up @@ -107,9 +107,9 @@ namespace pcl
{
private:

typedef pcl::geometry::VertexIndex VertexIndex;
typedef pcl::geometry::HalfEdgeIndex HalfEdgeIndex;
typedef pcl::geometry::FaceIndex FaceIndex;
using VertexIndex = pcl::geometry::VertexIndex;
using HalfEdgeIndex = pcl::geometry::HalfEdgeIndex;
using FaceIndex = pcl::geometry::FaceIndex;

/** \brief Constructor.
* \param[in] idx_terminating_vertex Index to the terminating vertex. Defaults to an invalid index.
Expand Down Expand Up @@ -165,7 +165,7 @@ namespace pcl
{
private:

typedef pcl::geometry::HalfEdgeIndex HalfEdgeIndex;
using HalfEdgeIndex = pcl::geometry::HalfEdgeIndex;

/** \brief Constructor.
* \param[in] inner_half_edge_idx Index to the outgoing half-edge. Defaults to an invalid index
Expand Down
Loading

0 comments on commit 388cac7

Please sign in to comment.