mirror of https://github.com/CGAL/cgal
mark type modified from int to size_type, exception thrown in get_new_mark and test added in the test-suite
This commit is contained in:
parent
df9340115a
commit
25b2727381
|
|
@ -883,33 +883,33 @@ void reverse_orientation_connected_component(Dart_handle adart);
|
|||
|
||||
/*!
|
||||
Reserves a new mark. Returns its
|
||||
index. Returns -1 if there is no more available free mark.
|
||||
index. If there is no more available free mark, throw the exception Exception_no_more_available_mark.
|
||||
*/
|
||||
int get_new_mark() const;
|
||||
size_type get_new_mark() const;
|
||||
|
||||
/*!
|
||||
Returns true iff `m` is a reserved mark of the combinatorial map.
|
||||
\pre 0\f$ \leq\f$<I>m</I>\f$ <\f$\ref CombinatorialMap::NB_MARKS "NB_MARKS".
|
||||
*/
|
||||
bool is_reserved(int m) const;
|
||||
bool is_reserved(size_type m) const;
|
||||
|
||||
/*!
|
||||
Returns true iff `*dh` is marked for `m`.
|
||||
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)" and `*dh`\f$ \in\f$`darts()`.
|
||||
*/
|
||||
bool is_marked(Dart_const_handle dh, int m) const;
|
||||
bool is_marked(Dart_const_handle dh, size_type m) const;
|
||||
|
||||
/*!
|
||||
Marks `*dh` for `m`.
|
||||
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)" and `*dh`\f$ \in\f$`darts()`.
|
||||
*/
|
||||
void mark(Dart_const_handle dh, int m) const;
|
||||
void mark(Dart_const_handle dh, size_type m) const;
|
||||
|
||||
/*!
|
||||
Unmarks `*dh` for the mark `m`.
|
||||
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)" and `*dh`\f$ \in\f$`darts()`.
|
||||
*/
|
||||
void unmark(Dart_const_handle dh, int m) const;
|
||||
void unmark(Dart_const_handle dh, size_type m) const;
|
||||
|
||||
/*!
|
||||
Inverse the mark `m` for all the darts of the combinatorial map.
|
||||
|
|
@ -917,31 +917,31 @@ All the marked darts become unmarked and all the unmarked darts
|
|||
become marked.
|
||||
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
|
||||
*/
|
||||
void negate_mark(int m) const;
|
||||
void negate_mark(size_type m) const;
|
||||
|
||||
/*!
|
||||
Unmarks all the darts of the combinatorial map for `m`.
|
||||
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
|
||||
*/
|
||||
void unmark_all(int m) const;
|
||||
void unmark_all(size_type m) const;
|
||||
|
||||
/*!
|
||||
Returns the number of marked darts for `m`.
|
||||
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
|
||||
*/
|
||||
size_type number_of_marked_darts(int m) const;
|
||||
size_type number_of_marked_darts(size_type m) const;
|
||||
|
||||
/*!
|
||||
Return the number of unmarked darts for `m`.
|
||||
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
|
||||
*/
|
||||
size_type number_of_unmarked_darts(int m) const;
|
||||
size_type number_of_unmarked_darts(size_type m) const;
|
||||
|
||||
/*!
|
||||
Frees mark `m`.
|
||||
\pre \ref CombinatorialMap::is_reserved "is_reserved(m)".
|
||||
*/
|
||||
void free_mark(int m) const;
|
||||
void free_mark(size_type m) const;
|
||||
|
||||
/// @}
|
||||
}; /* end CombinatorialMap */
|
||||
|
|
|
|||
|
|
@ -9,35 +9,16 @@ typedef CMap_3::Dart_handle Dart_handle;
|
|||
|
||||
typedef CMap_3::size_type size_type;
|
||||
|
||||
typedef CMap_3::Exception_mark_is_out_of_border Exception_mark_is_out_of_border;
|
||||
typedef CMap_3::Exception_no_more_available_mark Exception_no_more_available_mark;
|
||||
|
||||
int main()
|
||||
{
|
||||
CMap_3 cm;
|
||||
|
||||
// we try to reserve more marks than available
|
||||
std::cout << cm.NB_MARKS << " available marks\n";
|
||||
size_type marks[cm.NB_MARKS+1];
|
||||
#if 0
|
||||
for (size_type i=0;i<cm.NB_MARKS+1;i++)
|
||||
while (1)
|
||||
{
|
||||
try
|
||||
{
|
||||
marks[i] = cm.get_new_mark();
|
||||
}
|
||||
catch (Exception_mark_is_out_of_border e)
|
||||
{
|
||||
std::cout << "Mark number " << i << " is NOT ok\n";
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
std::cout << "Mark number " << i << " is ok\n";
|
||||
size_type m = cm.get_new_mark();
|
||||
}
|
||||
for (size_type i=0;i<cm.NB_MARKS+1;i++)
|
||||
{
|
||||
cm.free_mark(marks[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
// 1) Reserve a mark.
|
||||
size_type mark;
|
||||
|
|
@ -45,7 +26,7 @@ int main()
|
|||
{
|
||||
mark = cm.get_new_mark();
|
||||
}
|
||||
catch (Exception_mark_is_out_of_border e)
|
||||
catch (Exception_no_more_available_mark e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
|
|
|
|||
|
|
@ -105,8 +105,8 @@ namespace CGAL {
|
|||
unmark_treated_darts();
|
||||
this->mmap->free_mark(mcell_mark_number);
|
||||
this->mmap->free_mark(this->mmark_number);
|
||||
this->mcell_mark_number = Map::MARK_ERROR; // To avoid basic class to try to unmark darts.
|
||||
this->mmark_number = Map::MARK_ERROR; // To avoid basic class to try to unmark darts.
|
||||
this->mcell_mark_number = Map::INVALID_MARK; // To avoid basic class to try to unmark darts.
|
||||
this->mmark_number = Map::INVALID_MARK; // To avoid basic class to try to unmark darts.
|
||||
}
|
||||
|
||||
/// Copy constructor.
|
||||
|
|
@ -217,7 +217,7 @@ namespace CGAL {
|
|||
if (this->mmap->get_number_of_times_mark_reserved(mmark_number)==1)
|
||||
unmark_treated_darts();
|
||||
this->mmap->free_mark(mmark_number);
|
||||
this->mmark_number = Map::MARK_ERROR; // To avoid basic class to try to unmark darts.
|
||||
this->mmark_number = Map::INVALID_MARK; // To avoid basic class to try to unmark darts.
|
||||
}
|
||||
|
||||
/// Copy constructor.
|
||||
|
|
@ -333,7 +333,7 @@ namespace CGAL {
|
|||
if (this->mmap->get_number_of_times_mark_reserved(mmark_number)==1)
|
||||
unmark_treated_darts();
|
||||
this->mmap->free_mark(mmark_number);
|
||||
this->mmark_number = Map::MARK_ERROR; // To avoid basic class to try to unmark darts.
|
||||
this->mmark_number = Map::INVALID_MARK; // To avoid basic class to try to unmark darts.
|
||||
}
|
||||
|
||||
/// Copy constructor.
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ namespace CGAL {
|
|||
|
||||
static const size_type NB_MARKS = Base::NB_MARKS;
|
||||
// to fix the use of -1 to test unused marks in several algorithms
|
||||
static const size_type MARK_ERROR = NB_MARKS;
|
||||
static const size_type INVALID_MARK = NB_MARKS;
|
||||
static const unsigned int dimension = Base::dimension;
|
||||
|
||||
typedef typename Base::Null_handle_type Null_handle_type;
|
||||
|
|
@ -146,7 +146,7 @@ namespace CGAL {
|
|||
public Base::template Attribute_const_range<i>
|
||||
{};
|
||||
|
||||
class Exception_mark_is_out_of_border {};
|
||||
class Exception_no_more_available_mark {};
|
||||
|
||||
public:
|
||||
/** Default Combinatorial_map constructor.
|
||||
|
|
@ -749,8 +749,7 @@ namespace CGAL {
|
|||
*/
|
||||
bool is_reserved(size_type amark) const
|
||||
{
|
||||
CGAL_assertion(amark>=0 && amark<NB_MARKS);
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
CGAL_assertion(amark<NB_MARKS);
|
||||
|
||||
return (mnb_times_reserved_marks[amark]!=0);
|
||||
}
|
||||
|
|
@ -762,7 +761,6 @@ namespace CGAL {
|
|||
size_type number_of_marked_darts(size_type amark) const
|
||||
{
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
return mnb_marked_darts[amark];
|
||||
}
|
||||
|
|
@ -803,9 +801,8 @@ namespace CGAL {
|
|||
{
|
||||
std::cerr << "Not enough Boolean marks: "
|
||||
"increase NB_MARKS in item class." << std::endl;
|
||||
// return -1;
|
||||
std::cerr << " (exception launched)" << std::endl;
|
||||
throw Exception_mark_is_out_of_border();
|
||||
throw Exception_no_more_available_mark();
|
||||
}
|
||||
|
||||
size_type m = mfree_marks_stack[mnb_used_marks];
|
||||
|
|
@ -826,7 +823,6 @@ namespace CGAL {
|
|||
void share_a_mark(size_type amark) const
|
||||
{
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
++mnb_times_reserved_marks[amark];
|
||||
}
|
||||
|
|
@ -837,7 +833,6 @@ namespace CGAL {
|
|||
size_type get_number_of_times_mark_reserved(size_type amark) const
|
||||
{
|
||||
CGAL_assertion( amark<NB_MARKS );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
return mnb_times_reserved_marks[amark];
|
||||
}
|
||||
|
|
@ -850,7 +845,6 @@ namespace CGAL {
|
|||
void negate_mark(size_type amark) const
|
||||
{
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
mnb_marked_darts[amark] = number_of_darts() - mnb_marked_darts[amark];
|
||||
|
||||
|
|
@ -866,7 +860,6 @@ namespace CGAL {
|
|||
{
|
||||
// CGAL_assertion( adart != null_dart_handle );
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
return get_dart_mark(adart, amark)!=mmask_marks[amark];
|
||||
}
|
||||
|
|
@ -881,7 +874,6 @@ namespace CGAL {
|
|||
{
|
||||
CGAL_assertion( adart != null_dart_handle );
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
if (is_marked(adart, amark) != astate)
|
||||
{
|
||||
|
|
@ -900,7 +892,6 @@ namespace CGAL {
|
|||
{
|
||||
CGAL_assertion( adart != null_dart_handle );
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
if (is_marked(adart, amark)) return;
|
||||
|
||||
|
|
@ -916,7 +907,6 @@ namespace CGAL {
|
|||
{
|
||||
CGAL_assertion( adart != null_dart_handle );
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
if (!is_marked(adart, amark)) return;
|
||||
|
||||
|
|
@ -932,7 +922,6 @@ namespace CGAL {
|
|||
void mark_null_dart(size_type amark) const
|
||||
{
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
#ifdef CGAL_CMAP_DEPRECATED
|
||||
if ( null_dart_handle!=NULL ) // Pb with static null_dart_handle for windows
|
||||
|
|
@ -946,7 +935,6 @@ namespace CGAL {
|
|||
void unmark_null_dart(size_type amark) const
|
||||
{
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
#ifdef CGAL_CMAP_DEPRECATED
|
||||
if ( null_dart_handle!=NULL ) // Pb with static null_dart_handle for windows
|
||||
|
|
@ -983,7 +971,6 @@ namespace CGAL {
|
|||
void free_mark(size_type amark) const
|
||||
{
|
||||
CGAL_assertion( is_reserved(amark) );
|
||||
// CGAL_assume( (size_type)amark<NB_MARKS );
|
||||
|
||||
if ( mnb_times_reserved_marks[amark]>1 )
|
||||
{
|
||||
|
|
@ -1093,7 +1080,7 @@ namespace CGAL {
|
|||
unsigned int i = 0, j = 0;
|
||||
std::vector<size_type> marks(dimension+1);
|
||||
for ( i=0; i<=dimension; ++i)
|
||||
marks[i] = MARK_ERROR;
|
||||
marks[i] = INVALID_MARK;
|
||||
|
||||
Helper::template
|
||||
Foreach_enabled_attributes<Reserve_mark_functor<Self> >::
|
||||
|
|
@ -1105,7 +1092,7 @@ namespace CGAL {
|
|||
if ( !valid )
|
||||
{ // We continue the traversal to mark all the darts.
|
||||
for ( i=0; i<=dimension; ++i)
|
||||
if (marks[i]!=MARK_ERROR) mark(it,marks[i]);
|
||||
if (marks[i]!=INVALID_MARK) mark(it,marks[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1178,7 +1165,7 @@ namespace CGAL {
|
|||
}
|
||||
}
|
||||
for ( i=0; i<=dimension; ++i)
|
||||
if ( marks[i]!=MARK_ERROR )
|
||||
if ( marks[i]!=INVALID_MARK )
|
||||
{
|
||||
CGAL_assertion( is_whole_map_marked(marks[i]) );
|
||||
free_mark(marks[i]);
|
||||
|
|
@ -1192,7 +1179,7 @@ namespace CGAL {
|
|||
{
|
||||
std::vector<size_type> marks(dimension+1);
|
||||
for ( unsigned int i=0; i<=dimension; ++i)
|
||||
marks[i] = MARK_ERROR;
|
||||
marks[i] = INVALID_MARK;
|
||||
|
||||
Helper::template
|
||||
Foreach_enabled_attributes<Reserve_mark_functor<Self> >::
|
||||
|
|
@ -1207,7 +1194,7 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
for ( unsigned int i=0; i<=dimension; ++i)
|
||||
if ( marks[i]!=MARK_ERROR )
|
||||
if ( marks[i]!=INVALID_MARK )
|
||||
{
|
||||
CGAL_assertion( is_whole_map_marked(marks[i]) );
|
||||
free_mark(marks[i]);
|
||||
|
|
@ -1953,18 +1940,7 @@ namespace CGAL {
|
|||
dartv.push_back(it);
|
||||
}
|
||||
|
||||
// size_type mark = get_new_mark();
|
||||
// CGAL_assertion( mark!=-1 );
|
||||
size_type mark;
|
||||
try
|
||||
{
|
||||
mark = get_new_mark();
|
||||
}
|
||||
catch (Exception_mark_is_out_of_border e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
size_type mark = get_new_mark();
|
||||
|
||||
CGAL::CMap_dart_iterator_basic_of_involution<Self, 1>
|
||||
I1(*this, adart1, mark);
|
||||
|
|
@ -2035,18 +2011,7 @@ namespace CGAL {
|
|||
dartv.push_back(it);
|
||||
}
|
||||
|
||||
// int mark = get_new_mark();
|
||||
// CGAL_assertion( mark!=-1 );
|
||||
size_type mark;
|
||||
try
|
||||
{
|
||||
mark = get_new_mark();
|
||||
}
|
||||
catch (Exception_mark_is_out_of_border e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
size_type mark = get_new_mark();
|
||||
|
||||
CGAL::CMap_dart_iterator_basic_of_involution<Self, 1>
|
||||
I1(*this, adart1, mark);
|
||||
|
|
@ -2102,18 +2067,7 @@ namespace CGAL {
|
|||
CGAL_assertion( 2<=i && i<=dimension );
|
||||
CGAL_assertion( (is_sewable<i>(adart1,adart2)) );
|
||||
|
||||
// int mark=get_new_mark();
|
||||
// CGAL_assertion( mark!=-1 );
|
||||
size_type mark;
|
||||
try
|
||||
{
|
||||
mark = get_new_mark();
|
||||
}
|
||||
catch (Exception_mark_is_out_of_border e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
size_type mark=get_new_mark();
|
||||
|
||||
CGAL::CMap_dart_iterator_basic_of_involution<Self, i>
|
||||
I1(*this, adart1, mark);
|
||||
|
|
@ -2463,14 +2417,14 @@ namespace CGAL {
|
|||
for ( unsigned int i=0; i<dimension+2; ++i)
|
||||
{
|
||||
res[i]=0;
|
||||
marks[i]=MARK_ERROR;
|
||||
marks[i]=INVALID_MARK;
|
||||
}
|
||||
|
||||
// Mark reservation
|
||||
for ( unsigned int i=0; i<acells.size(); ++i)
|
||||
{
|
||||
CGAL_assertion(acells[i]<=dimension+1);
|
||||
if ( marks[acells[i]]==MARK_ERROR )
|
||||
if ( marks[acells[i]]==INVALID_MARK )
|
||||
{
|
||||
marks[acells[i]] = get_new_mark();
|
||||
}
|
||||
|
|
@ -2489,7 +2443,7 @@ namespace CGAL {
|
|||
}
|
||||
|
||||
// Unmarking darts
|
||||
std::vector<unsigned int> tounmark;
|
||||
std::vector<size_type> tounmark;
|
||||
for ( unsigned int i=0; i<acells.size(); ++i)
|
||||
{
|
||||
if ( is_whole_map_marked(marks[acells[i]]) ||
|
||||
|
|
@ -2618,7 +2572,7 @@ namespace CGAL {
|
|||
<Self, CGAL::CMap_dart_iterator_basic_of_orbit<Self,Beta...>,
|
||||
CGAL::CMap_dart_const_iterator_basic_of_orbit<Self,Beta...> > Base;
|
||||
|
||||
Dart_of_orbit_basic_range(Self &amap, Dart_handle adart, size_type amark=MARK_ERROR):
|
||||
Dart_of_orbit_basic_range(Self &amap, Dart_handle adart, size_type amark=INVALID_MARK):
|
||||
Base(amap, adart, amark)
|
||||
{}
|
||||
};
|
||||
|
|
@ -2633,7 +2587,7 @@ namespace CGAL {
|
|||
Base;
|
||||
|
||||
Dart_of_orbit_basic_const_range(const Self &amap, Dart_const_handle
|
||||
adart, size_type amark=MARK_ERROR):
|
||||
adart, size_type amark=INVALID_MARK):
|
||||
Base(amap, adart, amark)
|
||||
{}
|
||||
};
|
||||
|
|
@ -2677,12 +2631,12 @@ namespace CGAL {
|
|||
//--------------------------------------------------------------------------
|
||||
template<unsigned int ... Beta>
|
||||
Dart_of_orbit_basic_range<Beta...> darts_of_orbit_basic(Dart_handle adart,
|
||||
size_type amark=MARK_ERROR)
|
||||
size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<Beta...>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int ... Beta>
|
||||
Dart_of_orbit_basic_const_range<Beta...>
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<Beta...>(*this,adart,amark); }
|
||||
//**************************************************************************
|
||||
#else
|
||||
|
|
@ -2703,7 +2657,7 @@ namespace CGAL {
|
|||
B6,B7,B8,B9> > Base;
|
||||
|
||||
Dart_of_orbit_basic_range(Self &amap, Dart_handle adart,
|
||||
size_type /*amark*/=MARK_ERROR):
|
||||
size_type /*amark*/=INVALID_MARK):
|
||||
Base(amap, adart)
|
||||
{}
|
||||
};
|
||||
|
|
@ -2721,7 +2675,7 @@ namespace CGAL {
|
|||
<Self,B1,B2,B3,B4,B5,B6,B7,B8,B9> > Base;
|
||||
|
||||
Dart_of_orbit_basic_const_range(const Self &amap,
|
||||
Dart_const_handle adart, size_type amark=MARK_ERROR):
|
||||
Dart_const_handle adart, size_type amark=INVALID_MARK):
|
||||
Base(amap, adart, amark)
|
||||
{}
|
||||
};
|
||||
|
|
@ -2867,104 +2821,104 @@ namespace CGAL {
|
|||
//--------------------------------------------------------------------------
|
||||
// Basic versions
|
||||
Dart_of_orbit_basic_range<> darts_of_orbit_basic(Dart_handle adart,
|
||||
size_type amark=MARK_ERROR)
|
||||
size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
Dart_of_orbit_basic_const_range<> darts_of_orbit_basic
|
||||
(Dart_const_handle adart,size_type amark=MARK_ERROR) const
|
||||
(Dart_const_handle adart,size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1>
|
||||
Dart_of_orbit_basic_range<B1> darts_of_orbit_basic(Dart_handle adart,
|
||||
size_type amark=MARK_ERROR)
|
||||
size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<B1>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1>
|
||||
Dart_of_orbit_basic_const_range<B1> darts_of_orbit_basic
|
||||
(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<B1>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2>
|
||||
Dart_of_orbit_basic_range<B1,B2> darts_of_orbit_basic(Dart_handle adart,
|
||||
size_type amark=MARK_ERROR)
|
||||
size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<B1,B2>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2>
|
||||
Dart_of_orbit_basic_const_range<B1,B2> darts_of_orbit_basic
|
||||
(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<B1,B2>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3>
|
||||
Dart_of_orbit_basic_range<B1,B2,B3> darts_of_orbit_basic(Dart_handle adart,
|
||||
size_type amark=MARK_ERROR)
|
||||
size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<B1,B2,B3>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3>
|
||||
Dart_of_orbit_basic_const_range<B1,B2,B3> darts_of_orbit_basic
|
||||
(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<B1,B2,B3>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4>
|
||||
Dart_of_orbit_basic_range<B1,B2,B3,B4> darts_of_orbit_basic
|
||||
(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<B1,B2,B3,B4>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4>
|
||||
Dart_of_orbit_basic_const_range<B1,B2,B3,B4>
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<B1,B2,B3,B4>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4,
|
||||
unsigned int B5>
|
||||
Dart_of_orbit_basic_range<B1,B2,B3,B4,B5> darts_of_orbit_basic
|
||||
(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<B1,B2,B3,B4,B5>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4,
|
||||
unsigned int B5>
|
||||
Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5>
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4,
|
||||
unsigned int B5,unsigned int B6>
|
||||
Dart_of_orbit_basic_range<B1,B2,B3,B4,B5,B6> darts_of_orbit_basic
|
||||
(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<B1,B2,B3,B4,B5,B6>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4,
|
||||
unsigned int B5,unsigned int B6>
|
||||
Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5,B6>
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5,B6>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4,
|
||||
unsigned int B5,unsigned int B6,unsigned int B7>
|
||||
Dart_of_orbit_basic_range<B1,B2,B3,B4,B5,B6,B7> darts_of_orbit_basic
|
||||
(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<B1,B2,B3,B4,B5,B6,B7>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4,
|
||||
unsigned int B5,unsigned int B6,unsigned int B7>
|
||||
Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5,B6,B7>
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5,B6,B7>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4,
|
||||
unsigned int B5,unsigned int B6,unsigned int B7,unsigned int B8>
|
||||
Dart_of_orbit_basic_range<B1,B2,B3,B4,B5,B6,B7,B8> darts_of_orbit
|
||||
(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<B1,B2,B3,B4,B5,B6,B7,B8>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template <unsigned int B1,unsigned int B2,unsigned int B3,unsigned int B4,
|
||||
unsigned int B5,unsigned int B6,unsigned int B7,unsigned int B8>
|
||||
Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5,B6,B7,B8>
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5,B6,B7,B8>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
|
|
@ -2972,7 +2926,7 @@ namespace CGAL {
|
|||
unsigned int B5,unsigned int B6,unsigned int B7,unsigned int B8,
|
||||
unsigned int B9>
|
||||
Dart_of_orbit_basic_range<B1,B2,B3,B4,B5,B6,B7,B8,B9>
|
||||
darts_of_orbit_basic(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
darts_of_orbit_basic(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_orbit_basic_range<B1,B2,B3,B4,B5,B6,B7,B8,B9>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
|
|
@ -2980,7 +2934,7 @@ namespace CGAL {
|
|||
unsigned int B5,unsigned int B6,unsigned int B7,unsigned int B8,
|
||||
unsigned int B9>
|
||||
Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5,B6,B7,B8,B9>
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_orbit_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_orbit_basic_const_range<B1,B2,B3,B4,B5,B6,B7,B8,B9>
|
||||
(*this,adart,amark); }
|
||||
//**************************************************************************
|
||||
|
|
@ -2996,7 +2950,7 @@ namespace CGAL {
|
|||
<Self, CGAL::CMap_dart_iterator_basic_of_cell<Self,i,dim>,
|
||||
CGAL::CMap_dart_const_iterator_basic_of_cell<Self,i,dim> > Base;
|
||||
|
||||
Dart_of_cell_basic_range(Self &amap, Dart_handle adart, size_type amark=MARK_ERROR) :
|
||||
Dart_of_cell_basic_range(Self &amap, Dart_handle adart, size_type amark=INVALID_MARK) :
|
||||
Base(amap, adart, amark)
|
||||
{}
|
||||
};
|
||||
|
|
@ -3010,7 +2964,7 @@ namespace CGAL {
|
|||
<Self, CGAL::CMap_dart_const_iterator_basic_of_cell<Self,i,dim> > Base;
|
||||
|
||||
Dart_of_cell_basic_const_range(const Self &amap, Dart_const_handle adart,
|
||||
size_type amark=MARK_ERROR) :
|
||||
size_type amark=INVALID_MARK) :
|
||||
Base(amap, adart, amark)
|
||||
{}
|
||||
};
|
||||
|
|
@ -3046,22 +3000,22 @@ namespace CGAL {
|
|||
/// @return a range on all the darts of the given i-cell
|
||||
template<unsigned int i, int dim>
|
||||
Dart_of_cell_basic_range<i,dim> darts_of_cell_basic(Dart_handle adart,
|
||||
size_type amark=MARK_ERROR)
|
||||
size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_cell_basic_range<i,dim>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i, int dim>
|
||||
Dart_of_cell_basic_const_range<i,dim> darts_of_cell_basic
|
||||
(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_cell_basic_const_range<i,dim>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i>
|
||||
Dart_of_cell_basic_range<i,Self::dimension>
|
||||
darts_of_cell_basic(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
darts_of_cell_basic(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return darts_of_cell_basic<i,Self::dimension>(adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i>
|
||||
Dart_of_cell_basic_const_range<i,Self::dimension>
|
||||
darts_of_cell_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_cell_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return darts_of_cell_basic<i,Self::dimension>(adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i, int dim>
|
||||
|
|
@ -3092,7 +3046,7 @@ namespace CGAL {
|
|||
CGAL::CMap_dart_const_iterator_basic_of_involution<Self,i,dim> > Base;
|
||||
|
||||
Dart_of_involution_basic_range(Self &amap, Dart_handle adart,
|
||||
size_type amark=MARK_ERROR):
|
||||
size_type amark=INVALID_MARK):
|
||||
Base(amap, adart, amark)
|
||||
{}
|
||||
};
|
||||
|
|
@ -3108,30 +3062,30 @@ namespace CGAL {
|
|||
|
||||
Dart_of_involution_basic_const_range(const Self &amap,
|
||||
Dart_const_handle adart,
|
||||
size_type amark=MARK_ERROR) :
|
||||
size_type amark=INVALID_MARK) :
|
||||
Base(amap, adart, amark)
|
||||
{}
|
||||
};
|
||||
//**************************************************************************
|
||||
template<unsigned int i,int dim>
|
||||
Dart_of_involution_basic_range<i,dim>
|
||||
darts_of_involution_basic(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
darts_of_involution_basic(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_involution_basic_range<i,dim>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i,int dim>
|
||||
Dart_of_involution_basic_const_range<i,dim>
|
||||
darts_of_involution_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_involution_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_involution_basic_const_range<i,dim>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i>
|
||||
Dart_of_involution_basic_range<i,Self::dimension>
|
||||
darts_of_involution_basic(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
darts_of_involution_basic(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_involution_basic_range<i,Self::dimension>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i>
|
||||
Dart_of_involution_basic_const_range<i,Self::dimension>
|
||||
darts_of_involution_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_involution_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_involution_basic_const_range<i,Self::dimension>
|
||||
(*this,adart,amark); }
|
||||
//**************************************************************************
|
||||
|
|
@ -3147,7 +3101,7 @@ namespace CGAL {
|
|||
Base;
|
||||
|
||||
Dart_of_involution_inv_basic_range(Self &amap, Dart_handle adart,
|
||||
size_type amark=MARK_ERROR):
|
||||
size_type amark=INVALID_MARK):
|
||||
Base(amap, adart, amark)
|
||||
{}
|
||||
};
|
||||
|
|
@ -3164,31 +3118,31 @@ namespace CGAL {
|
|||
|
||||
Dart_of_involution_inv_basic_const_range(const Self &amap,
|
||||
Dart_const_handle adart,
|
||||
size_type amark=MARK_ERROR) :
|
||||
size_type amark=INVALID_MARK) :
|
||||
Base(amap, adart, amark)
|
||||
{}
|
||||
};
|
||||
//**************************************************************************
|
||||
template<unsigned int i,int dim>
|
||||
Dart_of_involution_inv_basic_range<i,dim>
|
||||
darts_of_involution_inv_basic(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
darts_of_involution_inv_basic(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_involution_inv_basic_range<i,dim>(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i,int dim>
|
||||
Dart_of_involution_inv_basic_const_range<i,dim>
|
||||
darts_of_involution_inv_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_involution_inv_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_involution_inv_basic_const_range<i,dim>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i>
|
||||
Dart_of_involution_inv_basic_range<i,Self::dimension>
|
||||
darts_of_involution_inv_basic(Dart_handle adart, size_type amark=MARK_ERROR)
|
||||
darts_of_involution_inv_basic(Dart_handle adart, size_type amark=INVALID_MARK)
|
||||
{ return Dart_of_involution_inv_basic_range<i,Self::dimension>
|
||||
(*this,adart,amark); }
|
||||
//--------------------------------------------------------------------------
|
||||
template<unsigned int i>
|
||||
Dart_of_involution_inv_basic_const_range<i,Self::dimension>
|
||||
darts_of_involution_inv_basic(Dart_const_handle adart, size_type amark=MARK_ERROR) const
|
||||
darts_of_involution_inv_basic(Dart_const_handle adart, size_type amark=INVALID_MARK) const
|
||||
{ return Dart_of_involution_inv_basic_const_range<i,Self::dimension>
|
||||
(*this,adart,amark); }
|
||||
//**************************************************************************
|
||||
|
|
|
|||
|
|
@ -270,25 +270,8 @@ namespace CGAL
|
|||
typename Map::size_type nbIncident = 0;
|
||||
typename Map::size_type mark;
|
||||
typename Map::size_type treated;
|
||||
// CGAL_assume(mark != -1); CGAL_assume( treated != -1);
|
||||
try
|
||||
{
|
||||
mark = amap.get_new_mark();
|
||||
}
|
||||
catch (typename Map::Exception_mark_is_out_of_border e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
try
|
||||
{
|
||||
treated = amap.get_new_mark();
|
||||
}
|
||||
catch (typename Map::Exception_mark_is_out_of_border e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
mark = amap.get_new_mark();
|
||||
treated = amap.get_new_mark();
|
||||
|
||||
typename Map::template
|
||||
Dart_of_cell_basic_range<i>::const_iterator it(amap, adart, mark);
|
||||
|
|
@ -336,25 +319,8 @@ namespace CGAL
|
|||
typename Map::size_type nbIncident = 0;
|
||||
typename Map::size_type mark;
|
||||
typename Map::size_type treated;
|
||||
// CGAL_assume(mark != -1); CGAL_assume( treated != -1);
|
||||
try
|
||||
{
|
||||
mark = amap.get_new_mark();
|
||||
}
|
||||
catch (typename Map::Exception_mark_is_out_of_border e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
try
|
||||
{
|
||||
treated = amap.get_new_mark();
|
||||
}
|
||||
catch (typename Map::Exception_mark_is_out_of_border e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
mark = amap.get_new_mark();
|
||||
treated = amap.get_new_mark();
|
||||
|
||||
typename Map::template
|
||||
Dart_of_cell_basic_range<i>::const_iterator it(amap, adart, mark);
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ namespace CGAL {
|
|||
/// Rewind of the iterator to its beginning.
|
||||
void rewind()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
Base::operator= ( Base(*this->mmap,minitial_dart) );
|
||||
mto_treat = std::queue<Dart_handle>();
|
||||
this->mmap->mark(minitial_dart, mmark_number);
|
||||
|
|
@ -246,7 +246,7 @@ namespace CGAL {
|
|||
/// Prefix ++ operator.
|
||||
Self& operator++()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
CGAL_assertion(this->cont());
|
||||
|
||||
do
|
||||
|
|
@ -342,7 +342,7 @@ namespace CGAL {
|
|||
/// Rewind of the iterator to its beginning.
|
||||
void rewind()
|
||||
{
|
||||
CGAL_assertion(this->mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(this->mmark_number != Map::INVALID_MARK);
|
||||
Base::rewind();
|
||||
if ( !this->mmap->is_free(this->minitial_dart, Bi) &&
|
||||
this->mmap->beta(this->minitial_dart, Bi)!=this->minitial_dart )
|
||||
|
|
@ -412,12 +412,12 @@ namespace CGAL {
|
|||
/// Destructor.
|
||||
~CMap_non_basic_iterator()
|
||||
{
|
||||
CGAL_assertion( this->mmark_number!=Map::MARK_ERROR );
|
||||
CGAL_assertion( this->mmark_number!=Map::INVALID_MARK );
|
||||
if (this->mmap->get_number_of_times_mark_reserved
|
||||
(this->mmark_number)==1)
|
||||
unmark_treated_darts();
|
||||
this->mmap->free_mark(this->mmark_number);
|
||||
this->mmark_number = Map::MARK_ERROR; // To avoid basic class to try to unmark darts.
|
||||
this->mmark_number = Map::INVALID_MARK; // To avoid basic class to try to unmark darts.
|
||||
}
|
||||
|
||||
/// Copy constructor.
|
||||
|
|
@ -434,7 +434,7 @@ namespace CGAL {
|
|||
(this->mmark_number)==1)
|
||||
unmark_treated_darts();
|
||||
this->mmap->free_mark(this->mmark_number);
|
||||
this->mmark_number = Map::MARK_ERROR;
|
||||
this->mmark_number = Map::INVALID_MARK;
|
||||
|
||||
Base::operator=(aiterator);
|
||||
this->mmap->share_a_mark(this->mmark_number);
|
||||
|
|
@ -533,7 +533,7 @@ namespace CGAL {
|
|||
|
||||
typedef typename Map_::size_type size_type;
|
||||
|
||||
CMap_range(Map_ &amap, typename Map_::Dart_handle adart, size_type amark=Map_::MARK_ERROR):
|
||||
CMap_range(Map_ &amap, typename Map_::Dart_handle adart, size_type amark=Map_::INVALID_MARK):
|
||||
mmap(amap), mdart(adart), msize(0), mmark(amark)
|
||||
{}
|
||||
iterator begin() { return iterator(mmap,mdart,mmark); }
|
||||
|
|
@ -588,7 +588,7 @@ namespace CGAL {
|
|||
typedef Const_it const_iterator;
|
||||
typedef typename Map_::size_type size_type;
|
||||
CMap_const_range(const Map_ &amap, typename Map_::Dart_const_handle adart,
|
||||
size_type amark=Map_::MARK_ERROR):
|
||||
size_type amark=Map_::INVALID_MARK):
|
||||
mmap(amap), mdart(adart), msize(0), mmark(amark)
|
||||
{}
|
||||
const_iterator begin() const { return const_iterator(mmap,mdart,mmark); }
|
||||
|
|
@ -607,7 +607,7 @@ namespace CGAL {
|
|||
const Map_ & mmap;
|
||||
typename Map_::Dart_const_handle mdart;
|
||||
mutable typename Map_::size_type msize;
|
||||
int mmark;
|
||||
size_type mmark;
|
||||
};
|
||||
//****************************************************************************
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -356,7 +356,6 @@ namespace CGAL
|
|||
typename CMap::Dart_handle dg1=amap.null_handle, dg2=amap.null_handle;
|
||||
|
||||
typename CMap::size_type mark = amap.get_new_mark();
|
||||
// int mark_modified_darts = amap.get_new_mark();
|
||||
|
||||
// First we store and mark all the darts of the 0-cell to remove.
|
||||
std::deque<typename CMap::Dart_handle> to_erase;
|
||||
|
|
@ -700,7 +699,6 @@ namespace CGAL
|
|||
typename CMap::Dart_handle dg1=amap.null_handle, dg2=amap.null_handle;
|
||||
|
||||
typename CMap::size_type mark = amap.get_new_mark();
|
||||
// int mark_modified_darts = amap.get_new_mark();
|
||||
|
||||
// First we store and mark all the darts of the 1-cell to contract.
|
||||
std::deque<typename CMap::Dart_handle> to_erase;
|
||||
|
|
|
|||
|
|
@ -1203,7 +1203,7 @@ namespace CGAL {
|
|||
/// Rewind of the iterator to its beginning.
|
||||
void rewind()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
Base::rewind();
|
||||
mto_treat = std::queue<Dart_handle>();
|
||||
this->mmap->mark(*this, mmark_number);
|
||||
|
|
@ -1213,7 +1213,7 @@ namespace CGAL {
|
|||
/// Prefix ++ operator.
|
||||
Self& operator++()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
CGAL_assertion(this->cont());
|
||||
Dart_handle nd = this->mmap->null_handle;
|
||||
|
||||
|
|
@ -1315,7 +1315,7 @@ namespace CGAL {
|
|||
/// Rewind of the iterator to its beginning.
|
||||
void rewind()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
Base::rewind();
|
||||
mto_treat = std::queue<Dart_handle>();
|
||||
this->mmap->mark((*this), mmark_number);
|
||||
|
|
@ -1325,7 +1325,7 @@ namespace CGAL {
|
|||
/// Prefix ++ operator.
|
||||
Self& operator++()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
CGAL_assertion(this->cont());
|
||||
|
||||
Dart_handle nd = this->mmap->null_handle;
|
||||
|
|
@ -1411,7 +1411,7 @@ namespace CGAL {
|
|||
/// Rewind of the iterator to its beginning.
|
||||
void rewind()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
Base::rewind();
|
||||
mto_treat = std::queue<Dart_handle>();
|
||||
this->mmap->mark((*this), mmark_number);
|
||||
|
|
@ -1421,7 +1421,7 @@ namespace CGAL {
|
|||
/// Prefix ++ operator.
|
||||
Self& operator++()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
CGAL_assertion(this->cont());
|
||||
|
||||
Dart_handle nd = this->mmap->null_handle;
|
||||
|
|
@ -1939,7 +1939,7 @@ namespace CGAL {
|
|||
/// Rewind of the iterator to its beginning.
|
||||
void rewind()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
Base::rewind();
|
||||
mto_treat = std::queue<Dart_handle>();
|
||||
this->mmap->mark((*this), mmark_number);
|
||||
|
|
@ -1949,7 +1949,7 @@ namespace CGAL {
|
|||
/// Prefix ++ operator.
|
||||
Self& operator++()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
CGAL_assertion(this->cont());
|
||||
|
||||
Dart_handle nd = this->mmap->null_handle;
|
||||
|
|
@ -2061,7 +2061,7 @@ namespace CGAL {
|
|||
/// Rewind of the iterator to its beginning.
|
||||
void rewind()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
Base::rewind();
|
||||
mto_treat = std::queue<Dart_handle>();
|
||||
this->mmap->mark((*this), mmark_number);
|
||||
|
|
@ -2071,7 +2071,7 @@ namespace CGAL {
|
|||
/// Prefix ++ operator.
|
||||
Self& operator++()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
CGAL_assertion(this->cont());
|
||||
|
||||
Dart_handle nd = this->mmap->null_handle;
|
||||
|
|
@ -2178,7 +2178,7 @@ namespace CGAL {
|
|||
/// Rewind of the iterator to its beginning.
|
||||
void rewind()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
Base::rewind();
|
||||
mto_treat = std::queue<Dart_handle>();
|
||||
this->mmap->mark_null_dart(mmark_number);
|
||||
|
|
@ -2188,7 +2188,7 @@ namespace CGAL {
|
|||
/// Prefix ++ operator.
|
||||
Self& operator++()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
CGAL_assertion(this->cont());
|
||||
|
||||
Dart_handle nd = this->mmap->null_handle;
|
||||
|
|
@ -2305,7 +2305,7 @@ namespace CGAL {
|
|||
/// Rewind of the iterator to its beginning.
|
||||
void rewind()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
Base::rewind();
|
||||
mto_treat = std::queue<Dart_handle>();
|
||||
this->mmap->mark((*this), mmark_number);
|
||||
|
|
@ -2315,7 +2315,7 @@ namespace CGAL {
|
|||
/// Prefix ++ operator.
|
||||
Self& operator++()
|
||||
{
|
||||
CGAL_assertion(mmark_number != Map::MARK_ERROR);
|
||||
CGAL_assertion(mmark_number != Map::INVALID_MARK);
|
||||
CGAL_assertion(this->cont());
|
||||
|
||||
Dart_handle nd = this->mmap->null_handle;
|
||||
|
|
|
|||
|
|
@ -580,7 +580,7 @@ struct Test_split_attribute_functor_run
|
|||
static void run( CMap* amap,
|
||||
const std::deque<typename CMap::Dart_handle>
|
||||
&modified_darts,
|
||||
typename CMap::size_type mark_modified_darts=CMap::MARK_ERROR)
|
||||
typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK)
|
||||
{
|
||||
CGAL_static_assertion( 1<=i && i<=CMap::dimension );
|
||||
CGAL_assertion( i!=j );
|
||||
|
|
@ -609,7 +609,7 @@ struct Test_split_attribute_functor_run
|
|||
amap->negate_mark(mark);
|
||||
for ( it=modified_darts.begin(); it!=modified_darts.end(); ++it )
|
||||
{
|
||||
if ( mark_modified_darts!=CMap::MARK_ERROR )
|
||||
if ( mark_modified_darts!=CMap::INVALID_MARK )
|
||||
amap->unmark(*it, mark_modified_darts);
|
||||
|
||||
if ( !amap->is_marked(*it, mark) )
|
||||
|
|
@ -624,7 +624,7 @@ struct Test_split_attribute_functor_run
|
|||
&modified_darts,
|
||||
const std::deque<typename CMap::Dart_handle>
|
||||
&modified_darts2,
|
||||
typename CMap::size_type mark_modified_darts=CMap::MARK_ERROR)
|
||||
typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK)
|
||||
{
|
||||
CGAL_static_assertion( 1<=i && i<=CMap::dimension );
|
||||
CGAL_assertion( i!=j );
|
||||
|
|
@ -660,7 +660,7 @@ struct Test_split_attribute_functor_run
|
|||
amap->negate_mark(mark);
|
||||
for ( it=modified_darts.begin(); it!=modified_darts.end(); ++it )
|
||||
{
|
||||
if ( mark_modified_darts!=CMap::MARK_ERROR )
|
||||
if ( mark_modified_darts!=CMap::INVALID_MARK )
|
||||
amap->unmark(*it, mark_modified_darts);
|
||||
|
||||
if ( !amap->is_marked(*it, mark) )
|
||||
|
|
@ -668,7 +668,7 @@ struct Test_split_attribute_functor_run
|
|||
}
|
||||
for ( it2=modified_darts2.begin(); it2!=modified_darts2.end(); ++it2 )
|
||||
{
|
||||
if ( mark_modified_darts!=CMap::MARK_ERROR )
|
||||
if ( mark_modified_darts!=CMap::INVALID_MARK )
|
||||
amap->unmark(*it2, mark_modified_darts);
|
||||
|
||||
if ( !amap->is_marked(*it2, mark) )
|
||||
|
|
@ -686,7 +686,7 @@ struct Test_split_attribute_functor_run<CMap, 0, j, T>
|
|||
static void run( CMap* amap,
|
||||
const std::deque<typename CMap::Dart_handle>
|
||||
&modified_darts,
|
||||
typename CMap::size_type mark_modified_darts=CMap::MARK_ERROR)
|
||||
typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK)
|
||||
{
|
||||
CGAL_assertion( j!=0 && j!=1 );
|
||||
CGAL_assertion( amap!=NULL );
|
||||
|
|
@ -720,7 +720,7 @@ struct Test_split_attribute_functor_run<CMap, 0, j, T>
|
|||
amap->negate_mark(mark);
|
||||
for ( it=modified_darts.begin(); it!=modified_darts.end(); ++it )
|
||||
{
|
||||
if ( mark_modified_darts!=CMap::MARK_ERROR )
|
||||
if ( mark_modified_darts!=CMap::INVALID_MARK )
|
||||
amap->unmark(*it, mark_modified_darts);
|
||||
|
||||
if ( !amap->is_marked(*it, mark) )
|
||||
|
|
@ -739,7 +739,7 @@ struct Test_split_attribute_functor_run<CMap, 0, j, T>
|
|||
&modified_darts,
|
||||
const std::deque<typename CMap::Dart_handle>
|
||||
&modified_darts2,
|
||||
typename CMap::size_type mark_modified_darts=CMap::MARK_ERROR)
|
||||
typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK)
|
||||
{
|
||||
CGAL_assertion( j!=0 && j!=1 );
|
||||
CGAL_assertion( amap!=NULL );
|
||||
|
|
@ -785,7 +785,7 @@ struct Test_split_attribute_functor_run<CMap, 0, j, T>
|
|||
amap->negate_mark(mark);
|
||||
for ( it=modified_darts.begin(); it!=modified_darts.end(); ++it )
|
||||
{
|
||||
if ( mark_modified_darts!=CMap::MARK_ERROR )
|
||||
if ( mark_modified_darts!=CMap::INVALID_MARK )
|
||||
amap->unmark(*it, mark_modified_darts);
|
||||
|
||||
if ( !amap->is_marked(*it, mark) )
|
||||
|
|
@ -797,7 +797,7 @@ struct Test_split_attribute_functor_run<CMap, 0, j, T>
|
|||
}
|
||||
for ( it2=modified_darts2.begin(); it2!=modified_darts2.end(); ++it2 )
|
||||
{
|
||||
if ( mark_modified_darts!=CMap::MARK_ERROR )
|
||||
if ( mark_modified_darts!=CMap::INVALID_MARK )
|
||||
amap->unmark(*it2, mark_modified_darts);
|
||||
|
||||
if ( !amap->is_marked(*it2, mark) )
|
||||
|
|
@ -820,14 +820,14 @@ template<typename CMap, typename T>
|
|||
struct Test_split_attribute_functor_run<CMap, 0, 0, T>
|
||||
{
|
||||
static void run( CMap*, const std::deque<typename CMap::Dart_handle>&,
|
||||
typename CMap::size_type =CMap::MARK_ERROR)
|
||||
typename CMap::size_type =CMap::INVALID_MARK)
|
||||
{ CGAL_assertion(false); }
|
||||
static void run( CMap* amap,
|
||||
const std::deque<typename CMap::Dart_handle>
|
||||
&modified_darts,
|
||||
const std::deque<typename CMap::Dart_handle>
|
||||
&modified_darts2,
|
||||
typename CMap::size_type mark_modified_darts=CMap::MARK_ERROR)
|
||||
typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK)
|
||||
{
|
||||
CGAL_assertion( amap!=NULL );
|
||||
CGAL_static_assertion_msg(CMap::Helper::template
|
||||
|
|
@ -864,7 +864,7 @@ struct Test_split_attribute_functor_run<CMap, 0, 0, T>
|
|||
amap->negate_mark(mark);
|
||||
for ( it=modified_darts.begin(); it!=modified_darts.end(); ++it )
|
||||
{
|
||||
if ( mark_modified_darts!=CMap::MARK_ERROR )
|
||||
if ( mark_modified_darts!=CMap::INVALID_MARK )
|
||||
amap->unmark(*it, mark_modified_darts);
|
||||
|
||||
if ( !amap->is_marked(*it, mark) )
|
||||
|
|
@ -872,7 +872,7 @@ struct Test_split_attribute_functor_run<CMap, 0, 0, T>
|
|||
}
|
||||
for ( it2=modified_darts2.begin(); it2!=modified_darts2.end(); ++it2 )
|
||||
{
|
||||
if ( mark_modified_darts!=CMap::MARK_ERROR )
|
||||
if ( mark_modified_darts!=CMap::INVALID_MARK )
|
||||
amap->unmark(*it2, mark_modified_darts);
|
||||
|
||||
od=amap->other_extremity(*it2);
|
||||
|
|
@ -890,12 +890,12 @@ template<typename CMap, typename T>
|
|||
struct Test_split_attribute_functor_run<CMap, 0, 1, T>
|
||||
{
|
||||
static void run( CMap*, const std::deque<typename CMap::Dart_handle>&,
|
||||
typename CMap::size_type =CMap::MARK_ERROR)
|
||||
typename CMap::size_type =CMap::INVALID_MARK)
|
||||
{ CGAL_assertion(false); }
|
||||
static void run( CMap* amap, const std::deque<typename CMap::Dart_handle>&
|
||||
modified_darts,
|
||||
const std::deque<typename CMap::Dart_handle>&
|
||||
modified_darts2, typename CMap::size_type mark_modified_darts=CMap::MARK_ERROR)
|
||||
modified_darts2, typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK)
|
||||
{ CGAL::internal::Test_split_attribute_functor_run<CMap, 0, 0, T>::
|
||||
run(amap, modified_darts, modified_darts2, mark_modified_darts); }
|
||||
};
|
||||
|
|
@ -904,10 +904,10 @@ template<typename CMap, unsigned int i, unsigned int j>
|
|||
struct Test_split_attribute_functor_run<CMap, i, j, CGAL::Void>
|
||||
{
|
||||
static void run( CMap*, const std::deque<typename CMap::Dart_handle>&,
|
||||
typename CMap::size_type=CMap::MARK_ERROR)
|
||||
typename CMap::size_type=CMap::INVALID_MARK)
|
||||
{}
|
||||
static void run( CMap*, const std::deque<typename CMap::Dart_handle>&,
|
||||
const std::deque<typename CMap::Dart_handle>&, typename CMap::size_type=CMap::MARK_ERROR)
|
||||
const std::deque<typename CMap::Dart_handle>&, typename CMap::size_type=CMap::INVALID_MARK)
|
||||
{}
|
||||
};
|
||||
// Specialization for i=j.
|
||||
|
|
@ -915,10 +915,10 @@ template<typename CMap, unsigned int i, typename T>
|
|||
struct Test_split_attribute_functor_run<CMap, i, i, T>
|
||||
{
|
||||
static void run( CMap*, const std::deque<typename CMap::Dart_handle>&,
|
||||
typename CMap::size_type=CMap::MARK_ERROR)
|
||||
typename CMap::size_type=CMap::INVALID_MARK)
|
||||
{}
|
||||
static void run( CMap*, const std::deque<typename CMap::Dart_handle>&,
|
||||
const std::deque<typename CMap::Dart_handle>&, typename CMap::size_type=CMap::MARK_ERROR)
|
||||
const std::deque<typename CMap::Dart_handle>&, typename CMap::size_type=CMap::INVALID_MARK)
|
||||
{}
|
||||
};
|
||||
// Specialization for i=1 and j=0 (edge attributes are not modified
|
||||
|
|
@ -927,10 +927,10 @@ template<typename CMap, typename T>
|
|||
struct Test_split_attribute_functor_run<CMap, 1, 0, T>
|
||||
{
|
||||
static void run( CMap*, const std::deque<typename CMap::Dart_handle>&,
|
||||
typename CMap::size_type=CMap::MARK_ERROR)
|
||||
typename CMap::size_type=CMap::INVALID_MARK)
|
||||
{}
|
||||
static void run( CMap*, const std::deque<typename CMap::Dart_handle>&,
|
||||
const std::deque<typename CMap::Dart_handle>&, typename CMap::size_type=CMap::MARK_ERROR)
|
||||
const std::deque<typename CMap::Dart_handle>&, typename CMap::size_type=CMap::INVALID_MARK)
|
||||
{}
|
||||
};
|
||||
// ************************************************************************
|
||||
|
|
@ -949,7 +949,7 @@ struct Test_split_attribute_functor
|
|||
static void run( CMap* amap,
|
||||
const std::deque<typename CMap::Dart_handle>
|
||||
&modified_darts,
|
||||
typename CMap::size_type mark_modified_darts=CMap::MARK_ERROR)
|
||||
typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK)
|
||||
{
|
||||
CGAL::internal::Test_split_attribute_functor_run<CMap, i, j>::
|
||||
run(amap, modified_darts, mark_modified_darts);
|
||||
|
|
@ -960,7 +960,7 @@ struct Test_split_attribute_functor
|
|||
&modified_darts,
|
||||
const std::deque<typename CMap::Dart_handle>
|
||||
&modified_darts2,
|
||||
typename CMap::size_type mark_modified_darts=CMap::MARK_ERROR)
|
||||
typename CMap::size_type mark_modified_darts=CMap::INVALID_MARK)
|
||||
{
|
||||
CGAL::internal::Test_split_attribute_functor_run<CMap, i, j>::
|
||||
run(amap, modified_darts, modified_darts2, mark_modified_darts);
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ struct Count_cell_functor
|
|||
std::vector<size_type>* amarks,
|
||||
std::vector<unsigned int>* ares )
|
||||
{
|
||||
if ( (*amarks)[i]!=CMap::MARK_ERROR && !amap->is_marked(adart, (*amarks)[i]) )
|
||||
if ( (*amarks)[i]!=CMap::INVALID_MARK && !amap->is_marked(adart, (*amarks)[i]) )
|
||||
{
|
||||
++ (*ares)[i];
|
||||
CGAL::mark_cell<CMap,i>(*amap, adart, (*amarks)[i]);
|
||||
|
|
|
|||
|
|
@ -132,8 +132,65 @@ typedef CGAL::Combinatorial_map<4, Map_dart_items_4> Map8;
|
|||
|
||||
typedef CGAL::Combinatorial_map<4, Map_dart_max_items_4> Map9;
|
||||
|
||||
bool test_get_new_mark()
|
||||
{
|
||||
cout << "***************************** TEST GET_NEW_MARK:"
|
||||
<< endl;
|
||||
|
||||
bool res = false;
|
||||
|
||||
Map1 map;
|
||||
|
||||
Map1::size_type marks[Map1::NB_MARKS];
|
||||
for (unsigned int i=0; i<Map1::NB_MARKS; ++i)
|
||||
{
|
||||
try
|
||||
{
|
||||
marks[i] = map.get_new_mark();
|
||||
}
|
||||
catch (Map1::Exception_no_more_available_mark e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
cout << "Creation of NB_MARK marks: OK"
|
||||
<< endl;
|
||||
|
||||
Map1::size_type mark;
|
||||
try
|
||||
{
|
||||
mark = map.get_new_mark();
|
||||
}
|
||||
catch (Map1::Exception_no_more_available_mark e)
|
||||
{
|
||||
std::cerr<<"The creation of an additional mark throw an exception: OK"<<std::endl;
|
||||
res = true;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
map.free_mark(mark);
|
||||
}
|
||||
|
||||
for (unsigned int i=0; i<Map1::NB_MARKS; ++i)
|
||||
{
|
||||
map.free_mark(marks[i]);
|
||||
}
|
||||
|
||||
cout << "***************************** TEST GET_NEW_MARK DONE"
|
||||
<< endl;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
if ( !test_get_new_mark() )
|
||||
{
|
||||
std::cout<<"ERROR during test_get_new_mark."<<std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if ( !test2D<Map1>() )
|
||||
{
|
||||
std::cout<<"ERROR during test2D<Map1>."<<std::endl;
|
||||
|
|
|
|||
|
|
@ -420,16 +420,6 @@ namespace CGAL {
|
|||
|
||||
std::map<Point, std::vector<Dart_handle> > one_dart_per_facet;
|
||||
size_type mymark;
|
||||
// CGAL_assertion( mymark!=-1 );
|
||||
try
|
||||
{
|
||||
mymark = this->get_new_mark();
|
||||
}
|
||||
catch (typename Base::Exception_mark_is_out_of_border e)
|
||||
{
|
||||
std::cerr<<"No more free mark, exit."<<std::endl;
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// First we fill the std::map by one dart per facet, and by using
|
||||
// the minimal point as index.
|
||||
|
|
|
|||
Loading…
Reference in New Issue