Simple selection of a surfel (with shift + left click) with the Polyscope Viewer proposed by DGtal. You may associates names (i.e. integers) to surfels or to group of surfels. You may associate reactions or callback functions to named graphical objects (surfels in DGtal 0.9).
* $ ./examples/io/viewers/viewer3D-10-interaction
*
Example of PolyscopeViewer interaction with the selection of surfels.
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
using namespace Z3i;
typedef KSpace::SCell
SCell;
const std::string& name,
size_t index,
void* polyscopeStructure
) {
((void)
index); ((void) data); ((void) polyscopeStructure);
std::cout << "Item name: " << name << std::endl;
}
};
{
viewer.draw(surfel1, "Surfel 1");
viewer.draw(surfel2, "Surfel 2");
viewer.show();
return 0;
}
DGtal is the top-level namespace which contains all DGtal functions and types.
Data required to display an object.
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
void OnClick(const std::string &name, size_t index, const DisplayData< MyViewer::RealPoint > &data, void *polyscopeStructure)
unsigned int index(DGtal::uint32_t n, unsigned int b)
MyViewer::Callback Callback
PolyscopeViewer< Space, KSpace > MyViewer