geomc 1.0
A c++ linear algebra template library
Public Types | Public Member Functions | Static Public Attributes | List of all members
Convex< T, N, Derived > Class Template Reference

Base class describing convex shapes in N-dimensional space. More...

#include <geomc/shape/Shape.h>

Inheritance diagram for Convex< T, N, Derived >:
Bounded< T, N, Derived > AnyConvex< Shape::elem_t, Shape::N > AnyConvexImpl< Shape >

Public Types

typedef PointType< T, N >::point_t point_t
 
typedef T elem_t
 The coordinate type of this shape.
 

Public Member Functions

point_t convex_support (point_t d) const
 Geometric convex support function. More...
 
template<typename Shape >
bool intersects (const Convex< T, N, Shape > &other) const
 Convex shape overlap test. More...
 
Rect< T, Nbounds () const
 Produces an axis-aligned box completely enclosing this shape. More...
 

Static Public Attributes

static constexpr size_t N
 The dimension of this shape.
 

Detailed Description

template<typename T, index_t N, typename Derived>
class geom::Convex< T, N, Derived >

Base class describing convex shapes in N-dimensional space.

Uses the curiously-recurring template pattern to perform static polymorphism. Override convex_support() in the derived implementation.

Member Function Documentation

◆ bounds()

Rect< T, N > bounds ( ) const
inline

Produces an axis-aligned box completely enclosing this shape.

The default implementation calls convex_support() along each of the principal axes to find the extents.

◆ convex_support()

point_t convex_support ( point_t  d) const
inline

Geometric convex support function.

Returns the point on the surface of this convex shape that is furthest along direction d (i.e., has the highest dot product with d).

All shapes which implement this function automatically support geometrical intersection tests with any other Convex object.

Parameters
dDirection along which to find a support plane.
Returns
A point on the surface of this convex shape.

◆ intersects()

bool intersects ( const Convex< T, N, Shape > &  other) const
inline

Convex shape overlap test.

Returns
True if and only if this convex shape overlaps other; false otherwise.

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