Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent base type and self type using Linear Cell Complex with cell attribute with point and id, when Info_!=void #8251

Open
petlenz opened this issue Jun 4, 2024 · 3 comments · Fixed by #8257

Comments

@petlenz
Copy link

petlenz commented Jun 4, 2024

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;
@gdamiand
Copy link
Member

gdamiand commented Jun 5, 2024

Thanks @petlenz for the issue. This is solved in #8257.

@petlenz
Copy link
Author

petlenz commented Jun 5, 2024

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

@gdamiand
Copy link
Member

gdamiand commented Jun 5, 2024

I am on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants