Skip to content

feat: Implement is_valid algorithm for polyhedral surfaces #1409

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/concept/polyhedral_surface.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The PolyhedralSurface Concept is defined as following:
* It must behave like a Boost.Range Random Access Range
* The type defined by the metafunction `range_value<...>::type` must fulfill
the [link geometry.reference.concepts.concept_polygon Polygon Concept]
* It must be 3-dimensional and cartesian

[heading Rules]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <boost/geometry/algorithms/detail/is_valid/pointlike.hpp>
#include <boost/geometry/algorithms/detail/is_valid/linear.hpp>
#include <boost/geometry/algorithms/detail/is_valid/polygon.hpp>
#include <boost/geometry/algorithms/detail/is_valid/polyhedral_surface.hpp>
#include <boost/geometry/algorithms/detail/is_valid/multipolygon.hpp>
#include <boost/geometry/algorithms/detail/is_valid/ring.hpp>
#include <boost/geometry/algorithms/detail/is_valid/segment.hpp>
Expand Down
15 changes: 9 additions & 6 deletions include/boost/geometry/algorithms/detail/is_valid/interface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#include <boost/geometry/strategies/default_strategy.hpp>
#include <boost/geometry/strategies/detail.hpp>
#include <boost/geometry/strategies/relate/services.hpp>

#include <boost/geometry/strategies/relate3/services.hpp>
#include <boost/geometry/strategies/relate3/cartesian.hpp>

namespace boost { namespace geometry
{
Expand Down Expand Up @@ -77,13 +78,15 @@ struct is_valid<default_strategy, false>
default_strategy)
{
// NOTE: Currently the strategy is only used for Areal geometries
typedef typename strategies::relate::services::default_strategy
// Select strategy_type based on Geometry's dimension
using strategy_type = typename std::conditional_t
<
Geometry, Geometry
>::type strategy_type;
geometry::dimension<Geometry>::value == 3,
typename strategies::relate3::services::default_strategy<Geometry, Geometry>,
typename strategies::relate::services::default_strategy<Geometry, Geometry>
>::type;

return dispatch::is_valid<Geometry>::apply(geometry, visitor,
strategy_type());
return dispatch::is_valid<Geometry>::apply(geometry, visitor, strategy_type());
}
};

Expand Down
Loading
Loading