58int main(
int argc,
char** argv )
67 EuclideanShape ball1( c1, radius1 );
74 EuclideanShape ball2( c2, radius2 );
81 std::cerr << std::endl;
86 label += shape2( *it ) ? 2 : 0;
87 image.setValue( *it, label );
88 std::cerr << (int)
image( *it );
90 std::cerr << std::endl;
94 trace.beginBlock(
"Construct the Khalimsky space from the image domain." );
96 bool space_ok =
K.init(
domain.lowerBound(),
domain.upperBound(),
true );
99 trace.error() <<
"Error in the Khamisky space construction."<<std::endl;
106 trace.beginBlock(
"Set up digital surface." );
108 MySurfelAdjacency surfAdj(
true );
116 SCell vox1 =
K.sSpel( c1 +
Point( radius1, 0, 0 ),
K.POS );
117 SCell bel10 =
K.sIncident( vox1, 0,
true );
118 FSurfelPredicate surfPredicate10(
K,
image, 1, 0 );
119 Frontier frontier10 =
120 new FrontierContainer(
K, surfPredicate10, surfAdj, bel10 );
122 SCell vox2 =
K.sSpel( c2 -
Point( radius2, 0, 0 ),
K.POS );
123 SCell bel20 =
K.sIncident( vox2, 0,
false );
124 FSurfelPredicate surfPredicate20(
K,
image, 2, 0 );
125 Frontier frontier20 =
126 new FrontierContainer(
K, surfPredicate20, surfAdj, bel20 );
128 SCell vox3 =
K.sSpel( c1 -
Point( radius1, 0, 0 ),
K.POS );
129 SCell bel32 =
K.sIncident( vox3, 0,
false );
130 BSurfelPredicate surfPredicate3(
K,
image, 3 );
132 new BoundaryContainer(
K, surfPredicate3, surfAdj, bel32 );
137 trace.beginBlock(
"Displaying surface in PolyscopeViewer." );
143 unsigned int nbSurfels10 = 0;
145 for ( Frontier::ConstIterator
146 it = frontier10.begin(), it_end = frontier10.end();
147 it != it_end; ++it, ++nbSurfels10 )
150 unsigned int nbSurfels20 = 0;
152 for ( Frontier::ConstIterator
153 it = frontier20.begin(), it_end = frontier20.end();
154 it != it_end; ++it, ++nbSurfels20 )
157 unsigned int nbSurfels3 = 0;
158 viewer <<
Color( 255, 130, 15 );
159 for ( Boundary::ConstIterator
160 it = boundary3.begin(), it_end = boundary3.end();
161 it != it_end; ++it, ++nbSurfels3 )
163 trace.info() <<
"nbSurfels10 = " << nbSurfels10
164 <<
", nbSurfels20 = " << nbSurfels20
165 <<
", nbSurfels3 = " << nbSurfels3 << std::endl;