I'm trying to understand how to access a point cloud via a plug-in I'm currently developing. After having looked that the documentation, things are not entirely clear to me. Cloud you please help me to better understand how all works.

Here is the scenario I'm looking for.

scenario 1:I have some raw data files of a point cloud in a non supported format by CC. My reader gives me a arrays of vector3D. How would I import this cloud into CC, i.e. put this cloud in the db tree and make it visible in the viewport?

scenario 2:I have a loaded point cloud in CC, did some manual filtering with the segment tool, and would like to retrieve the remaining points (with their attributes) once the point cloud is selected in the db tree?

I think my more general point is that I can't get the information I'm looking for (obviously). in the dummy plug-in it says You can access to most of CC components (database, 3D views, console, etc.) via the 'm_app' attribute (ccMainAppInterface object).I've been exploring the documentations (and looking at some plug-in code) for days now and can't find anything related to m_app or ccMainAppInterface.

I most likely missing the point here, but any pointer(s) to the right direction would be greatly appreciated.

As the dummy plugin states, most of the (authorized) interactions with the application are done with this 'm_app' member (see the ccMainAppInterface class for all its methods). If necessary it's always possible to add new methods.

2) To retrieve a point cloud that is already in the DB tree, you have several options.

a) The most common (in CC) is to let the user select the cloud, and then call the plugin action (see how it works with the simple 'qPCV' plugin for instace). You just have to ask to 'm_app' the selected entities:

Then check that the selected entities are indeed what you are expecting (by the way you can enable or disable the plugin action based on the current selection - see the 'onNewSelection' method that can be re-implemented).

b) Another option is to let the user choose among a list of candidate entities. qPCV also does this:

c) Lastly, if it's an entity your plugin already 'know' about (because it has a specific name, or it has already been processed by the plugin) then you can try to find it. Once again via the 'dbRootObject' object returned by 'm_app'. You can either find an entity via it's unique ID (see ccHObject::find). Or you can look recursively at the DB tree contents and look 'manually' for an entity with a given name, etc.