Shape

struct Empty
union ShapeContent

Public Functions

inline ShapeContent()
inline ShapeContent(Vect2<T> M)
inline ShapeContent(Line<T> L)
inline ShapeContent(Segment<T> S)

Public Members

Empty empty
Vect2<T> point
Line<T> line
Segment<T> seg
template<class T>
class Shape
#include <shape.hpp>

Safely contains any kind of shape.

Public Types

enum ShapeType

Values:

enumerator EMPTY
enumerator POINT
enumerator LINE
enumerator SEGMENT

Public Functions

inline Shape()
inline Shape(const Vect2<T> point)
inline Shape(const Line<T> line)
inline Shape(const Segment<T> seg)
inline ShapeType type() const

Returns the type of the shape.

inline Vect2<T> point() const
inline Line<T> line() const
inline Segment<T> segment() const

Private Members

ShapeType m_type
ShapeContent<T> m_content