DGtal 2.1.0
Loading...
Searching...
No Matches
RandomPointExtension Struct Reference

[viewer3D-extension-derivation] More...

Inheritance diagram for RandomPointExtension:
[legend]

Public Member Functions

void OnUI (void *viewerData) override
 

Detailed Description

[viewer3D-extension-derivation]

Definition at line 52 of file viewer3D-11-extension.cpp.

Member Function Documentation

◆ OnUI()

void RandomPointExtension::OnUI ( void *  viewerData)
inlineoverride

Definition at line 53 of file viewer3D-11-extension.cpp.

53 {
54 ((void) viewerData);
55 static int count = 16;
56 // Depending on the viewer, this may change
57 ImGui::SliderInt("Number of points to draw", &count, 0, 32);
58 if (ImGui::Button("Create points")) {
59 for (int i = 0; i < count; ++i) {
60 // Rand values from -10 to 10
61 // Viewer is pointer to the viewer this extension is attached to
62 *viewer << Point(rand() % 21 - 10, rand() % 21 - 10, rand() % 21 - 10);
63 }
64 // Ask viewer to render all data that were added
65 viewer->renderNewData();
66 }
67 }
Space::Point Point
Definition StdDefs.h:168

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