mirror of
https://github.com/ivabus/pantry
synced 2024-11-14 04:25:08 +03:00
d033a15877
* new file: projects/cgal.org/package.yml new file: projects/cgal.org/surprise.cpp * -DCMAKE_BUILD_RPATH= * fixture & ldflags * case sensitive linux --------- Co-authored-by: Jacob Heider <jacob@pkgx.dev>
34 lines
No EOL
1.1 KiB
C++
34 lines
No EOL
1.1 KiB
C++
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
|
#include <CGAL/Triangulation_2.h>
|
|
#include <CGAL/draw_triangulation_2.h>
|
|
#include <CGAL/basic.h>
|
|
#include <CGAL/Coercion_traits.h>
|
|
#include <CGAL/IO/io.h>
|
|
#include <fstream>
|
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
|
typedef CGAL::Triangulation_2<K> Triangulation;
|
|
typedef Triangulation::Point Point;
|
|
|
|
template <typename A, typename B>
|
|
typename CGAL::Coercion_traits<A, B>::Type
|
|
binary_func(const A &a, const B &b)
|
|
{
|
|
typedef CGAL::Coercion_traits<A, B> CT;
|
|
CGAL_static_assertion((CT::Are_explicit_interoperable::value));
|
|
typename CT::Cast cast;
|
|
return cast(a) * cast(b);
|
|
}
|
|
|
|
int main(int argc, char **)
|
|
{
|
|
std::cout << binary_func(double(3), int(5)) << std::endl;
|
|
std::cout << binary_func(int(3), double(5)) << std::endl;
|
|
std::ifstream in("data/triangulation_prog1.cin");
|
|
std::istream_iterator<Point> begin(in);
|
|
std::istream_iterator<Point> end;
|
|
Triangulation t;
|
|
t.insert(begin, end);
|
|
if (argc == 3) // do not test Qt5 at runtime
|
|
CGAL::draw(t);
|
|
return EXIT_SUCCESS;
|
|
} |