Hey Daniel !
I'm trying to automatize a method to filter colors on a cloud, I saw we can do it through a conversion rgb to sf, and then filter the sf. However, it seems that the command RGB_CONVERT_TO_SF has not been created yet.
I have basic programming skills, so maybe I would be able to add it if you gave me some indications, or an example of how you added the command SF_CONVERT_TO_RGB, I could copy it a little ;)
Thanks a lot !
add a new command line
Re: add a new command line
Ah, indeed it should be relatively easy to add.
The main 'command line' class is ccCommandLineCommands (.h/.cpp). You can for instance look at 'CommandSFConvertToRGB' and 'CommandConvertNormalsToSFs'.
The first one will help you see how colors are handled, and the second one will help you mimic a command line option that converts something (here, normals) to 3 scalar fields.
To simplify your work, I added an intermediary ccEntityAction::sfFromColor method that takes 5 booleans as input parameters: exportR, exportG, exportB, exportAlpha, and exportComposite (see the latest code on the master branch).
Hopefully the rest shouldn't be too hard.
The main 'command line' class is ccCommandLineCommands (.h/.cpp). You can for instance look at 'CommandSFConvertToRGB' and 'CommandConvertNormalsToSFs'.
The first one will help you see how colors are handled, and the second one will help you mimic a command line option that converts something (here, normals) to 3 scalar fields.
To simplify your work, I added an intermediary ccEntityAction::sfFromColor method that takes 5 booleans as input parameters: exportR, exportG, exportB, exportAlpha, and exportComposite (see the latest code on the master branch).
Hopefully the rest shouldn't be too hard.
Daniel, CloudCompare admin
Re: add a new command line
And once you'll have created your own 'CommandConvertRFBToSFs' sub-class or something equivalent, don't forget to 'register' it in the ccCommandLineParser::registerBuiltInCommands() method. That should be all.
Daniel, CloudCompare admin
Re: add a new command line
Ok thanks ! I'll try to do it then ;)