|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Represents a polygon with generic curves for edges. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/primal/geometry/CurvedPolygon.hpp>
Public Types | |
| using | NumericType = typename CurveType::NumericType |
| using | PointType = typename CurveType::PointType |
| using | VectorType = typename CurveType::VectorType |
| using | BoundingBoxType = typename CurveType::BoundingBoxType |
Public Member Functions | |
| CurvedPolygon ()=default | |
| Default constructor for an empty polygon. More... | |
| CurvedPolygon (int nEdges) | |
| Constructor for an empty CurvedPolygon that reserves space for the given number of Edges. More... | |
| template<typename OtherCurveType > | |
| CurvedPolygon (const CurvedPolygon< OtherCurveType > &other_poly) | |
| Copy constructor for another curve type. More... | |
| CurvedPolygon (axom::ArrayView< const CurveType > curves) | |
| ! More... | |
| CurvedPolygon (const CurveType *curves, int nEdges) | |
| ! More... | |
| CurvedPolygon (const axom::Array< CurveType > &curves) | |
| ! More... | |
| void | clear () |
| Clears the list of edges. More... | |
| bool | empty () const |
| Returns true if the polygon has no edges. More... | |
| CurveType & | operator[] (int idx) |
| const CurveType & | operator[] (int idx) const |
| std::ostream & | print (std::ostream &os) const |
| Simple formatted print of a CurvedPolygon instance. More... | |
| bool | isClosed (double tol=1e-5) const |
| Check closedness of a CurvedPolygon. More... | |
| void | reverseOrientation () |
| Reverses orientation of a CurvedPolygon. More... | |
| BoundingBoxType | boundingBox () const |
| Returns an axis-aligned bounding box containing the CurvedPolygon. More... | |
Operations on edges | |
| int | numEdges () const |
| Return the number of edges in the polygon. More... | |
| void | setNumEdges (int ngon) |
| void | addEdge (const CurveType &c1) |
| Appends a curve to the list of edges. More... | |
| void | addEdge (CurveType &&c1) |
| Consumes then appends a curve to the list of edges. More... | |
| void | splitEdge (int idx, NumericType t) |
| Splits an edge "in place". More... | |
| axom::Array< CurveType > & | getEdges () |
| Returns a reference to the underlying array of curved edges. More... | |
| const axom::Array< CurveType > & | getEdges () const |
| Returns a const reference to the underlying array of curved edges. More... | |
Friends | |
| bool | operator== (const CurvedPolygon< CurveType > &lhs, const CurvedPolygon< CurveType > &rhs) |
| Tests equality of two CurvedPolygons. More... | |
| bool | operator!= (const CurvedPolygon< CurveType > &lhs, const CurvedPolygon< CurveType > &rhs) |
| Tests inequality of two CurvedPolygons. More... | |
Represents a polygon with generic curves for edges.
| NDIMS | the number of dimensions |
| using axom::primal::CurvedPolygon< CurveType >::NumericType = typename CurveType::NumericType |
| using axom::primal::CurvedPolygon< CurveType >::PointType = typename CurveType::PointType |
| using axom::primal::CurvedPolygon< CurveType >::VectorType = typename CurveType::VectorType |
| using axom::primal::CurvedPolygon< CurveType >::BoundingBoxType = typename CurveType::BoundingBoxType |
|
default |
Default constructor for an empty polygon.
|
inlineexplicit |
Constructor for an empty CurvedPolygon that reserves space for the given number of Edges.
| [in] | numExpectedEdges | number of edges for which to reserve space |
References axom::Array< T, DIM, SPACE, StoragePolicy >::reserve(), axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), and SLIC_ASSERT.
|
inline |
Copy constructor for another curve type.
References axom::primal::CurvedPolygon< CurveType >::numEdges(), and axom::Array< T, DIM, SPACE, StoragePolicy >::resize().
|
inline |
!
Constructor for CurvedPolygon from an ArrayView of curves
|
inline |
!
Constructor from a c-style array of nEdges curves
|
inline |
!
Constructor from a Axom array of curves
|
inline |
Clears the list of edges.
References axom::Array< T, DIM, SPACE, StoragePolicy >::clear().
|
inline |
Returns true if the polygon has no edges.
References axom::Array< T, DIM, SPACE, StoragePolicy >::empty().
|
inline |
Return the number of edges in the polygon.
References axom::Array< T, DIM, SPACE, StoragePolicy >::size().
|
inline |
References axom::Array< T, DIM, SPACE, StoragePolicy >::resize(), and SLIC_ASSERT.
|
inline |
Appends a curve to the list of edges.
References axom::Array< T, DIM, SPACE, StoragePolicy >::push_back().
|
inline |
Consumes then appends a curve to the list of edges.
References axom::Array< T, DIM, SPACE, StoragePolicy >::push_back().
|
inline |
Splits an edge "in place".
References AXOM_STATIC_ASSERT_MSG, axom::Array< T, DIM, SPACE, StoragePolicy >::begin(), axom::Array< T, DIM, SPACE, StoragePolicy >::insert(), axom::primal::CurvedPolygon< CurveType >::numEdges(), axom::Array< T, DIM, SPACE, StoragePolicy >::reserve(), axom::Array< T, DIM, SPACE, StoragePolicy >::size(), and SLIC_ASSERT.
|
inline |
Returns a reference to the underlying array of curved edges.
|
inline |
Returns a const reference to the underlying array of curved edges.
|
inline |
Retrieves the curve at index idx
|
inline |
Retrieves the curve at index idx
|
inline |
Simple formatted print of a CurvedPolygon instance.
| os | The output stream to write to |
References axom::primal::CurvedPolygon< CurveType >::numEdges().
|
inline |
Check closedness of a CurvedPolygon.
A CurvedPolygon is closed when the endpoint of each edge coincides with startpoint of next edge
References axom::utilities::isNearlyEqual(), axom::primal::CurvedPolygon< CurveType >::numEdges(), and axom::primal::squared_distance().
|
inline |
Reverses orientation of a CurvedPolygon.
References AXOM_STATIC_ASSERT_MSG, axom::primal::CurvedPolygon< CurveType >::numEdges(), and axom::utilities::swap().
|
inline |
Returns an axis-aligned bounding box containing the CurvedPolygon.
|
friend |
Tests equality of two CurvedPolygons.
|
friend |
Tests inequality of two CurvedPolygons.