PointCloudLibrary/pcl

Use user defined point(define PCL_NO_PRECOMPILE) will let supervoxel_clustering compile failed.

Open

#3 170 ouverte le 18 juin 2019

Voir sur GitHub
 (1 commentaire) (0 réactions) (0 assignés)C++ (4 506 forks)batch import
good first issuekind: bugkind: todomodule: octree

Métriques du dépôt

Stars
 (9 023 stars)
Métriques de merge PR
 (Merge moyen 8j 7h) (3 PRs mergées en 30 j)

Description

Why these template specialization is implemented in supervoxel_clustering.cpp but not in supervoxel_clustering.hpp, and leave empty definitions in .hpp?

That will make compile failed with LNK2019 errors, if I defined PCL_NO_PRECOMPILE to compile with my own point type, and use pcl::PointXYZRGBA with supervoxel_clustering .

namespace pcl
{ 
  namespace octree
  {
    //Explicit overloads for RGB types
    template<>
    void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZRGB,pcl::SupervoxelClustering<pcl::PointXYZRGB>::VoxelData>::addPoint (const pcl::PointXYZRGB &new_point);
    
    template<>
    void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZRGBA,pcl::SupervoxelClustering<pcl::PointXYZRGBA>::VoxelData>::addPoint (const pcl::PointXYZRGBA &new_point);
    
    //Explicit overloads for RGB types
    template<> void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZRGB,pcl::SupervoxelClustering<pcl::PointXYZRGB>::VoxelData>::computeData ();
    
    template<> void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZRGBA,pcl::SupervoxelClustering<pcl::PointXYZRGBA>::VoxelData>::computeData ();
    
    //Explicit overloads for XYZ types
    template<>
    void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZ,pcl::SupervoxelClustering<pcl::PointXYZ>::VoxelData>::addPoint (const pcl::PointXYZ &new_point);
    
    template<> void
    pcl::octree::OctreePointCloudAdjacencyContainer<pcl::PointXYZ,pcl::SupervoxelClustering<pcl::PointXYZ>::VoxelData>::computeData ();
  }
}
  template<> void
  pcl::SupervoxelClustering<pcl::PointXYZRGB>::VoxelData::getPoint (pcl::PointXYZRGB &point_arg) const;
  
  template<> void
  pcl::SupervoxelClustering<pcl::PointXYZRGBA>::VoxelData::getPoint (pcl::PointXYZRGBA &point_arg ) const;

And those function in origin pcl::octree::OctreePointCloudAdjacencyContainer is do nothing... Why not throw some error like "Not implement"? So that will make users know they need to implement those functions, because when a function can run (actually no) with no errors, that will make people hard to find where is fucked up....

 /** \brief Add new point to container- this just counts points
       * \note To actually store data in the leaves, need to specialize this
       * for your point and data type as in supervoxel_clustering.hpp
       */
       // param[in] new_point the new point to add  
      void 
      addPoint (const PointInT& /*new_point*/)
      {
        using namespace pcl::common;
        ++num_points_;
      }
/** \brief Function for working on data added. Base implementation does nothing 
       * */
      void
      computeData ()
      {
      }

Guide contributeur