GT RoboCup SSL
Soccer software, robot firmware
Geometry2d::CompositeShape Class Reference

A Geometry2d::CompositeShape is a Shape that is made up of other shapes. More...

Public Types

typedef std::vector< std::shared_ptr< Shape > >::const_iterator const_iterator
 
typedef std::vector< std::shared_ptr< Shape > >::iterator iterator
 
typedef std::shared_ptr< Shapevalue_type
 

Public Member Functions

 CompositeShape (const std::shared_ptr< Shape > shape)
 
 CompositeShape (const CompositeShape &other)
 
Shapeclone () const override
 
virtual bool containsPoint (Point pt) const override
 
virtual bool nearPoint (Point pt, float threshold) const override
 
void add (const std::shared_ptr< Shape > shape)
 
void add (const CompositeShape &compShape)
 adds 's subshapes to the receiver
 
const std::vector< std::shared_ptr< Shape > > & subshapes () const
 
void clear ()
 removes all subshapes
 
bool empty ()
 
unsigned int size () const
 
template<typename T >
bool hit (const T &obj) const
 Checks if a given shape is in it. More...
 
bool hit (Point pt) const override
 Returns true if the given point is within one robot radius of the shape.
 
bool hit (const Segment &seg) const override
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
std::string toString () override
 
std::shared_ptr< Shapeoperator[] (unsigned int index)
 
std::shared_ptr< const Shapeoperator[] (unsigned int index) const
 

Detailed Description

A Geometry2d::CompositeShape is a Shape that is made up of other shapes.

+ Inheritance diagram for Geometry2d::CompositeShape:
+ Collaboration diagram for Geometry2d::CompositeShape:

Member Function Documentation

◆ hit()

template<typename T >
bool Geometry2d::CompositeShape::hit ( const T &  obj) const
inline

Checks if a given shape is in it.

Parameters
objThe object to collision test
Returns
A bool telling whether or not there were any collisions

The documentation for this class was generated from the following files: