DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
exampleGridCurve3d.cpp
Go to the documentation of this file.
1
16
51
53
#include <iostream>
54
#include "DGtal/base/Common.h"
55
#include "DGtal/helpers/StdDefs.h"
56
#include "ConfigExamples.h"
57
#include "DGtal/geometry/curves/GridCurve.h"
58
59
#ifdef DGTAL_WITH_POLYSCOPE_VIEWER
60
#include "DGtal/io/viewers/PolyscopeViewer.h"
61
#endif
63
64
using namespace
std
;
65
using namespace
DGtal
;
66
using namespace
Z3i
;
67
68
69
71
int
main
(
int
argc,
char
** argv )
72
{
73
74
75
trace
.
info
() <<
"exampleGridCurve3d: the type of data to be displayed "
76
<<
"may be given as argument as follows: "
77
<< argv[0] <<
" scells"
<< endl;
78
trace
.
info
() <<
"Available types are: gridcurve (default), scells, points, midpoints, arrows"
<< endl;
79
80
string
type = (argc > 1) ?
string
(argv[1]) :
"arrows"
;
81
trace
.
info
() <<
"Chosen type: "
<< type << endl;
82
83
//curve
84
string
sinus = examplesPath +
"samples/sinus.dat"
;
85
86
// domain
87
Point
lowerBound =
Point::diagonal
( -100 );
88
Point
upperBound =
Point::diagonal
( 100 );
89
91
K3
ks; ks.
init
( lowerBound, upperBound,
true
);
92
GridCurve<K3>
gc( ks );
94
96
fstream inputStream;
97
inputStream.open (sinus.c_str(), ios::in);
98
99
gc.
initFromVectorStream
(inputStream);
100
101
inputStream.close();
103
104
#ifdef DGTAL_WITH_POLYSCOPE_VIEWER
105
PolyscopeViewer<Space,K3>
viewer(ks);
106
107
if
(type ==
"gridcurve"
)
108
{
109
viewer << gc;
110
}
111
else
if
(type ==
"scells"
)
112
{
113
viewer << gc.
getSCellsRange
();
114
}
115
else
if
(type ==
"points"
)
116
{
117
viewer << gc.
getPointsRange
();
118
}
119
else
if
(type ==
"midpoints"
)
120
{
121
viewer << gc.
getMidPointsRange
();
122
}
123
else
if
(type ==
"arrows"
)
124
{
125
viewer << gc.
getArrowsRange
();
126
}
127
else
128
{
129
trace
.
info
() <<
"Display type not known."
<< std::endl;
130
}
131
viewer.
show
();
132
#endif
133
134
return
0;
135
}
136
// //
DGtal::GridCurve
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
Definition
GridCurve.h:173
DGtal::GridCurve::getSCellsRange
SCellsRange getSCellsRange() const
Definition
GridCurve.h:407
DGtal::GridCurve::getMidPointsRange
MidPointsRange getMidPointsRange() const
Definition
GridCurve.h:430
DGtal::GridCurve::initFromVectorStream
bool initFromVectorStream(std::istream &in)
DGtal::GridCurve::getPointsRange
PointsRange getPointsRange() const
Definition
GridCurve.h:418
DGtal::GridCurve::getArrowsRange
ArrowsRange getArrowsRange() const
Definition
GridCurve.h:442
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::PointVector< dim, Integer >::diagonal
static Self diagonal(Component val=1)
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::info
std::ostream & info()
DGtal::Z3i
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal::Z3i::K3
KSpace K3
Definition
StdDefs.h:147
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.
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
examples
geometry
curves
exampleGridCurve3d.cpp
Generated on
for DGtal by
1.18.0