cgal
cgal copied to clipboard
Inconsistent base type and self type using Linear Cell Complex with cell attribute with point and id, when Info_!=void
Issue Details
The typedef Self and Base1 in the class Cell_attribute_with_point are wrongly declared.
Using a Linear Cell Complex with cell attribute with point and id, when Info_!=void:
Cell_attribute_with_point.h:108:18: error: type ‘CGAL::Cell_attribute_with_point<CGAL::CMap_linear_cell_complex_storage_with_index<2, 2, CGAL::Linear_cell_complex_traits<2, CGAL::Epick>, dartItem, std::allocator<int> >, std::vector<double>, CGAL::Boolean_tag<true>, CGAL::Null_functor, CGAL::Null_functor, CGAL::Boolean_tag<true> >::Base1’ {aka ‘CGAL::Cell_attribute<CGAL::CMap_linear_cell_complex_storage_with_index<2, 2, CGAL::Linear_cell_complex_traits<2, CGAL::Epick>, dartItem, std::allocator<int> >, std::vector<double>, CGAL::Boolean_tag<true>, CGAL::Null_functor, CGAL::Null_functor, CGAL::Boolean_tag<false> >’} is not a base type for type ‘CGAL::Cell_attribute_with_point<CGAL::CMap_linear_cell_complex_storage_with_index<2, 2, CGAL::Linear_cell_complex_traits<2, CGAL::Epick>, dartItem, std::allocator<int> >, std::vector<double>, CGAL::Boolean_tag<true>, CGAL::Null_functor, CGAL::Null_functor, CGAL::Boolean_tag<true> >’
108 | using Base1::info;
| ^~~~
Source Code
struct dartItem
{
using Use_index=CGAL::Tag_true; // use indices
using Index_type=std::size_t;
template<class Refs>
struct Dart_wrapper
{
using Vertex_attribute = CGAL::Cell_attribute_with_point_and_id<Refs, std::vector<double>, CGAL::Tag_true>;
using Edge_attribute = CGAL::Cell_attribute_with_point_and_id<Refs, std::vector<double>, CGAL::Tag_true>;
using Facet_attribute = CGAL::Cell_attribute_with_point_and_id<Refs, std::vector<double>, CGAL::Tag_true>;
using Attributes = std::tuple<Vertex_attribute, Edge_attribute, Facet_attribute>;
};
};
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using cgalLCCTraits = CGAL::Linear_cell_complex_traits<2, Kernel> ;
using LCC_2 = CGAL::Linear_cell_complex_for_generalized_map<2, 2, cgalLCCTraits, dartItem>;
int main(){
LCC_2 t_lcc2;
}
Solution
Change the typedef
typedef Cell_attribute_with_point<LCC, Info_, Tag, Functor_on_merge_,
Functor_on_split_> Self;
typedef Cell_attribute<LCC, Info_, Tag,
Functor_on_merge_, Functor_on_split_> Base1;
to
typedef Cell_attribute_with_point<LCC, Info_, Tag, Functor_on_merge_,
Functor_on_split_, WithID> Self;
typedef Cell_attribute<LCC, Info_, Tag,
Functor_on_merge_, Functor_on_split_, WithID> Base1;
Thanks @petlenz for the issue. This is solved in https://github.com/CGAL/cgal/pull/8257.
Thanks for the fast response @gdamiand Unfortunately, I ran into a few more issues when using the same setup in combination with the linear cell complex incremental builder. Maybe you can have a look at #8255
I am on it.