Lazy_cartesian is an independent layer

This commit is contained in:
Marc Glisse 2011-05-20 15:58:28 +00:00
parent ef27c36545
commit 32fecea31f
3 changed files with 11 additions and 6 deletions

View File

@ -3,20 +3,22 @@
#include <CGAL/basic.h>
#include <CGAL/Lazy.h>
#include <CGAL/Default.h>
#include <CGAL/Filtered_predicate.h>
#include <CGAL/iterator_from_indices.h>
namespace CGAL {
//TODO: ? use Lazy_cartesian instead of Kernel ?
template <class EK_, class AK_, class E2A_, class Kernel>
template <class EK_, class AK_, class E2A_/*, class Kernel_=Default*/>
struct Lazy_cartesian : Dimension_base<typename EK_::Default_ambient_dimension>
{
//CGAL_CONSTEXPR Lazy_cartesian(){}
//CGAL_CONSTEXPR Lazy_cartesian(int d):Base_(d){}
//TODO: store an AK and an EK
typedef Lazy_cartesian<EK_,AK_,E2A_,Kernel> Self;
typedef Lazy_cartesian<EK_,AK_,E2A_/*,Kernel_*/> Self;
//typedef typename Default::Get<Kernel_,Self>::type Kernel;
typedef Self Kernel;
typedef AK_ Approximate_kernel;
typedef EK_ Exact_kernel;
typedef E2A_ E2A;

View File

@ -36,7 +36,7 @@ struct Store_kernel<R_,false> {
Store_kernel(R_ const& r):rp(&r){}
enum { kernel_is_stored = true };
R_ const& kernel()const{
CGAL_warning_msg(rp==0,"I should know my kernel"); }
CGAL_warning_msg(rp==0,"I should know my kernel");
return *rp;
}
typedef R_ const& reference_type;
@ -62,7 +62,10 @@ struct Store_kernel2<R_,false> {
}
Store_kernel2(R_ const& r):rp(&r){}
enum { kernel2_is_stored = true };
R_ const& kernel2()const{return *rp;}
R_ const& kernel2()const{
CGAL_warning_msg(rp==0,"I should know my kernel");
return *rp;
}
typedef R_ const& reference2_type;
void set_kernel2(R_ const&r){rp=&r;}
private:

View File

@ -39,7 +39,7 @@ typedef CGAL::Cartesian_filter_NT<K0> K2;
#elif 0
typedef CGAL::Cartesian_filter_K<K0,KA,KE> K2;
#elif 1
struct K2: CGAL::Lazy_cartesian<KE,KA,CGAL::CartesianD_converter<KE,KA>,K2>{};
typedef CGAL::Lazy_cartesian<KE,KA,CGAL::CartesianD_converter<KE,KA> > K2;
#endif
#if 0
typedef K2 K1;