DGtal 2.1.0
Loading...
Searching...
No Matches
DGtal::Display3D< Space, KSpace >::Callback Struct Reference

A general callback for the viewer to give control to the user. More...

#include <DGtal/io/Display3D.h>

Public Member Functions

virtual void OnAttach (void *_viewer)
 Called when setCallback is performed on the viewer.
 
virtual void OnUI (void *viewerData)
 Called to render or interact with some UI.
 
virtual void OnClick (const std::string &name, size_t index, const DisplayData< RealPoint > &data, void *viewerData)
 Called when an element is clicked.
 

Data Fields

Display3D< Space, KSpace > * viewer = nullptr
 

Detailed Description

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
struct DGtal::Display3D< Space, KSpace >::Callback

A general callback for the viewer to give control to the user.

There are no guarentees on the thread-safeness of this class.

Definition at line 408 of file Display3D.h.

Member Function Documentation

◆ OnAttach()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual void DGtal::Display3D< Space, KSpace >::Callback::OnAttach ( void *  _viewer)
inlinevirtual

Called when setCallback is performed on the viewer.

This is callback can be used to store the pointer to a particular instance of the viewer.

If only general properties are needed, use the Callback::viewer member which is set prior calling this function.

Parameters
_viewerA pointer to the viewer on which this callback is attached

Definition at line 420 of file Display3D.h.

420{ ((void) _viewer); };

◆ OnClick()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual void DGtal::Display3D< Space, KSpace >::Callback::OnClick ( const std::string &  name,
size_t  index,
const DisplayData< RealPoint > &  data,
void *  viewerData 
)
inlinevirtual

Called when an element is clicked.

See also
DGtal::Display3D::renderNewData
Parameters
nameThe name of the structure containing the element
indexThe index within the clicked structure
dataThe Display3D data associated with this structure
viewerDataViewer-dependent data associated with the click

Definition at line 437 of file Display3D.h.

437{((void) name); ((void) index); ((void) data); ((void) viewerData); };
std::map< std::string, DisplayData< RealPoint > > data
Definition Display3D.h:744
unsigned int index(DGtal::uint32_t n, unsigned int b)
Definition testBits.cpp:44

References DGtal::Display3D< Space, KSpace >::data, and index().

◆ OnUI()

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
virtual void DGtal::Display3D< Space, KSpace >::Callback::OnUI ( void *  viewerData)
inlinevirtual

Called to render or interact with some UI.

Parameters
viewerDataSome viewer-dependent data to draw UI (context)

Definition at line 426 of file Display3D.h.

426{ ((void) viewerData); };

Field Documentation

◆ viewer

template<typename Space = Z3i::Space, typename KSpace = Z3i::KSpace>
Display3D<Space, KSpace>* DGtal::Display3D< Space, KSpace >::Callback::viewer = nullptr

Definition at line 440 of file Display3D.h.


The documentation for this struct was generated from the following file: