-
Notifications
You must be signed in to change notification settings - Fork 228
Defined a geometry for polyhedron #789
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
Closed
Siddharth-coder13
wants to merge
12
commits into
boostorg:develop
from
Siddharth-coder13:3d-geometries
Closed
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
00df0e5
Defined a geometry for polyhedron
Siddharth-coder13 617970d
Changed name from Polyhedron to PolyhedralSurface
Siddharth-coder13 09917a0
Added prefix for PolyhedralSurface
Siddharth-coder13 2ee1f66
Fixed failed checks
Siddharth-coder13 f3355d8
Fixed failed checks
Siddharth-coder13 6db266c
Fixed failed checks
Siddharth-coder13 030d240
Added polyhedral concept check
Siddharth-coder13 b551f6d
Added wkt read feature to polyhedral surfaces
Siddharth-coder13 c1412c6
Added wkt write feature for polyhedral surfaces
Siddharth-coder13 90b4c79
Added suggested changes
Siddharth-coder13 d6b8e7c
Added suggested changes
Siddharth-coder13 408ca8f
Fixed identation
Siddharth-coder13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
include/boost/geometry/geometries/PolyhedralSurface.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#ifndef BOOST_GEOMETRY_GEOMETRIES_POLYHEDRALSURFACE_HPP | ||
#define BOOST_GEOMETRY_GEOMETRIES_POLYHEDRALSURFACE_HPP | ||
|
||
#include <memory> | ||
#include <vector> | ||
|
||
#include <boost/concept/assert.hpp> | ||
|
||
#include <boost/geometry/geometries/concepts/point_concept.hpp> | ||
#include <boost/geometry/geometries/ring.hpp> | ||
#include <boost/geometry/core/tag.hpp> | ||
#include <boost/geometry/core/tags.hpp> | ||
|
||
#include <boost/config.hpp> | ||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST | ||
#include <initializer_list> | ||
#endif | ||
|
||
namespace boost { namespace geometry | ||
{ | ||
|
||
namespace model | ||
{ | ||
|
||
|
||
template | ||
< | ||
typename Ring, | ||
template<typename, typename> class Container = std::vector, | ||
template<typename> class Allocator = std::allocator | ||
|
||
Siddharth-coder13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> | ||
class PolyhedralSurface : public Container<Ring, Allocator<Ring> > | ||
Siddharth-coder13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
{ | ||
BOOST_CONCEPT_ASSERT( (concepts::Ring<Ring>) ); | ||
|
||
public : | ||
|
||
using point_type = model::point<double, 3, boost::geometry::cs::cartesian>; | ||
using ring_type = ring<point_type, true, true>; | ||
using ph = Container<ring_type, Allocator<ring_type> >; | ||
|
||
#ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST | ||
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. @awulkiew do we still need these defines in new code? |
||
|
||
/// \constructor_default{polyhedron} | ||
inline PolyhedralSurface() | ||
: ph() | ||
{} | ||
|
||
/// \constructor_initialized_list{polyhedron} | ||
inline PolyhedralSurface(std::initializer_list<ring_type> l) | ||
: ph(l.begin(), l.end()) | ||
{} | ||
Siddharth-coder13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
#endif | ||
|
||
}; | ||
|
||
} // namespace model | ||
|
||
#ifndef DOXYGEN_NO_TRAITS_SPECIALIZATIONS | ||
namespace traits | ||
{ | ||
|
||
template | ||
< | ||
typename Ring, | ||
template<typename, typename> class Container, | ||
template<typename> class Allocator | ||
> | ||
struct tag | ||
< | ||
model::PolyhedralSurface | ||
< | ||
Ring, | ||
Container, Allocator | ||
> | ||
> | ||
{ | ||
typedef polyhedral_surface_tag type; | ||
}; | ||
|
||
template | ||
< | ||
typename Ring, | ||
template<typename, typename> class Container, | ||
template<typename> class Allocator | ||
> | ||
struct Poly_ring_type | ||
Siddharth-coder13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
< | ||
model::PolyhedralSurface | ||
< | ||
Ring, | ||
Container, Allocator | ||
> | ||
> | ||
{ | ||
typedef typename model::PolyhedralSurface | ||
< | ||
Ring, | ||
Container, Allocator | ||
>::ring_type& type; | ||
}; | ||
|
||
|
||
|
||
|
||
} // namespace traits | ||
#endif // DOXYGEN_NO_TRAITS_SPECIALIZATIONS | ||
|
||
}} // namespace boost::geometry | ||
|
||
#endif |
62 changes: 62 additions & 0 deletions
62
include/boost/geometry/geometries/concepts/PolyhedralSurface_concept.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#ifndef BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POLYHEDRALSURFACE_HPP | ||
#define BOOST_GEOMETRY_GEOMETRIES_CONCEPTS_POLYHEDRALSURFACE_HPP | ||
|
||
#include <boost/concept_check.hpp> | ||
#include <boost/range/concepts.hpp> | ||
#include <boost/geometry/core/access.hpp> | ||
#include <boost/geometry/core/ring_type.hpp> | ||
#include <boost/geometry/geometries/concepts/ring_concept.hpp> | ||
|
||
namespace boost { namespace geometry { namespace concepts | ||
{ | ||
|
||
|
||
template <typename Geometry> | ||
class PolyhedralSurface | ||
Siddharth-coder13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
|
||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS | ||
|
||
typedef typename ring_type<Geometry>::type ring_type; | ||
|
||
|
||
BOOST_CONCEPT_ASSERT( (concepts::Ring<ring_type>) ); | ||
|
||
public: | ||
|
||
BOOST_CONCEPT_USAGE(PolyhedralSurface) | ||
{ | ||
|
||
} | ||
#endif | ||
|
||
}; | ||
|
||
//polyhedral surface(constant version) | ||
template <typename Geometry> | ||
class ConstPolyhedral | ||
Siddharth-coder13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
{ | ||
#ifndef DOXYGEN_NO_CONCEPT_MEMBERS | ||
|
||
typedef typename std::remove_const<Geometry>::type const_polyhedral_type; | ||
Siddharth-coder13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
Siddharth-coder13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
typedef typename ring_type<const_polyhedral_type>::type ring_type; | ||
|
||
BOOST_CONCEPT_ASSERT( (concepts::ConstRing<ring_type>) ); | ||
|
||
public: | ||
|
||
Siddharth-coder13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
BOOST_CONCEPT_USAGE(ConstPolyhedral) | ||
{ | ||
|
||
Siddharth-coder13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
} | ||
|
||
#endif | ||
}; | ||
|
||
Siddharth-coder13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} // namepspace concepts | ||
|
||
} // namespace geometry | ||
|
||
} // namespace boost | ||
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
include/boost/geometry/geometries/register/PolyhedralSurface.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef BOOST_GEOMETRY_GEOMETRIES_REGISTER_POLYHEDRALSURFACE_HPP | ||
#define BOOST_GEOMETRY_GEOMETRIES_REGISTER_POLYHEDRALSURFACE_HPP | ||
|
||
|
||
#include <boost/geometry/core/tag.hpp> | ||
#include <boost/geometry/core/tags.hpp> | ||
|
||
#define BOOST_GEOMETRY_REGISTER_POLYHEDRALSURFACE(PolyhedralSurface) \ | ||
namespace boost { namespace geometry { namespace traits { \ | ||
template<> struct tag<PolyhedralSurface> { typedef PolyhedralSurface_tag type; }; \ | ||
}}} | ||
Siddharth-coder13 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
|
||
#define BOOST_GEOMETRY_REGISTER_POLYHEDRALSURFACE_TEMPLATED(PolyhedralSurface) \ | ||
namespace boost { namespace geometry { namespace traits { \ | ||
template<typename P> struct tag< PolyhedralSurface<P> > { typedef PolyhedralSurface_tag type; }; \ | ||
}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.