Skip to content

Conversation

@SergioRAgostinho
Copy link
Member

The implementation of the template methods pcl::io::load and pcl::io::save was in pcl/io/src/file_io.cpp. Not only was this not conforming with pcl style guide, bit it also rendered the methods useless, since the compiler could not find the appropriate symbols.

I just moved the code around between files and edited the CMakeLists.txt and now everything should be ok.

Edit: I now noticed that the proper way to do this is to mimic what was done in pcd_io.h and pcd_io.hpp, but right now that creates a circular reference.

@SergioRAgostinho
Copy link
Member Author

The problem:

pcl/io/file_io.h is divided in 4 sections: the pcl::FileReader class, the pcl::FileWriter class, a bunch of string utility methods and finally a section with pcl::io::save and pcl::io:load which write and read from a file (PCD, PLY, IFS, etc...) based on the extension provided in the file name.

pcl/io/pcd_io.h, pcl/io/ply_io.h, etc..., depend on pcl::FileReader and pcl::FileWriter from pcl/io/file_io.h.

The methods pcl::io::save and pcl::io:load depend on pcl/io/pcd_io.h, pcl/io/ply_io.h. This creates a circular reference with the template versions of pcl::io::save and pcl::io:load which need to be moved to a header file and included from file_io.h

Proposed solution:

Move methods pcl::io::save and pcl::io:load to a new file. I just need a good name for it, other than file_io. Some ideas: all_io.h, xxx_io.h, auto_io.h. I'm inclined towards the last one.

jspricke added a commit that referenced this pull request Oct 14, 2015
Fix to pcl::io::load and pcl::io::save
@jspricke jspricke merged commit 68a85e8 into PointCloudLibrary:master Oct 14, 2015
@SergioRAgostinho SergioRAgostinho deleted the io_load_template branch November 17, 2015 23:01
@jspricke jspricke mentioned this pull request Dec 9, 2015
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants