HDK
|
#include <UT_OBBox2D.h>
Public Member Functions | |
UT_OBBox2DT (const UT_Array< UT_Vector2T< T > > &points, T tol=0.05, T bd_advantage=0.0) | |
UT_Matrix2T< T > | getBasis () const |
Return the basis that defines the orientation of the OBB. More... | |
UT_Vector2T< T > | getRadii () const |
Return the half radii(side length) of the OBB. More... | |
UT_Vector2T< T > | getCenter () const |
Return the center of the OBB. More... | |
UT_Vector2T< T > | getMinAxis () const |
Return the non-oriented bounding box. More... | |
UT_Vector2T< T > | getMaxAxis () const |
Return the non-oriented bounding box. More... | |
UT_Vector2T< T > | getTangentAxis () const |
int | getSupportPoints (int &x0, int &x1, int &y0, int &y1) const |
bool | operator== (const UT_OBBox2DT< T > &obb) const |
bool | operator!= (const UT_OBBox2DT< T > &obb) const |
bool | isEqual (const UT_OBBox2DT< T > &obb, T tolerance=T(SYS_FTOLERANCE)) const |
Protected Member Functions | |
void | calcOBB (const UT_Array< UT_Vector2T< T > > &points, T tol, T bd_advantage) |
Protected Attributes | |
UT_Matrix2T< T > | myBasis |
UT_Vector2T< T > | myCenter |
UT_Vector2T< T > | myRadii |
int | myXPivot0 |
int | myXPivot1 |
int | myYPivot0 |
int | myYPivot1 |
bool | myXPivot0Tangent |
bool | myXPivot1Tangent |
bool | myYPivot0Tangent |
bool | myYPivot1Tangent |
Definition at line 22 of file UT_OBBox2D.h.
UT_OBBox2DT< T >::UT_OBBox2DT | ( | const UT_Array< UT_Vector2T< T > > & | points, |
T | tol = 0.05 , |
||
T | bd_advantage = 0.0 |
||
) |
points is an array of 2d vectors and tol is the tolerance parameter tol allows the returned answer to be (1 + tol) larger than the smallest possible. The returned answer will then be the oriented bounding box "last" encountered which is up to (1 + tol) larger than the best found box. This can be useful for avoiding rapid changes to the result when input positions are only slightly perturbed. The bd_advantage can be useful when the points list the edges of a polygon in order. If bd_advantage is nonzero, then the area of an oriented bounding box that is tangent to a boundary edge of the input polygon (consecutive points in the array) is regarded as multiplied by (1.0 - bd_advantage). This prioritizes solutions that though suboptimal are close enough to the optimal and align with an input edge when that is preferred.
NB. tol and bd_advantage my fight each other. Make sure you pick a larger values for more important one.
|
protected |
|
inline |
Return the basis that defines the orientation of the OBB.
Definition at line 48 of file UT_OBBox2D.h.
|
inline |
Return the center of the OBB.
Definition at line 52 of file UT_OBBox2D.h.
|
inline |
Return the non-oriented bounding box.
Definition at line 62 of file UT_OBBox2D.h.
|
inline |
Return the non-oriented bounding box.
Definition at line 55 of file UT_OBBox2D.h.
|
inline |
Return the half radii(side length) of the OBB.
Definition at line 50 of file UT_OBBox2D.h.
int UT_OBBox2DT< T >::getSupportPoints | ( | int & | x0, |
int & | x1, | ||
int & | y0, | ||
int & | y1 | ||
) | const |
|
inline |
Return the axis (or one of the axes) with the appropriate sign along which the bounding oriented box is tangent to the convex hull of the point set.
Definition at line 71 of file UT_OBBox2D.h.
bool UT_OBBox2DT< T >::isEqual | ( | const UT_OBBox2DT< T > & | obb, |
T | tolerance = T(SYS_FTOLERANCE) |
||
) | const |
|
inline |
Definition at line 89 of file UT_OBBox2D.h.
bool UT_OBBox2DT< T >::operator== | ( | const UT_OBBox2DT< T > & | obb | ) | const |
|
protected |
Definition at line 101 of file UT_OBBox2D.h.
|
protected |
Definition at line 102 of file UT_OBBox2D.h.
|
protected |
Definition at line 103 of file UT_OBBox2D.h.
|
protected |
Definition at line 105 of file UT_OBBox2D.h.
|
protected |
Definition at line 106 of file UT_OBBox2D.h.
|
protected |
Definition at line 105 of file UT_OBBox2D.h.
|
protected |
Definition at line 106 of file UT_OBBox2D.h.
|
protected |
Definition at line 105 of file UT_OBBox2D.h.
|
protected |
Definition at line 107 of file UT_OBBox2D.h.
|
protected |
Definition at line 105 of file UT_OBBox2D.h.
|
protected |
Definition at line 107 of file UT_OBBox2D.h.