33#include "DGtal/base/Common.h"
34#include "DGtal/kernel/CanonicEmbedder.h"
35#include "DGtal/helpers/StdDefs.h"
36#include "DGtal/graph/CUndirectedSimpleGraph.h"
37#include "DGtal/graph/CGraphVisitor.h"
38#include "DGtal/graph/GraphVisitorRange.h"
39#include "DGtal/graph/DistanceBreadthFirstVisitor.h"
40#include "DGtal/geometry/volumes/distance/LpMetric.h"
41#include "DGtal/io/boards/Board2D.h"
42#include "DGtal/io/Color.h"
43#include "DGtal/io/colormaps/GradientColorMap.h"
44#include "DGtal/shapes/Shapes.h"
45#include "DGtal/images/ImageContainerBySTLVector.h"
96 <<
SetMode( p1.className(),
"Paving" );
112 VertexEmbedder embedder;
113 Distance distance(2.0);
114 DistanceToPoint distanceToPoint = std::bind(distance, embedder(c1), std::placeholders::_1);
116 VertexFunctor vfunctor( embedder, distanceToPoint );
117 Visitor visitor( obj, vfunctor, c1 );
121 Scalar v = visitor.
current().second;
122 image.setValue( visitor.
current().first, v );
126 string specificStyle = p1.className() +
"/Paving";
129 it != shape_set.
end();
136 else if( image(*it) > 0 )
139 cmap_grad( image(*it) ) ) );
147 trace.
info() <<
"- Output file testDistancePropagation.eps" << std::endl;
148 board.
saveEPS(
"testDistancePropagation.eps");
153 VisitorRange range(
new Visitor( obj, vfunctor, c1 ) );
156 unsigned int nbok = 0;
157 unsigned int nbperfect = 0;
158 for ( VisitorRange::NodeConstIterator it = range.beginNode(), itEnd = range.endNode();
161 Scalar next_d = (*it).second;
162 ++nb; nbok += (next_d >= d-0.75 ) ? 1 : 0;
163 nbperfect += (next_d >= d ) ? 1 : 0;
167 <<
") number of vertices in approximate Euclidean distance ordering."<< std::endl;
168 trace.
info() <<
"(" << nbperfect <<
"/" << nb
169 <<
") number of vertices in perfect Euclidean distance ordering."<< std::endl;
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: This class is useful to perform a breadth-first exploration of a graph given a starting point or...
const Node & current() const
Structure representing an RGB triple with alpha component.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
ConstIterator end() const
ConstIterator begin() const
Container::const_iterator ConstIterator
ConstIterator type of the container;.
Aim: This class is useful to perform an exploration of a graph given a starting point or set (called ...
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: Transforms a graph visitor into a single pass input range.
std::string className() const
Aim: implements association bewteen points lying in a digital domain and values.
Aim: implements l_p metrics.
Aim: An object (or digital object) represents a set in some digital space associated with a digital t...
static void addNorm1Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
static void addNorm2Ball(TDigitalSet &aSet, const Point &aCenter, UnsignedInteger aRadius)
void beginBlock(const std::string &keyword="")
Aim: Define a new Functor from the composition of two other functors.
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
BreadthFirstVisitor< MyDigitalSurface > Visitor
Aim: Gathers several functions useful for concept checks.
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A trivial embedder for digital points, which corresponds to the canonic injection of Zn into Rn.
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
static Image create(const Set &aSet, const Value &defaultValue, const bool addBorder, typename Set::ConstIterator itBegin, typename Set::ConstIterator itEnd, const bool keepSetDomain=false)
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....
Aim: Defines the concept of a visitor onto a graph, that is an object that traverses vertices of the ...
Aim: Represents the concept of local graph: each vertex has neighboring vertices, but we do not neces...
ImageContainerBySTLVector< Z2i::Domain, int > Image
bool testDistancePropagation()
HyperRectDomain< Space > Domain
PointVector< 3, double > RealPoint
Z2i::DigitalSet DigitalSet