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

TextureMapping template is now also defined for PointNormal. #929

Merged
merged 1 commit into from
Oct 1, 2014
Merged

TextureMapping template is now also defined for PointNormal. #929

merged 1 commit into from
Oct 1, 2014

Conversation

paperManu
Copy link
Contributor

The pcl::TextureMapping template was only defined for PointXYZ, and some hardcoded types in the implementation prevented the simple instanciation for new point types.

This has been corrected, it is now also instanciated for PointNormal (which has been tested). More types could be added but were not tested.

Also, the TextureMapping::Ptr subtype was refering to shared_ptr, which is not the common thing in PCL. This has been modified so that it now refers to shared_ptr<TextureMapping<...>>, and a new TextureMapping::PointPtr subtype has been added.

typedef boost::shared_ptr< const TextureMapping < PointInT > > ConstPtr;

typedef boost::shared_ptr< PointInT > PointPtr;
typedef boost::shared_ptr< const PointInT > ConstPointPtr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boost::shared_ptr<PointInT> is really useless. Obviously lines 102/103 had a typo in the first place, so no need to keep these pointer-to-point typedefs.

@taketwo
Copy link
Member

taketwo commented Sep 26, 2014

Great find! I would like to merge this, but please first see the comments I left.

@paperManu
Copy link
Contributor Author

OK I'm doing the suggested correction. Should I add some other point types, like PointXYZRGBNormal, PointXYZRGB, PointXYZRGBA ?

@taketwo
Copy link
Member

taketwo commented Sep 26, 2014

It's common to have two branches, one with a minimalistic set of types, and the other "all-inclusive". Something like:

#ifdef PCL_ONLY_CORE_POINT_TYPES
  PCL_INSTANTIATE(TextureMapping, (pcl::PointXYZ))
#else
  PCL_INSTANTIATE(TextureMapping, (PCL_XYZ_POINT_TYPES))
#endif

@paperManu
Copy link
Contributor Author

Done!

@taketwo
Copy link
Member

taketwo commented Sep 27, 2014

Can you please squash the commits into one? (Have a look at git rebase -i.)

@paperManu
Copy link
Contributor Author

Hum, is it possible to do this without creating a new branch?

@VictorLamoine
Copy link
Contributor

Yes it is possible, follow the instructions given at taketwo's link! In short:
Switch to your local texture_mapping branch:
$ git checkout texture_mapping
$ git rebase -i

At this point you will see a list of 2 commits (read the comments at the end)
Replace pick of the last commit by s (squash)
Then do Ctrl + X and save the modifications.
The 2 commits have been merged into a single commit.

To push the modifications do a
$ git push -f origin texture_mapping

You need to specify the -f option to override the first commit.
Go back here and the pull request has been updated 😄

…ther types should be straightforward

TextureMapping: removed ::PointPtr typedef, added instanciation for all PCL_XYZ_POINT_TYPES
@paperManu
Copy link
Contributor Author

I see, I thought forcing the push could do some nasty things ;)

@taketwo
Copy link
Member

taketwo commented Oct 1, 2014

Yes, generally force pushing should be avoided because it changes (already public) history. In case of a pull request, however, the history is not important. What is important is that we have a clean history once it's merged :)

Thanks for the contribution!

taketwo added a commit that referenced this pull request Oct 1, 2014
TextureMapping template is now also defined for PointNormal.
@taketwo taketwo merged commit 4f9db1c into PointCloudLibrary:master Oct 1, 2014
@paperManu paperManu deleted the texture_mapping branch October 1, 2014 18:54
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.

3 participants