This class maintains a collection of Shape objects.
More...
|
template<class InputIt > |
| ShapeSet (InputIt first, InputIt last) |
| Initializes the set by iterating from to , which are iterators into a collection of std::shared_ptr<Shape>. More...
|
|
std::vector< std::shared_ptr< Shape > > | shapes () |
|
const std::vector< std::shared_ptr< Shape > > | shapes () const |
|
void | add (std::shared_ptr< Shape > shape) |
|
void | add (const ShapeSet &other) |
|
void | clear () |
| Remove all shapes.
|
|
template<typename T > |
std::set< std::shared_ptr< Shape > > | hitSet (const T &obj) const |
| Get a set of which shapes "hit" the given object. More...
|
|
template<typename T > |
bool | hit (const T &obj) const |
| Check if any of the shapes in this set "hit" the given object. More...
|
|
|
std::ostream & | operator<< (std::ostream &out, const ShapeSet &shapeSet) |
|
This class maintains a collection of Shape objects.
◆ ShapeSet()
template<class InputIt >
Geometry2d::ShapeSet::ShapeSet |
( |
InputIt |
first, |
|
|
InputIt |
last |
|
) |
| |
|
inline |
Initializes the set by iterating from to , which are iterators into a collection of std::shared_ptr<Shape>.
◆ hit()
template<typename T >
bool Geometry2d::ShapeSet::hit |
( |
const T & |
obj | ) |
const |
|
inline |
Check if any of the shapes in this set "hit" the given object.
- Parameters
-
obj | The object to collision test |
- Returns
- True if one of the contained shapes hits the object.
◆ hitSet()
template<typename T >
std::set<std::shared_ptr<Shape> > Geometry2d::ShapeSet::hitSet |
( |
const T & |
obj | ) |
const |
|
inline |
Get a set of which shapes "hit" the given object.
- Parameters
-
obj | The object to collision test |
- Returns
- A set of all shapes that collide with the given object
The documentation for this class was generated from the following file: