Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal
2.0.0
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
x
Variables
a
b
d
e
f
h
i
l
m
n
o
p
s
t
v
w
x
Typedefs
a
b
c
d
e
i
k
l
n
o
p
r
s
u
v
z
Enumerations
Enumerator
a
b
c
d
e
g
h
i
j
n
o
p
s
t
u
z
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
c
d
e
f
h
l
m
n
o
p
r
s
t
u
Enumerator
a
b
c
d
e
f
g
l
m
o
p
r
s
t
u
v
x
y
z
Related Symbols
a
b
c
d
e
f
g
i
k
l
m
o
p
s
t
u
Examples
DGtal
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
viewer3D-11-extension.cpp
Go to the documentation of this file.
1
16
29
35
37
#include <iostream>
38
39
#include "DGtal/base/Common.h"
40
#include "DGtal/helpers/StdDefs.h"
41
#include "DGtal/io/viewers/PolyscopeViewer.h"
43
44
using namespace
std
;
45
using namespace
DGtal
;
46
using namespace
Z3i
;
47
49
// Standard services - public :
50
52
struct
RandomPointExtension
:
public
PolyscopeViewer
<>::Callback {
53
void
OnUI
() {
54
static
int
count = 16;
55
// Depending on the viewer, this may change
56
ImGui::SliderInt(
"Number of points to draw"
, &count, 0, 32);
57
if
(ImGui::Button(
"Create points"
)) {
58
for
(
int
i = 0; i < count; ++i) {
59
// Rand values from -10 to 10
60
// Viewer is pointer to the viewer this extension is attached to
61
*viewer <<
Point
(rand() % 21 - 10, rand() % 21 - 10, rand() % 21 - 10);
62
}
63
// Ask viewer to render all data that were added
64
viewer->renderNewData();
65
}
66
}
53
void
OnUI
() {
…
}
67
};
52
struct
RandomPointExtension
:
public
PolyscopeViewer
<>::Callback {
…
};
68
69
70
int
main
(
int
argc,
char
** argv )
71
{
72
Point
p1( 0, 0, 0 );
73
Point
p2( 5, 5, 5 );
74
Point
p3( 2, 3, 4 );
75
76
Domain
domain
( p1, p2 );
77
78
KSpace
K
;
79
K
.init( p1, p2,
true
);
80
81
PolyscopeViewer
viewer(
K
);
83
viewer.
setCallback
(
new
RandomPointExtension
);
85
viewer <<
domain
;
86
viewer << p1 << p2 << p3;
87
88
viewer.
show
();
89
return
0;
90
}
70
int
main
(
int
argc,
char
** argv ) {
…
}
91
// //
DGtal::PolyscopeViewer
Definition
PolyscopeViewer.h:52
DGtal::PolyscopeViewer::setCallback
void setCallback(typename Display3D< Space, KSpace >::Callback *callback) override
DGtal::PolyscopeViewer::show
void show() override
Starts the event loop and display of elements.
Definition
PolyscopeViewer.h:68
DGtal::Point
DGtal::Domain
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal::Z3i::KSpace
KhalimskySpaceND< 3, Integer > KSpace
Definition
StdDefs.h:146
DGtal::Z3i::Point
Space::Point Point
Definition
StdDefs.h:168
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
std
STL namespace.
RandomPointExtension
[viewer3D-extension-derivation]
Definition
viewer3D-11-extension.cpp:52
RandomPointExtension::OnUI
void OnUI()
Definition
viewer3D-11-extension.cpp:53
main
int main()
Definition
testBits.cpp:56
K
KSpace K
Definition
testCubicalComplex.cpp:62
domain
Domain domain
Definition
testProjection.cpp:88
examples
io
viewers
viewer3D-11-extension.cpp
Generated on
for DGtal by
1.14.0