Cortex
10.0.0-a4
|
#include "IECore/BoxTraits.h"
#include "IECore/VectorTraits.h"
#include "IECore/BoxOps.inl"
Go to the source code of this file.
Namespaces | |
IECore | |
This namespace contains all components of the core library. | |
Functions | |
template<typename T > | |
BoxTraits< T >::BaseType | IECore::boxSize (const T &box) |
Returns a vector representing the length of each side of the box. | |
template<typename T > | |
BoxTraits< T >::BaseType | IECore::boxCenter (const T &box) |
Returns the center point of the box. | |
template<typename T > | |
void | IECore::boxExtend (T &box, const typename BoxTraits< T >::BaseType &p) |
Extends the box by the given point. | |
template<typename T > | |
void | IECore::boxExtend (T &box, const T &box2) |
Extends the box by the given box. | |
template<typename T > | |
T | IECore::boxIntersection (const T &box, const T &box2) |
Returns the intersection between two boxes, or the empty box if there is no intersection. | |
template<typename T > | |
bool | IECore::boxIntersects (const T &box, const typename BoxTraits< T >::BaseType &p) |
Returns true if the box intersects (contains) the given point. | |
template<typename T > | |
bool | IECore::boxIntersects (const T &box, const T &box2) |
Returns true if the box intersects the given box. | |
template<typename T > | |
bool | IECore::boxContains (const T &box, const T &containee) |
Returns true if box contains containee. | |
template<typename T > | |
bool | IECore::boxIntersects (const T &box, const typename BoxTraits< T >::BaseType &origin, const typename BoxTraits< T >::BaseType &direction, typename BoxTraits< T >::BaseType &result) |
template<typename T > | |
void | IECore::boxSplit (const T &box, T &low, T &high, int axis) |
Splits the box into two across the specified axis. | |
template<typename T > | |
void | IECore::boxSplit (const T &box, T &low, T &high) |
Splits the box into two across the major axis. | |
template<typename T > | |
int | IECore::boxMajorAxis (const T &box) |
Returns the longest axis of the box. | |
Defines useful functions for dealing with any types which define an appropriate BoxTraits struct. Although it's much prettier to use the built in operators and members for a typical box implementation, it's not particularly practical in much templated code as different box types define different syntax or semantics for such operations. These functions give less intuitive syntax but are compatible with any classes for which a valid BoxTraits specialisation exists.