Skip to content

Commit

Permalink
Merge pull request #7752 from gdamiand/CMap_with_index-add_missing_fu…
Browse files Browse the repository at this point in the history
…nctions-gdamiand

Add missing functions capacity and upper bound in dart_range for cmap and lcc with index
  • Loading branch information
lrineau committed Oct 16, 2023
2 parents 78ace77 + 3e632ec commit 0bf60c9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ namespace CGAL {
{ return mmap.mdarts.is_used(i); }
bool owns(size_type i) const
{ return mmap.mdarts.owns(i); }
size_type capacity() const
{ return mmap.mdarts.capacity(); }
size_type upper_bound() const
{ return mmap.mdarts.upper_bound(); }
private:
Self & mmap;
};
Expand Down Expand Up @@ -444,7 +448,7 @@ namespace CGAL {
(mattribute_containers).upper_bound();
}

protected:
protected:
// Set the handle on the i th attribute
template<unsigned int i>
void basic_set_dart_attribute(Dart_descriptor dh,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ namespace CGAL {
{};
template<int i>
struct Attribute_const_descriptor:
public Helper::template Attribute_const_descriptor<i>
public Helper::template Attribute_const_descriptor<i>
{};
template<int i>
struct Attribute_range: public Helper::template Attribute_range<i>
{};
template<int i>
struct Attribute_const_range:
public Helper::template Attribute_const_range<i>
public Helper::template Attribute_const_range<i>
{};

typedef typename Attribute_type<0>::type Vertex_attribute;
Expand Down Expand Up @@ -169,6 +169,10 @@ namespace CGAL {
{ return mmap.mdarts.is_used(i); }
bool owns(size_type i) const
{ return mmap.mdarts.owns(i); }
size_type capacity() const
{ return mmap.mdarts.capacity(); }
size_type upper_bound() const
{ return mmap.mdarts.upper_bound(); }
private:
Self & mmap;
};
Expand Down Expand Up @@ -202,7 +206,7 @@ namespace CGAL {
* @return true iff the map is empty.
*/
bool is_empty() const
{ return darts().empty(); }
{ return darts().empty(); }

/// @return the number of darts.
size_type number_of_darts() const
Expand Down Expand Up @@ -288,18 +292,18 @@ namespace CGAL {
typename Attribute_descriptor<i>::type attribute(Dart_descriptor ADart)
{
static_assert(Helper::template Dimension_index<i>::value>=0,
"attribute<i> called but i-attributes are disabled.");
"attribute<i> called but i-attributes are disabled.");
return std::get<Helper::template Dimension_index<i>::value>
(mdarts[ADart].mattribute_descriptors);
(mdarts[ADart].mattribute_descriptors);
}
template<unsigned int i>
typename Attribute_const_descriptor<i>::type
attribute(Dart_const_descriptor ADart) const
{
static_assert(Helper::template Dimension_index<i>::value>=0,
"attribute<i> called but i-attributes are disabled.");
"attribute<i> called but i-attributes are disabled.");
return std::get<Helper::template Dimension_index<i>::value>
(mdarts[ADart].mattribute_descriptors);
(mdarts[ADart].mattribute_descriptors);
}

// Copy a given attribute
Expand Down Expand Up @@ -360,15 +364,15 @@ namespace CGAL {
{
CGAL_assertion( ah!=null_descriptor );
return std::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah];
(mattribute_containers)[ah];
}
template<unsigned int i>
const typename Attribute_type<i>::type&
get_attribute(typename Attribute_const_descriptor<i>::type ah) const
{
CGAL_assertion( ah!=null_descriptor );
return std::get<Helper::template Dimension_index<i>::value>
(mattribute_containers)[ah];
(mattribute_containers)[ah];
}

// Get the dart of the given attribute
Expand Down Expand Up @@ -486,14 +490,14 @@ namespace CGAL {
typename Attribute_descriptor<i>::type ah)
{
std::get<Helper::template Dimension_index<i>::value>
(mdarts[dh].mattribute_descriptors) = ah;
(mdarts[dh].mattribute_descriptors) = ah;
}

/** Link a dart with a given dart for a given dimension.
* @param adart the dart to link.
* @param adart2 the dart to link with.
* @param i the dimension.
*/
* @param adart the dart to link.
* @param adart2 the dart to link with.
* @param i the dimension.
*/
template<unsigned int i>
void dart_link_beta(Dart_descriptor adart, Dart_descriptor adart2)
{
Expand All @@ -509,9 +513,9 @@ namespace CGAL {
}

/** Unlink a dart for a given dimension.
* @param adart a dart.
* @param i the dimension.
*/
* @param adart a dart.
* @param i the dimension.
*/
template<unsigned int i>
void dart_unlink_beta(Dart_descriptor adart)
{
Expand Down

0 comments on commit 0bf60c9

Please sign in to comment.