DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
testDisplayKSCell.cpp
Go to the documentation of this file.
1
16
29
31
#include <iostream>
32
#include "DGtal/base/Common.h"
34
35
using namespace
std
;
36
using namespace
DGtal
;
37
38
39
41
#include <iostream>
42
#include "DGtal/base/Common.h"
43
#include "DGtal/helpers/StdDefs.h"
44
#include "DGtal/shapes/Shapes.h"
45
#include "DGtal/io/viewers/PolyscopeViewer.h"
47
48
using namespace
std
;
49
using namespace
DGtal
;
50
using namespace
Z3i
;
51
53
// Functions for testing Display of display of KS space Cell.
55
int
main
()
56
{
57
58
KSpace
K
;
59
Point
plow(0,0,0);
60
Point
pup(3,3,2);
61
Domain
domain
( plow, pup );
62
K
.
init
( plow, pup,
true
);
63
64
PolyscopeViewer<Space, KSpace>
viewer(
K
);
65
trace
.
beginBlock
(
"Testing display KSCell in Viewer 3D"
);
66
// if the domain is visible can't see the cubes inside
67
// viewer << domain;
68
69
70
// Drawing cell of dimension 3
71
Cell
voxelA =
K
.
uCell
(
Point
(1, 1, 1));
72
SCell
voxelB =
K
.
sCell
(
Point
(1, 1, 3));
73
viewer << voxelB<< voxelA;
//
74
75
// drawing cells of dimension 2
76
SCell
surfelA =
K
.
sCell
(
Point
( 2, 1, 3 ) );
77
SCell
surfelB =
K
.
sCell
(
Point
( 1, 0, 1 ),
false
);
78
Cell
surfelC =
K
.
uCell
(
Point
( 1, 2, 1 ) );
79
SCell
surfelD =
K
.
sCell
(
Point
( 1, 1, 0 ) );
80
Cell
surfelE =
K
.
uCell
(
Point
( 1, 1, 2 ) );
81
viewer << surfelA << surfelB << surfelC << surfelD << surfelE;
82
83
Cell
linelA =
K
.
uCell
(
Point
(2, 1 ,2));
84
SCell
linelB =
K
.
sCell
(
Point
(2, 2 ,1));
85
SCell
linelC =
K
.
sCell
(
Point
(1, 2 ,2),
false
);
86
viewer << linelA << linelB << linelC;
87
88
Cell
center =
K
.
uCell
(
Point
(5,5,5));
89
// Testing display of oriented surfels:
90
SCell
ssurfelXZ =
K
.
sCell
(
Point
( 5, 6, 5 ),
false
);
91
SCell
ssurfelXY =
K
.
sCell
(
Point
( 5, 5, 6 ),
false
);
92
SCell
ssurfelZY =
K
.
sCell
(
Point
( 6, 5, 5 ),
false
);
93
viewer<< center;
94
95
SCell
ssurfelXZo =
K
.
sCell
(
Point
( 5, 4, 5 ),
false
);
96
SCell
ssurfelXYo =
K
.
sCell
(
Point
( 5, 5, 4 ),
false
);
97
SCell
ssurfelZYo =
K
.
sCell
(
Point
( 4, 5, 5 ),
false
);
98
99
viewer << ssurfelXZ << ssurfelXY << ssurfelZY;
100
viewer << ssurfelXZo << ssurfelXYo << ssurfelZYo;
101
102
// Testing display oriented pointels
103
Cell
pointelA =
K
.
uCell
(
Point
(2, 2, 2));
104
SCell
pointelB =
K
.
sCell
(
Point
(4, 4, 4),
true
);
105
SCell
pointelC =
K
.
sCell
(
Point
(6, 4, 4),
false
);
106
SCell
linelAC =
K
.
sCell
(
Point
(5, 4, 4),
false
);
107
viewer << pointelA << pointelB << pointelC << linelAC;
108
109
trace
.
emphase
() <<
"Passed."
<< endl;
110
trace
.
endBlock
();
111
viewer.
show
();
112
return
0;
113
}
114
// //
DGtal::KhalimskySpaceND::init
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
DGtal::KhalimskySpaceND::sCell
SCell sCell(const SPreCell &c) const
From a signed cell, returns a signed cell lying into this Khalismky space.
DGtal::KhalimskySpaceND::uCell
Cell uCell(const PreCell &c) const
From an unsigned cell, returns an unsigned cell lying into this Khalismky space.
DGtal::PolyscopeViewer
Definition
PolyscopeViewer.h:57
DGtal::PolyscopeViewer::show
void show() override
Starts the event loop and display of elements.
Definition
PolyscopeViewer.h:73
DGtal::Point
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::endBlock
double endBlock()
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::SCell
KSpace::SCell SCell
Definition
StdDefs.h:149
DGtal::Z3i::Cell
KSpace::Cell Cell
Definition
StdDefs.h:148
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
K
KSpace K
Definition
testCubicalComplex.cpp:62
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
domain
Domain domain
Definition
testProjection.cpp:88
tests
io
viewers
testDisplayKSCell.cpp
Generated on
for DGtal by
1.18.0