From 8e3454d5976bce865cda548ea689e467a6ab6ce3 Mon Sep 17 00:00:00 2001 From: Menelaos Karavelas Date: Thu, 21 Aug 2003 16:10:18 +0000 Subject: [PATCH] moved the filtered traits class to a separate file --- .../CGAL/Apollonius_graph_filtered_traits_2.h | 348 ++++++++++++++++++ .../include/CGAL/Apollonius_graph_traits_2.h | 307 +-------------- 2 files changed, 354 insertions(+), 301 deletions(-) create mode 100644 Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h diff --git a/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h new file mode 100644 index 00000000000..c5adcc051fa --- /dev/null +++ b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_filtered_traits_2.h @@ -0,0 +1,348 @@ +// ====================================================================== +// +// Copyright (c) 2003 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : +// +// file : include/CGAL/Apollonius_graph_filtered_traits_2.h +// package : Apollonius_graph_2 +// source : $RCSfile$ +// revision : $Revision$ +// revision_date : $Date$ +// author(s) : Menelaos Karavelas +// +// coordinator : +// +// ====================================================================== + + + +#ifndef CGAL_APOLLONIUS_GRAPH_FILTERED_TRAITS_2_H +#define CGAL_APOLLONIUS_GRAPH_FILTERED_TRAITS_2_H + + +#include + +#include + +// includes for the default parameters of the filtered traits +#include +#include +#include +#include +#include + +CGAL_BEGIN_NAMESPACE + + +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +// the filtered Traits class +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +template, + class EK_MTag = CK_MTag, + class FK_t = Simple_cartesian< Interval_nt >, + class FK_MTag = CK_MTag, + class C2E_t = Cartesian_converter, + class C2F_t = + Cartesian_converter > +> +class Apollonius_graph_filtered_traits_2 +{ +private: + typedef Apollonius_graph_traits_2 CK_traits; + typedef Apollonius_graph_traits_2 FK_traits; + typedef Apollonius_graph_traits_2 EK_traits; + + typedef Apollonius_graph_kernel_wrapper_2 CK; + typedef Apollonius_graph_kernel_wrapper_2 FK; + typedef Apollonius_graph_kernel_wrapper_2 EK; + + typedef + Apollonius_graph_cartesian_converter C2E; + typedef + Apollonius_graph_cartesian_converter C2F; + + + + // Types for the construction kernel + typedef typename CK::Point_2 CK_Point_2; + typedef typename CK::Site_2 CK_Site_2; + + typedef typename CK::Line_2 CK_Line_2; + typedef typename CK::Ray_2 CK_Ray_2; + typedef typename CK::Segment_2 CK_Segment_2; + + typedef typename CK::FT CK_FT; + typedef typename CK::RT CK_RT; + + // Types for the exact kernel + typedef typename EK::Point_2 EK_Point_2; + typedef typename EK::Site_2 EK_Site_2; + + typedef typename EK::Line_2 EK_Line_2; + typedef typename EK::Ray_2 EK_Ray_2; + typedef typename EK::Segment_2 EK_Segment_2; + + typedef typename EK::FT EK_FT; + typedef typename EK::RT EK_RT; + + // Types for the filtering kernel + typedef typename FK::Point_2 FK_Point_2; + typedef typename FK::Site_2 FK_Site_2; + + typedef typename FK::Line_2 FK_Line_2; + typedef typename FK::Ray_2 FK_Ray_2; + typedef typename FK::Segment_2 FK_Segment_2; + + typedef typename FK::FT FK_FT; + typedef typename FK::RT FK_RT; + +public: + //----------------------------------------------------------------------- + // TYPE DEFINITIONS + //----------------------------------------------------------------------- + + // BASIC TYPES + //------------ + typedef CK_t R; + typedef CK_MTag Method_tag; + + typedef CK_traits Construction_traits; + typedef FK_traits Filtering_traits; + typedef EK_traits Exact_traits; + + typedef FK_MTag Construction_traits_method_tag; + typedef FK_MTag Filtering_traits_method_tag; + typedef EK_MTag Exact_traits_method_tag; + + typedef typename CK::Point_2 Point_2; + typedef typename CK::Site_2 Site_2; + + typedef typename CK::Line_2 Line_2; + typedef typename CK::Ray_2 Ray_2; + typedef typename CK::Segment_2 Segment_2; + + typedef typename CK::Object_2 Object_2; + typedef typename CK::FT FT; + typedef typename CK::RT RT; + + +public: + // OBJECT CONSTRUCTION & ASSIGNMENT + //--------------------------------- + typedef typename CK_traits::Construct_object_2 Construct_object_2; + typedef typename CK_traits::Assign_2 Assign_2; + +// CONSTRUCTIONS + //-------------- + // vertex and dual site + typedef typename CK_traits::Construct_Apollonius_vertex_2 + Construct_Apollonius_vertex_2; + + typedef typename CK_traits::Construct_Apollonius_site_2 + Construct_Apollonius_site_2; + +private: + // PREDICATES FOR THE TWO KERNELS + //------------------------------- + + // Predicates for the filtering kernel + + typedef typename FK_traits::Compare_x_2 FK_Compare_x_2; + typedef typename FK_traits::Compare_y_2 FK_Compare_y_2; + typedef typename FK_traits::Compare_weight_2 FK_Compare_weight_2; + typedef typename FK_traits::Orientation_2 FK_Orientation_2; + typedef typename FK_traits::Is_hidden_2 FK_Is_hidden_2; + + typedef typename FK_traits::Oriented_side_of_bisector_2 + FK_Oriented_side_of_bisector_2; + + typedef typename FK_traits::Vertex_conflict_2 FK_Vertex_conflict_2; + + typedef typename FK_traits::Finite_edge_interior_conflict_2 + FK_Finite_edge_interior_conflict_2; + + typedef typename FK_traits::Infinite_edge_interior_conflict_2 + FK_Infinite_edge_interior_conflict_2; + + typedef typename FK_traits::Is_degenerate_edge_2 + FK_Is_degenerate_edge_2; + + + // Predicates for the exact kernel + typedef typename EK_traits::Compare_x_2 EK_Compare_x_2; + typedef typename EK_traits::Compare_y_2 EK_Compare_y_2; + typedef typename EK_traits::Compare_weight_2 EK_Compare_weight_2; + typedef typename EK_traits::Orientation_2 EK_Orientation_2; + typedef typename EK_traits::Is_hidden_2 EK_Is_hidden_2; + + typedef typename EK_traits::Oriented_side_of_bisector_2 + EK_Oriented_side_of_bisector_2; + + typedef typename EK_traits::Vertex_conflict_2 EK_Vertex_conflict_2; + + typedef typename EK_traits::Finite_edge_interior_conflict_2 + EK_Finite_edge_interior_conflict_2; + + typedef typename EK_traits::Infinite_edge_interior_conflict_2 + EK_Infinite_edge_interior_conflict_2; + + typedef typename EK_traits::Is_degenerate_edge_2 + EK_Is_degenerate_edge_2; + + +public: + // PREDICATES + //----------- + + + typedef + Filtered_predicate + Compare_x_2; + + typedef + Filtered_predicate + Compare_y_2; + + typedef + Filtered_predicate + Compare_weight_2; + + typedef + Filtered_predicate + Orientation_2; + + typedef + Filtered_predicate + Is_hidden_2; + + typedef + Filtered_predicate + Oriented_side_of_bisector_2; + + typedef + Filtered_predicate + Vertex_conflict_2; + + typedef + Filtered_predicate + Finite_edge_interior_conflict_2; + + typedef + Filtered_predicate + Infinite_edge_interior_conflict_2; + + typedef + Filtered_predicate + Is_degenerate_edge_2; + +public: + //----------------------------------------------------------------------- + // ACCESS TO OBJECTS + //----------------------------------------------------------------------- + + // OBJECT CONSTRUCTION & ASSIGNMENT + Assign_2 + assign_2_object() const { + return Assign_2(); + } + + Construct_object_2 + construct_object_2_object() const { + return Construct_object_2(); + } + + + // CONSTRUCTIONS + //-------------- + Construct_Apollonius_vertex_2 + construct_Apollonius_vertex_2_object() const { + return Construct_Apollonius_vertex_2(); + } + + Construct_Apollonius_site_2 + construct_Apollonius_site_2_object() const { + return Construct_Apollonius_site_2(); + } + + // PREDICATES + //----------- + Compare_x_2 + compare_x_2_object() const { + return Compare_x_2(); + } + + Compare_y_2 + compare_y_2_object() const { + return Compare_y_2(); + } + + Compare_weight_2 + compare_weight_2_object() const { + return Compare_weight_2(); + } + + Orientation_2 + orientation_2_object() const { + return Orientation_2(); + } + + Is_hidden_2 + is_hidden_2_object() const { + return Is_hidden_2(); + } + + Oriented_side_of_bisector_2 + oriented_side_of_bisector_2_object() const { + return Oriented_side_of_bisector_2(); + } + + Vertex_conflict_2 + vertex_conflict_2_object() const { + return Vertex_conflict_2(); + } + + Finite_edge_interior_conflict_2 + finite_edge_interior_conflict_2_object() const { + return Finite_edge_interior_conflict_2(); + } + + Infinite_edge_interior_conflict_2 + infinite_edge_interior_conflict_2_object() const { + return Infinite_edge_interior_conflict_2(); + } + + Is_degenerate_edge_2 + is_degenerate_edge_2_object() const { + return Is_degenerate_edge_2(); + } + +}; + + + +CGAL_END_NAMESPACE + + +#endif // CGAL_APOLLONIUS_GRAPH_FILTERED_TRAITS_2_H diff --git a/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h index 7c69cc7ebc0..b30f424fcdd 100644 --- a/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h +++ b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_traits_2.h @@ -28,9 +28,6 @@ #define CGAL_APOLLONIUS_GRAPH_TRAITS_2_H -#include -#include - #ifndef CGAL_REP_CLASS_DEFINED #error no representation class defined #endif // CGAL_REP_CLASS_DEFINED @@ -43,15 +40,11 @@ #include #endif - -#include #include - #include - CGAL_BEGIN_NAMESPACE @@ -930,9 +923,15 @@ public: +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- //----------------------------------------------------------------------- // the Traits class //----------------------------------------------------------------------- +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- +//----------------------------------------------------------------------- template < class Rep, class MTag = Ring_tag > class Apollonius_graph_traits_2 { @@ -945,8 +944,6 @@ public: //------------ private: typedef Apollonius_graph_traits_2 Self; - -public: typedef Apollonius_graph_kernel_wrapper_2 Kernel; public: @@ -1081,298 +1078,6 @@ public: }; -//----------------------------------------------------------------------- -// the filtered Traits class -//----------------------------------------------------------------------- -template, - class EK_MTag = FK_MTag, - class C2E_t = Cartesian_converter > -class Apollonius_graph_filtered_traits_2 -{ -private: - typedef Apollonius_graph_traits_2 CK_traits; - typedef Apollonius_graph_traits_2 EK_traits; - - typedef typename CK_traits::Kernel CK; - typedef typename EK_traits::Kernel EK; - - typedef - Apollonius_graph_cartesian_converter C2E; - - - // Types for the construction kernel - typedef typename CK::Point_2 CK_Point_2; - typedef typename CK::Site_2 CK_Site_2; - - typedef typename CK::Line_2 CK_Line_2; - typedef typename CK::Ray_2 CK_Ray_2; - typedef typename CK::Segment_2 CK_Segment_2; - - typedef typename CK::FT CK_FT; - typedef typename CK::RT CK_RT; - - typedef FK_MTag CK_MTag; - - // Types for the exact kernel - typedef typename EK::Point_2 EK_Point_2; - typedef typename EK::Site_2 EK_Site_2; - - typedef typename EK::Line_2 EK_Line_2; - typedef typename EK::Ray_2 EK_Ray_2; - typedef typename EK::Segment_2 EK_Segment_2; - - typedef typename EK::FT EK_FT; - typedef typename EK::RT EK_RT; - - // Types for the filtering kernel - typedef Simple_cartesian > FK_t; - typedef Apollonius_graph_traits_2 FK_traits; - - typedef typename FK_traits::Kernel FK; - - - typedef typename FK::Point_2 FK_Point_2; - typedef typename FK::Site_2 FK_Site_2; - - typedef typename FK::Line_2 FK_Line_2; - typedef typename FK::Ray_2 FK_Ray_2; - typedef typename FK::Segment_2 FK_Segment_2; - - typedef typename FK::FT FK_FT; - typedef typename FK::RT FK_RT; - - typedef - Cartesian_converter > C2F_t; - - typedef - Apollonius_graph_cartesian_converter C2F; - -public: - //----------------------------------------------------------------------- - // TYPE DEFINITIONS - //----------------------------------------------------------------------- - - // BASIC TYPES - //------------ - typedef CK Kernel; - typedef FK_MTag Method_tag; - - typedef Kernel Construction_kernel; - typedef EK Exact_kernel; - typedef FK_MTag Filtering_kernel_method_tag; - typedef EK_MTag Exact_kernel_method_tag; - - typedef typename Kernel::Point_2 Point_2; - typedef typename Kernel::Site_2 Site_2; - - typedef typename Kernel::Line_2 Line_2; - typedef typename Kernel::Ray_2 Ray_2; - typedef typename Kernel::Segment_2 Segment_2; - - typedef typename Kernel::Object_2 Object_2; - typedef typename Kernel::FT FT; - typedef typename Kernel::RT RT; - - -public: - // OBJECT CONSTRUCTION & ASSIGNMENT - //--------------------------------- - typedef typename CK_traits::Construct_object_2 Construct_object_2; - typedef typename CK_traits::Assign_2 Assign_2; - -// CONSTRUCTIONS - //-------------- - // vertex and dual site - typedef typename CK_traits::Construct_Apollonius_vertex_2 - Construct_Apollonius_vertex_2; - - typedef typename CK_traits::Construct_Apollonius_site_2 - Construct_Apollonius_site_2; - -private: - // PREDICATES FOR THE TWO KERNELS - //------------------------------- - - // Predicates for the filtering kernel - - typedef typename FK_traits::Compare_x_2 FK_Compare_x_2; - typedef typename FK_traits::Compare_y_2 FK_Compare_y_2; - typedef typename FK_traits::Compare_weight_2 FK_Compare_weight_2; - typedef typename FK_traits::Orientation_2 FK_Orientation_2; - typedef typename FK_traits::Is_hidden_2 FK_Is_hidden_2; - - typedef typename FK_traits::Oriented_side_of_bisector_2 - FK_Oriented_side_of_bisector_2; - - typedef typename FK_traits::Vertex_conflict_2 FK_Vertex_conflict_2; - - typedef typename FK_traits::Finite_edge_interior_conflict_2 - FK_Finite_edge_interior_conflict_2; - - typedef typename FK_traits::Infinite_edge_interior_conflict_2 - FK_Infinite_edge_interior_conflict_2; - - typedef typename FK_traits::Is_degenerate_edge_2 - FK_Is_degenerate_edge_2; - - - // Predicates for the exact kernel - typedef typename EK_traits::Compare_x_2 EK_Compare_x_2; - typedef typename EK_traits::Compare_y_2 EK_Compare_y_2; - typedef typename EK_traits::Compare_weight_2 EK_Compare_weight_2; - typedef typename EK_traits::Orientation_2 EK_Orientation_2; - typedef typename EK_traits::Is_hidden_2 EK_Is_hidden_2; - - typedef typename EK_traits::Oriented_side_of_bisector_2 - EK_Oriented_side_of_bisector_2; - - typedef typename EK_traits::Vertex_conflict_2 EK_Vertex_conflict_2; - - typedef typename EK_traits::Finite_edge_interior_conflict_2 - EK_Finite_edge_interior_conflict_2; - - typedef typename EK_traits::Infinite_edge_interior_conflict_2 - EK_Infinite_edge_interior_conflict_2; - - typedef typename EK_traits::Is_degenerate_edge_2 - EK_Is_degenerate_edge_2; - - -public: - // PREDICATES - //----------- - - - typedef - Filtered_predicate - Compare_x_2; - - typedef - Filtered_predicate - Compare_y_2; - - typedef - Filtered_predicate - Compare_weight_2; - - typedef - Filtered_predicate - Orientation_2; - - typedef - Filtered_predicate - Is_hidden_2; - - typedef - Filtered_predicate - Oriented_side_of_bisector_2; - - typedef - Filtered_predicate - Vertex_conflict_2; - - typedef - Filtered_predicate - Finite_edge_interior_conflict_2; - - typedef - Filtered_predicate - Infinite_edge_interior_conflict_2; - - typedef - Filtered_predicate - Is_degenerate_edge_2; - -public: - //----------------------------------------------------------------------- - // ACCESS TO OBJECTS - //----------------------------------------------------------------------- - - // OBJECT CONSTRUCTION & ASSIGNMENT - Assign_2 - assign_2_object() const { - return Assign_2(); - } - - Construct_object_2 - construct_object_2_object() const { - return Construct_object_2(); - } - - - // CONSTRUCTIONS - //-------------- - Construct_Apollonius_vertex_2 - construct_Apollonius_vertex_2_object() const { - return Construct_Apollonius_vertex_2(); - } - - Construct_Apollonius_site_2 - construct_Apollonius_site_2_object() const { - return Construct_Apollonius_site_2(); - } - - // PREDICATES - //----------- - Compare_x_2 - compare_x_2_object() const { - return Compare_x_2(); - } - - Compare_y_2 - compare_y_2_object() const { - return Compare_y_2(); - } - - Compare_weight_2 - compare_weight_2_object() const { - return Compare_weight_2(); - } - - Orientation_2 - orientation_2_object() const { - return Orientation_2(); - } - - Is_hidden_2 - is_hidden_2_object() const { - return Is_hidden_2(); - } - - Oriented_side_of_bisector_2 - oriented_side_of_bisector_2_object() const { - return Oriented_side_of_bisector_2(); - } - - Vertex_conflict_2 - vertex_conflict_2_object() const { - return Vertex_conflict_2(); - } - - Finite_edge_interior_conflict_2 - finite_edge_interior_conflict_2_object() const { - return Finite_edge_interior_conflict_2(); - } - - Infinite_edge_interior_conflict_2 - infinite_edge_interior_conflict_2_object() const { - return Infinite_edge_interior_conflict_2(); - } - - Is_degenerate_edge_2 - is_degenerate_edge_2_object() const { - return Is_degenerate_edge_2(); - } - -}; - CGAL_END_NAMESPACE