-
Notifications
You must be signed in to change notification settings - Fork 228
Feature/robust predicates #617
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
Changes from 1 commit
a39bf3f
0c0f365
97f3976
d185633
e1521a2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…on in side_robust
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,9 @@ | |
|
|
||
| // Copyright (c) 2019 Tinko Bartels, Berlin, Germany. | ||
|
|
||
| // Contributed and/or modified by Tinko Bartels, | ||
| // as part of Google Summer of Code 2019 program. | ||
|
|
||
| // Use, modification and distribution is subject to the Boost Software License, | ||
| // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | ||
| // http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
@@ -10,6 +13,7 @@ | |
| #define BOOST_GEOMETRY_EXTENSIONS_TRIANGULATION_STRATEGIES_CARTESIAN_SIDE_ROBUST_HPP | ||
|
|
||
| #include <boost/geometry/util/select_most_precise.hpp> | ||
| #include <boost/geometry/util/select_calculation_type.hpp> | ||
| #include <boost/geometry/extensions/triangulation/strategies/cartesian/detail/precise_math.hpp> | ||
|
|
||
| namespace boost { namespace geometry | ||
|
|
@@ -37,7 +41,6 @@ struct side_robust | |
| //! \brief Computes double the signed area of the CCW triangle p1, p2, p | ||
| template | ||
| < | ||
| typename CoordinateType, | ||
| typename PromotedType, | ||
| typename P1, | ||
| typename P2, | ||
|
|
@@ -62,32 +65,20 @@ struct side_robust | |
| > | ||
| static inline int apply(P1 const& p1, P2 const& p2, P const& p) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe this is too generic. What is the case where
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I cannot imagine such a case, however, my choice to be that generic was motivated by side_by_triangle having the same interface and I wanted to be as compatible with it as possible.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the same interface is OK. |
||
| { | ||
| typedef typename coordinate_type<P1>::type coordinate_type1; | ||
| typedef typename coordinate_type<P2>::type coordinate_type2; | ||
| typedef typename coordinate_type<P>::type coordinate_type3; | ||
|
|
||
| typedef typename boost::mpl::if_c | ||
| typedef typename select_calculation_type_alt | ||
| < | ||
| boost::is_void<CalculationType>::type::value, | ||
| typename select_most_precise | ||
| < | ||
| typename select_most_precise | ||
| < | ||
| coordinate_type1, coordinate_type2 | ||
| >::type, | ||
| coordinate_type3 | ||
| >::type, | ||
| CalculationType | ||
| CalculationType, | ||
| P1, | ||
| P2, | ||
| P | ||
| >::type coordinate_type; | ||
| typedef typename select_most_precise | ||
| < | ||
| coordinate_type, | ||
| double | ||
| >::type promoted_type; | ||
|
|
||
|
|
||
| promoted_type sv = | ||
| side_value<coordinate_type, promoted_type>(p1, p2, p); | ||
| promoted_type sv = side_value<promoted_type>(p1, p2, p); | ||
| return sv > 0 ? 1 | ||
| : sv < 0 ? -1 | ||
| : 0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could acknowledge GSoC here if you like. See for example https://github.com/boostorg/geometry/blob/develop/include/boost/geometry/formulas/karney_direct.hpp#L5