Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
shapeDTViewer.cpp
Go to the documentation of this file.
1
16
30
32#include <iostream>
33#include <fstream>
34#include <algorithm>
36
38#include "DGtal/base/Common.h"
39#include "DGtal/helpers/StdDefs.h"
40#include "ConfigExamples.h"
41
42#include "DGtal/shapes/Shapes.h"
43#include "DGtal/shapes/ShapeFactory.h"
44#include "DGtal/io/viewers/PolyscopeViewer.h"
45
46#include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
47#include "DGtal/io/colormaps/GradientColorMap.h"
48#include "DGtal/helpers/StdDefs.h"
49
50#include <boost/algorithm/minmax_element.hpp>
52
53
55
56using namespace DGtal;
57
58int main(int argc, char **argv)
59{
61 viewer.allowReuseList = true;
62
63 DGtal::Z3i::Point center(0,0,0);
64 DGtal::ImplicitRoundedHyperCube<Z3i::Space> myCube( center, 20, 2.8);
66 myCube.getUpperBound());
67
69
71
72
73 // viewer << mySet << DGtal::Display3D::updateDisplay;
74
75
78 DTL2 dt(&domain,&mySet,&Z3i::l2Metric );
80
81 DTL2::Value maxDT = (*boost::first_max_element(dt.constRange().begin(),
82 dt.constRange().end()));
83
84
85 GradientColorMap<DTL2::Value> gradient( 0, maxDT);
90
91 for(Z3i::Domain::ConstIterator it = domain.begin(),
92 itend = domain.end(); it != itend;
93 ++it)
94 if (dt(*it) != 0)
95 {
96 viewer << DGtal::WithQuantity(*it, "value", dt(*it));
97 }
98 viewer << DGtal::ClippingPlane(1,0,0,0);
99
100 viewer.show();
101 return 0;
102}
103
static const Color Red
Definition Color.h:425
static const Color Blue
Definition Color.h:428
static const Color Yellow
Definition Color.h:431
static const Color Green
Definition Color.h:426
Aim: Implementation of the linear in time distance transformation for separable metrics.
Aim: This class template may be used to (linearly) convert scalar values in a given range into a colo...
void addColor(const Color &color)
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a rounded hypercu...
void show() override
Starts the event loop and display of elements.
static void euclideanShaper(TDigitalSet &aSet, const TShapeFunctor &aFunctor, const double h=1.0)
static const L2Metric l2Metric
Definition StdDefs.h:204
HyperRectDomain< Space > Domain
Definition StdDefs.h:172
Space::Point Point
Definition StdDefs.h:168
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition StdDefs.h:173
DGtal is the top-level namespace which contains all DGtal functions and types.
Clipping plane.
Definition Display3D.h:299
Attach a property to an element.
Definition Display3D.h:327
int main()
Definition testBits.cpp:56
Domain domain