geomc 1.0
A c++ linear algebra template library
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Related Functions | List of all members
Oriented< Shape > Class Template Reference

A wrapper shape which orients another arbitrary shape with an AffineTransform. More...

#include <geomc/shape/Oriented.h>

Inheritance diagram for Oriented< Shape >:
Convex< Shape::elem_t, Shape::N, Oriented< Shape > > RayIntersectable< Shape::elem_t, Shape::N, Oriented< Shape > > Bounded< T, _N, Derived >

Public Types

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

Public Member Functions

 Oriented ()
 Wrap a default-constructed Shape with the identity transformation.
 
 Oriented (const Shape &s)
 Wrap s in an identity transformation.
 
 Oriented (const Shape &s, const AffineTransform< T, N > &xf)
 Construct an oriented shape from s, which is positioned and oriented by xf.
 
bool contains (Vec< T, N > p) const
 Shape-point overlap test.
 
Vec< T, Nconvex_support (Vec< T, N > d) const
 
Rect< T, Nbounds () const
 
Rect< T, 1 > intersect (const Ray< T, N > &r) const
 Ray-shape intersection.
 
Oriented< Rect< T, N > > oriented_bounds () const
 Return an Oriented Rect containing the shape.
 
point_t convex_support (point_t d) const
 Geometric convex support function. More...
 
bool intersects (const Convex< Shape::elem_t, N, Shape > &other) const
 Convex shape overlap test. More...
 

Public Attributes

Shape shape
 Un-transformed shape.
 
AffineTransform< T, Nxf
 Transformation orienting shape.
 

Static Public Attributes

static constexpr size_t N = Shape::N
 The dimension of this Shape.
 

Related Functions

(Note that these are not member functions.)

template<typename T , index_t N>
using OrientedRect = Oriented< Rect< T, N > >
 Convenience typedef for oriented Rects.
 
template<typename Shape >
Oriented< Shape > operator* (const AffineTransform< typename Shape::elem_t, Shape::N > &xf, const Shape &s)
 Transform the shape s by wrapping it in an Oriented class.
 
template<typename Shape >
Oriented< Shape > operator* (const AffineTransform< typename Shape::elem_t, Shape::N > &xf, const Oriented< Shape > &s)
 Transform the oriented shape s by xf.
 
template<typename Shape >
Oriented< Shape > & operator*= (Oriented< Shape > &s, const AffineTransform< typename Shape::elem_t, Shape::N > &xf)
 In-place transform the oriented shape s by xf.
 
template<typename Shape >
Oriented< Shape > operator/ (const Shape &s, const AffineTransform< typename Shape::elem_t, Shape::N > &xf)
 Transform the shape s by the inverse of xf.
 
template<typename Shape >
Oriented< Shape > operator/ (const Oriented< Shape > &s, const AffineTransform< typename Shape::elem_t, Shape::N > &xf)
 Transform the oriented shape s by the inverse of xf.
 
template<typename Shape >
Oriented< Shape > & operator/= (Oriented< Shape > &s, const AffineTransform< typename Shape::elem_t, Shape::N > &xf)
 In-place transform the oriented shape s by the inverse of xf.
 

Detailed Description

template<typename Shape>
class geom::Oriented< Shape >

A wrapper shape which orients another arbitrary shape with an AffineTransform.

Oriented shapes can be constructed simply by applying an AffineTransform to an ordinary shape:

AffineTransform<double,3> xf = rotation(...);
Oriented<Cylinder<double,3>> oriented = xf * Cylinder<double,3>();

Transforming an Oriented results in another Oriented of the same type:

Oriented<Cylinder<double,3>> ocyl_a = xf * Cylinder<double,3>();
Oriented<Cylinder<double,3>> ocyl_b = xf * ocyl_a;

Member Function Documentation

◆ convex_support()

point_t convex_support ( point_t  d) const
inlineinherited

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< Shape::elem_t , N, Shape > &  other) const
inlineinherited

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: