3.7.0
Freundlich's C++ toolkit
Classes | Typedefs | Functions
fcppt::math::box Namespace Reference

Contains fcppt::math::box::object box::object and helper functions, classes and types for it. More...

Classes

struct  has_dim
 Metafunction to check the dimension of a box. More...
 
struct  is_box
 Metafunction to test if a type is a box type. More...
 
struct  is_box< fcppt::math::box::object< T, N > >
 
class  object
 A class representing axis aligned boxes, cubes, hypercubes, ... More...
 

Typedefs

template<typename T >
using rect = fcppt::math::box::object< T, 2 >
 Typedefs a two dimensional box (a rect) More...
 

Functions

template<typename T , fcppt::math::size_type N>
fcppt::math::box::object< T, N >::vector center (fcppt::math::box::object< T, N > const &_box)
 Returns the center of the box. More...
 
template<typename T , fcppt::math::size_type N>
bool operator== (fcppt::math::box::object< T, N > const &_a, fcppt::math::box::object< T, N > const &_b)
 Compare two boxes componentwise using value_type's operator== More...
 
template<typename T , fcppt::math::size_type N>
bool operator!= (fcppt::math::box::object< T, N > const &_a, fcppt::math::box::object< T, N > const &_b)
 Compare two boxes componentwise using value_type's operator!= More...
 
template<typename T , fcppt::math::size_type N>
bool operator< (fcppt::math::box::object< T, N > const &_a, fcppt::math::box::object< T, N > const &_b)
 Compare two boxes lexicographically. More...
 
template<typename T , fcppt::math::size_type N>
bool componentwise_equal (fcppt::math::box::object< T, N > const &_v1, fcppt::math::box::object< T, N > const &_v2, T const _epsilon)
 Compare two boxes component-wise using an epsilon. More...
 
template<typename T , fcppt::math::size_type N>
bool contains (fcppt::math::box::object< T, N > const &_outer, fcppt::math::box::object< T, N > const &_inner)
 Test if one box is completely inside another box. More...
 
template<typename T , typename S , fcppt::math::size_type N>
bool contains_point (fcppt::math::box::object< T, N > const &_box, fcppt::math::vector::object< T, N, S > const &_point)
 Test if a box contains a point. More...
 
template<typename T , fcppt::math::size_type N>
fcppt::array::object< fcppt::math::vector::static_< T, N >, fcppt::math::power_of_2< std::size_t >N)> corner_points (fcppt::math::box::object< T, N > const &_box)
 Returns the 2^N corner points (vertices) of the given box. More...
 
template<typename T , fcppt::math::size_type N>
fcppt::math::vector::static_< T, N > distance (fcppt::math::box::object< T, N > const &_box1, fcppt::math::box::object< T, N > const &_box2)
 Calculates the interval distance between all box dimensions. More...
 
template<typename T , fcppt::math::size_type N>
fcppt::math::box::object< T, N > extend_bounding_box (fcppt::math::box::object< T, N > const _box, typename fcppt::math::box::object< T, N >::vector const _pos)
 Extend a box to fit a point in it. More...
 
template<typename T , fcppt::math::size_type N>
fcppt::math::box::object< T, N > extend_bounding_box (fcppt::math::box::object< T, N > const &_box1, fcppt::math::box::object< T, N > const &_box2)
 Take the bounding box of two boxes. More...
 
template<typename Box , typename Function >
Box init_dim (Function const &_function)
 Initializes a box from pairs of positions and sizes. More...
 
template<typename Box , typename Function >
Box init_max (Function const &_function)
 Initializes a box from pairs of min and max positions. More...
 
template<typename T , fcppt::math::size_type N>
fcppt::math::box::object< T, N > intersection (fcppt::math::box::object< T, N > const &_a, fcppt::math::box::object< T, N > const &_b)
 Calculates the intersection of two boxes (which is, again, a box) More...
 
template<typename T , fcppt::math::size_type N>
bool intersects (fcppt::math::box::object< T, N > const &_a, fcppt::math::box::object< T, N > const &_b)
 Tests if two boxes intersect. More...
 
template<fcppt::math::size_type Index, typename T , fcppt::math::size_type N>
fcppt::tuple::object< T, T > interval (fcppt::math::box::object< T, N > const &_box)
 Creates an interval from a box. More...
 
template<typename Box >
Box null ()
 Returns the null box. More...
 
template<typename T , fcppt::math::size_type N, typename Ch , typename Traits >
std::basic_ostream< Ch, Traits > & operator<< (std::basic_ostream< Ch, Traits > &_stream, fcppt::math::box::object< T, N > const &_box)
 Outputs a box to a basic_ostream. More...
 
template<typename T , fcppt::math::size_type N>
fcppt::math::box::object< T, N > shrink (fcppt::math::box::object< T, N > const &_box, typename fcppt::math::box::object< T, N >::vector const &_absolute_values)
 Shrink a box towards its center using an absolute value. More...
 
template<typename T , fcppt::math::size_type N>
fcppt::math::box::object< T, N > stretch_absolute (fcppt::math::box::object< T, N > const &_box, typename fcppt::math::box::object< T, N >::vector const &_absolute_values)
 Stretch a box around its center using an absolute value. More...
 
template<typename T , fcppt::math::size_type N>
fcppt::math::box::object< T, N > stretch_relative (fcppt::math::box::object< T, N > const &_box, typename fcppt::math::box::object< T, N >::vector const &_factors)
 Stretch a box around its center by a given factor. More...
 
template<typename Dest , typename Conv , typename T , fcppt::math::size_type N>
Dest structure_cast (fcppt::math::box::object< T, N > const &_src)
 Converts a box into a different box of the same dimension using Conv. More...
 

Detailed Description

Contains fcppt::math::box::object box::object and helper functions, classes and types for it.