31 #if defined(NeighborhoodConfigurationsGenerators_RECURSES) 32 #error Recursive header files inclusion detected in NeighborhoodConfigurationsGenerators.h 33 #else // defined(NeighborhoodConfigurationsGenerators_RECURSES) 35 #define NeighborhoodConfigurationsGenerators_RECURSES 37 #if !defined NeighborhoodConfigurationsGenerators_h 39 #define NeighborhoodConfigurationsGenerators_h 45 #include "DGtal/topology/Object.h" 46 #include "DGtal/helpers/StdDefs.h" 47 #include <unordered_map> 48 #include "boost/dynamic_bitset.hpp" 49 #include <DGtal/topology/helpers/NeighborhoodConfigurationsHelper.h> 68 template <
typename TObject,
typename TMap>
71 const typename TObject::DigitalTopology & dt,
74 typedef typename TObject::DigitalSet DigitalSet;
79 Point p1 = Point::diagonal( -1 );
80 Point p2 = Point::diagonal( 1 );
81 Point c = Point::diagonal( 0 );
83 DigitalSet shapeSet( domain );
84 TObject shape( dt, shapeSet );
86 for ( DomainConstIterator it = domain.
begin(); it != domain.
end(); ++it )
89 &&
"[generateSimplicityTable] number of configurations is too high." );
90 unsigned int nbCfg = 1 << k;
93 if ( ( cfg % 1000 ) == 0 )
97 shape.pointSet().clear();
98 shape.pointSet().insert( c );
100 for ( DomainConstIterator it = domain.
begin(); it != domain.
end(); ++it )
104 if ( cfg & mask ) shape.pointSet().insert( *it );
108 bool simple = shape.isSimple( c );
117 #endif // !defined NeighborhoodConfigurationsGenerators_h 119 #undef NeighborhoodConfigurationsGenerators_RECURSES 120 #endif // else defined(NeighborhoodConfigurationsGenerators_RECURSES) const ConstIterator & end() const
HyperRectDomain< Space > Domain
void progressBar(const double currentValue, const double maximalValue)
void generateSimplicityTable(const typename TObject::DigitalTopology &dt, TMap &map)
const Domain domain(Point(1, 2), Point(6, 5))
uint32_t NeighborhoodConfiguration
const ConstIterator & begin() const
DGtal is the top-level namespace which contains all DGtal functions and types.