![]() |
IOLink
IOL_v1.1.0_release
|
A Region using dynamic vectors. More...
#include <iolink/RegionX.h>
Public Types | |
| using | VectorType = VectorX< T > |
| using | SizeType = VectorX< T > |
Public Member Functions | |
| RegionX (size_t dimension) | |
| Creates an empty region. More... | |
| RegionX (const VectorType &origin, const SizeType &size) | |
| Builds a region from its origin and size. | |
| size_t | dimensionCount () const |
| The dimension of this region. | |
| const VectorType & | origin () const |
| Returns the position of the region's origin. | |
| const SizeType & | size () const |
| Returns the region's size. | |
| VectorType | min () const |
| Returns the minimal point of the region. More... | |
| VectorType | max () const |
| Return the maximal point of the region. | |
| size_t | elementCount () const |
| Returns the number of cells in this region. More... | |
| bool | isEmpty () const |
| Checks if the region is empty. More... | |
| bool | contains (const RegionX &other) const |
| Checks if this region conatins another. More... | |
| bool | contains (const VectorType &position) const |
| Checks if this region contains a point. More... | |
| bool | intersect (const RegionX &other) const |
| Checks if this region intersect another. More... | |
| RegionX | intersection (const RegionX &other) const |
| Returns the intersection of this region and another. More... | |
| RegionX | extractSliceFromAxis (size_t dimension, T origin) const |
| Returns a region of size one along one axis. More... | |
| bool | operator== (const RegionX &other) const |
| bool | operator!= (const RegionX &other) const |
| std::string | toString () const |
| Return a string representation. | |
Static Public Member Functions | |
| static RegionX | fromIndex (const VectorX< T > &index) |
| static RegionX | createFullRegion (const SizeType ®ionSize) |
| Utility factory that create the region of origin [0, 0, 0] and given size. | |
A Region using dynamic vectors.
|
explicit |
Creates an empty region.
| dimension | The dimension of the region. |
| bool iolink::RegionX< T >::contains | ( | const RegionX< T > & | other | ) | const |
Checks if this region conatins another.
| InvalidArgument | if region don't have compatible dimensions |
| bool iolink::RegionX< T >::contains | ( | const VectorType & | position | ) | const |
Checks if this region contains a point.
| InvalidArgument | if region don't have compatible dimensions |
| size_t iolink::RegionX< T >::elementCount | ( | ) | const |
Returns the number of cells in this region.
Only applicable to integer typed regions. It will return 0 for floating point regions.
| RegionX iolink::RegionX< T >::extractSliceFromAxis | ( | size_t | dimension, |
| T | origin | ||
| ) | const |
Returns a region of size one along one axis.
| dimension | axis on which the slice must be selected |
| origin | position of slice in given dimension |
| InvalidArgument | if dimension or origin are out of range |
e.g. a 3D region {{0, 0, 0}, {5, 6, 7}}
e.g. a 3D region with non-null origin { {2, 3, 4}, {5, 6, 7}}
extractSliceFromAxis(0, 3) returns 3D region {{5, 3, 4}, {1, 6, 7}}
| bool iolink::RegionX< T >::intersect | ( | const RegionX< T > & | other | ) | const |
Checks if this region intersect another.
| InvalidArgument | if region don't have compatible dimensions |
| RegionX iolink::RegionX< T >::intersection | ( | const RegionX< T > & | other | ) | const |
Returns the intersection of this region and another.
If regions does not intersect, it returns an empty region.
| InvalidArgument | if region don't have compatible dimensions |
| bool iolink::RegionX< T >::isEmpty | ( | ) | const |
Checks if the region is empty.
An integer typed region is empty if one of its sizes is 0. A floating point region is empty is one of its sizes is Nan.
| VectorType iolink::RegionX< T >::min | ( | ) | const |
Returns the minimal point of the region.
Alias for origin.