geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
Transformed< Shape > Class Template Reference

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

#include <geomc/shape/Transformed.h>

Inheritance diagram for Transformed< Shape >:
Convex< Shape::elem_t, Shape::N, Transformed< Shape > > RayIntersectable< Shape::elem_t, Shape::N, Transformed< Shape > > Bounded< Shape::elem_t, N, Transformed< Shape > > Dimensional< Shape::elem_t, N >

Public Types

using elem_t
 The coordinate type of this object.
 
using point_t
 The type of a point in this object's space.
 
using T = typename Shape::elem_t
 The coordinate type of this Shape.
 

Public Member Functions

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

Static Public Member Functions

static constexpr bool admits_cusps ()
 

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 Symbols

(Note that these are not member symbols.)

template<typename T, index_t N>
using AffineBox = Transformed<Rect<T,N>>
 Convenience typedef for transformed Rects.
 
template<typename Shape>
Transformed< Shape > operator* (const AffineTransform< typename Shape::elem_t, Shape::N > &xf, const Shape &s)
 Transform the shape s by wrapping it in an Transformed class.
 
template<typename Shape>
Transformed< Shape > operator* (const AffineTransform< typename Shape::elem_t, Shape::N > &xf, const Transformed< Shape > &s)
 Transform the transformed shape s by xf.
 
template<typename Shape, typename T, index_t N>
Transformed< Shape > operator* (const Isometry< T, N > &xf, const Transformed< Shape > &s)
 Transform the shape s by an isometry xf.
 
template<typename Shape, typename T, index_t N>
Transformed< Shape > operator* (const Similarity< T, N > &xf, const Transformed< Shape > &s)
 Transform the shape s by a similarity transform xf.
 
template<typename Shape>
Transformed< Shape > & operator*= (Transformed< Shape > &s, const AffineTransform< typename Shape::elem_t, Shape::N > &xf)
 In-place transform the transformed shape s by xf.
 
template<typename Shape>
Transformed< 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>
Transformed< Shape > operator/ (const Transformed< Shape > &s, const AffineTransform< typename Shape::elem_t, Shape::N > &xf)
 Transform the transformed shape s by the inverse of xf.
 
template<typename Shape, typename T, index_t N>
Transformed< Shape > operator/ (const Transformed< Shape > &s, const Isometry< T, N > &xf)
 Inverse transform the shape s by an isometry xf.
 
template<typename Shape, typename T, index_t N>
Transformed< Shape > operator/ (const Transformed< Shape > &s, const Similarity< T, N > &xf)
 Inverse transform the shape s by a similarity transform xf.
 
template<typename Shape>
Transformed< Shape > & operator/= (Transformed< Shape > &s, const AffineTransform< typename Shape::elem_t, Shape::N > &xf)
 In-place transform the transformed shape s by the inverse of xf.
 
template<typename T>
using TransformedCone = Transformed<Cone<T>>
 Convenience typedef for an oriented cone.
 

Detailed Description

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

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

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

AffineTransform<double,3> xf = rotation(...);
Transformed<Cylinder<double,3>> transformed = xf * Cylinder<double,3>();

Transforming a Transformed results in another Transformed of the same type:

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

Because transformations may include shears and nonuniform scales, some operations like signed distance fields and orthogonal projections cannot be implemented for transformed shapes in general. For shapes which are guaranteed to be transformed by a similarity transform (translation, rotation, and uniform scale), see Similar.

Member Typedef Documentation

◆ point_t

using point_t
inherited

The type of a point in this object's space.

An N-vector of T if N > 1, otherwise a T.

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 files: