// Copyright (c) 2005 Stanford University (USA). // All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; version 2.1 of the License. // See the file LICENSE.LGPL distributed with CGAL. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $URL$ // $Id$ // // // Author(s) : Daniel Russel #ifndef CGAL_KINETIC_SIMULATION_TRAITS_H #define CGAL_KINETIC_SIMULATION_TRAITS_H #include #include //#include #include #include //#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //#include #include //#include CGAL_KINETIC_BEGIN_NAMESPACE template struct Simulation_traits { public: typedef typename StaticKernel::FT NT; struct Static_kernel: public StaticKernel {}; struct Kinetic_kernel: public KineticKernel {}; typedef SimulatorC Simulator; typedef typename KineticKernel::Function_kernel Function_kernel; typedef typename KineticKernel::Function_kernel::Root Time; Simulation_traits(const Time &lb, const Time &ub): sp_(new Simulator(lb, ub, kk_.function_kernel_object())){} Simulation_traits(): sp_(new Simulator()) { } Simulator* simulator_handle(){ return sp_.get();} const Simulator* simulator_handle() const { return sp_.get();} Static_kernel& static_kernel_object(){return k_;} Kinetic_kernel& kinetic_kernel_object(){return kk_;} const Static_kernel& static_kernel_object() const {return k_;} const Kinetic_kernel& kinetic_kernel_object() const {return kk_;} const Function_kernel& function_kernel_object() const {return fk_;} protected: Static_kernel k_; Kinetic_kernel kk_; Function_kernel fk_; typename Simulator::Handle sp_; }; struct Suggested_exact_simulation_traits_types { //typedef CGAL::Simple_cartesian Static_kernel; typedef CGAL::Exact_predicates_exact_constructions_kernel Static_kernel; typedef Static_kernel::FT NT; typedef CGAL::POLYNOMIAL::Polynomial Function; //typedef CGAL::POLYNOMIAL::Upper_bound_root_stack_Descartes_traits Root_stack_traits; //typedef CGAL::POLYNOMIAL::Upper_bound_root_stack Root_stack; typedef CGAL::POLYNOMIAL::Sturm_root_stack_traits Root_stack_traits; typedef CGAL::POLYNOMIAL::Sturm_root_stack Root_stack; typedef CGAL::POLYNOMIAL::Kernel Function_kernel; /*typedef CGAL::Simple_cartesian Static_kernel; typedef Static_kernel::FT NT; typedef CGAL::POLYNOMIAL::CORE_kernel Function_kernel;*/ struct Simulator_function_kernel: public CGAL::Kinetic::Handle_degeneracy_function_kernel {}; typedef CGAL::Kinetic::Cartesian_kinetic_kernel Kinetic_kernel; typedef Simulator_function_kernel::Root Time; typedef CGAL::Kinetic::Two_list_pointer_event_queue Queue_base; //typedef CGAL::Kinetic::Heap_pointer_event_queue Queue_base; struct Event_queue: public Queue_base { Event_queue(const Time &start, const Time &end, Function_kernel fk, int num): Queue_base(start, end, fk, num){} }; typedef CGAL::Kinetic::Simulator Simulator; }; struct Suggested_exact_simulation_traits_base: public Simulation_traits { typedef Simulation_traits P; Suggested_exact_simulation_traits_base(const P::Time &lb, const P::Time &ub): P(lb, ub) {} Suggested_exact_simulation_traits_base() {} }; struct Suggested_inexact_simulation_traits_types { typedef CGAL::Exact_predicates_inexact_constructions_kernel Static_kernel; typedef Static_kernel::FT NT; typedef CGAL::POLYNOMIAL::Polynomial Function; typedef CGAL::POLYNOMIAL::Root_stack_default_traits Root_stack_traits; typedef CGAL::POLYNOMIAL::Numeric_root_stack Root_stack; typedef CGAL::POLYNOMIAL::Kernel Function_kernel; typedef CGAL::Kinetic::Derivitive_filter_function_kernel Simulator_function_kernel; typedef CGAL::Kinetic::Cartesian_kinetic_kernel Kinetic_kernel; typedef Simulator_function_kernel::Root Time; typedef CGAL::Kinetic::Heap_pointer_event_queue Queue_base; struct Event_queue: public Queue_base { Event_queue(const Time &start, const Time &finish, Function_kernel fk, int num): Queue_base(start, finish, fk, num){} }; typedef CGAL::Kinetic::Simulator Simulator; }; struct Suggested_inexact_simulation_traits_base: public Simulation_traits { typedef Simulation_traits P; Suggested_inexact_simulation_traits_base(const P::Time &lb, const P::Time &ub): P(lb, ub) {} Suggested_inexact_simulation_traits_base() {} }; CGAL_KINETIC_END_NAMESPACE #endif